Documentation

Documentation

A short path from a fresh device to a paired, agent-ready command layer. Full technical reference lives in the repository.

1 · REQUIREMENTS

  • Android 8.0+ device (tested through Android 15) & Windows/macOS/Linux PC host
  • Both devices connected on the same local Wi-Fi or tethered Android hotspot
  • Python 3.10+ installed on the PC host for the FastAPI companion server

2 · INSTALL THE COMPANION SERVER

  • Clone or pull the repository on your host machine
  • Install dependencies: pip install -r requirements.txt
  • Start the server: python -m uvicorn mobile_server.main:app --port 8000

3 · PAIR VIA 6-DIGIT PIN GATEWAY

  • Install the signed APK on Android and launch the app
  • Auto-discover the host over UDP, or enter the host IP
  • Enter the synchronized 6-digit PIN to establish AES-GCM-256 encryption

4 · CONNECT MCP & WEB DASHBOARD

  • Open the Cyber Web Dashboard in your browser at http://localhost:8000/dashboard
  • Drop the MCP config snippet into Cursor IDE or Claude Desktop
  • Expose phone hardware tools to AI agents with granular permission tiers

System Overview

How the Android client, desktop companion server, WebRTC engine and AI agents connect.

VISAR Edge Mobile is a zero-trust, local-first command cockpit consisting of two primary endpoints: the native Android Kotlin/Compose deck in your hand and the Python FastAPI companion server on your PC. They establish persistent AES-GCM-256 encrypted WebSocket links and WebRTC video/audio pipelines, completely isolated from third-party clouds.

  • Android Handset Deck - Kotlin/Jetpack Compose, hardware execution engine, WebRTC optical feed, OTP ring buffer & holographic trackpad.
  • Host Companion Server - Python 3.10+ FastAPI server, system telemetry sampler, command dispatcher, Web Dashboard & MCP stdio/HTTP server.
  • AI Agent Clients - Cursor, Claude Desktop, Claude Code, or custom LLM agents utilizing the Model Context Protocol.
  • Cyber Web Dashboard - In-browser command center running at http://localhost:8000/dashboard with real-time gauges and terminal runner.

Zero-Trust Security & PIN Pairing

AES-GCM-256 payload encryption, 6-digit PIN handshake, and trusted device registry.

Every frame and REST payload is encrypted end-to-end using AES-GCM-256 with 12-byte IVs, 128-bit authentication tags, and PBKDF2 HMAC-SHA256 derived keys. Legacy plaintext passkeys have been completely eradicated.

# Automated 6-digit PIN pairing flow:
# 1. Host generates short-lived 6-digit PIN with 5-minute expiry
# 2. Handset submits PIN via auto-focus digit slots
# 3. Server issues cryptographically signed session token (Authorization: Bearer <token>)
# 4. Device is registered in trusted_devices.json with granular permissions

The token-bucket rate limiter enforces brute-force protection: 3 consecutive failed authentication attempts immediately triggers a 10-minute network ban.

Tactical Eye & WebRTC Surveillance

Low-latency PC display screen mirroring, optical webcam feeds, and live voice transmission.

Built on the Google WebRTC SDK (Android) and Python aiortc backend, Tactical Eye streams real-time desktop video and webcam feeds directly to your phone under DTLS-SRTP encryption with 0% idle CPU overhead.

  • PC Display Feed - Real-time screen capture streamed with hardware-accelerated H.264 / VP8 encoding.
  • Optical Sensor Feed - Live webcam video streamed to the mobile OLED display.
  • Voice Mode - Ultra-low latency acoustic push-to-talk transmission directly into PC audio hardware.
  • Hotspot Traversal - Automated ICE candidate rewriting resolves tethered Android hotspot network traversal.

Setup & Installation

Run the companion server, pair the handset, and access the desktop Web Dashboard.

  • Ensure Python 3.10+ is installed on your PC host.
  • Clone or pull the companion server repository on your host machine.
  • Install dependencies: pip install -r requirements.txt
  • Launch the FastAPI server and install the signed Android APK.
# 1. Start the desktop companion server
python -m uvicorn mobile_server.main:app --host 0.0.0.0 --port 8000 --reload

# Output:
# [VISAR] Companion Server online: http://0.0.0.0:8000
# [VISAR] Cyber Web Dashboard available: http://localhost:8000/dashboard
# [VISAR] AES-GCM-256 Cryptographic Core active
# [VISAR] MCP Hardware Gateway ready for stdio bridge

Allow port 8000 through your local Windows Defender or Linux firewall for traffic within your home/office subnet.

MCP Integration for Cursor & Claude

Connect AI coding assistants and desktop agents directly to native phone hardware.

The companion server exposes an official Model Context Protocol (MCP) stdio and HTTP gateway. Add the configuration to your AI client to immediately grant the agent access to phone tools under visible user control.

{
  "mcpServers": {
    "visar-mobile": {
      "command": "python",
      "args": ["-m", "mobile_server.mcp_stdio"],
      "env": {
        "VISAR_HOST_URL": "http://127.0.0.1:8000"
      }
    }
  }
}

Every hardware tool call is routed through an async Hold & Wake bridge with a 5-second timeout, accompanied by a non-disableable visual banner on the phone screen for transparent security.

Socket & Data Protocol

Frame structure for real-time telemetry, trackpad deltas and remote execution commands.

Frames between the Android client and the companion server use high-speed newline-delimited JSON (NDJSON) over a persistent AES-GCM-256 encrypted WebSocket link.

// Command execution frame
{ "t": "cmd", "id": "req-9812", "p": { "action": "exec", "target": "open_terminal" } }

// Command acknowledgement frame
{ "t": "ack", "id": "req-9812", "p": { "ok": true, "duration_ms": 18 } }

// Live dual-node telemetry broadcast
{ "t": "telemetry", "p": { "cpu_pct": 14.2, "ram_pct": 68.4, "temp_c": 49.0, "batt_lvl": 94, "current_ma": 420, "charging": true } }

Hardware Tools Reference

The full hardware tool surface exposed to agents via the Android Tool Engine.

All tools are implemented in Android Kotlin via the AndroidToolEngine singleton with structured error handling and Android 10+ background permission fallbacks.

MCP Reference

Tools Exposed to AI Clients

Every tool is executed natively on the device with structured returns and safety boundaries.

Tool NameCapability & Description
mobile_list_installed_appsEnumerate user, system or all installed packages.
mobile_launch_appLaunch any installed package by identifier.
mobile_send_toast_or_alertSurface a toast or notification banner on the device.
mobile_set_clipboardWrite text into the Android clipboard.
mobile_read_latest_otpRead the most recent one-time code from the notification ring buffer.
mobile_trigger_pingVibrate and ring the handset, restoring volume afterwards.
mobile_share_payloadFire a share intent, or a tappable notification when backgrounded.
mobile_get_power_diagnosticsReturn full battery, current and thermal diagnostics.

Full 16-section technical reference, error schemas and configuration files: MCP_DOCS.md in the repository.