Fast Mobile MCP
High-performance mobile automation architecture with a thin MCP gateway and dedicated Go workers for Android and iOS.
fast-mobile-mcp
High-performance mobile automation architecture with a thin MCP gateway and dedicated Go workers for Android and iOS.
Purpose
fast-mobile-mcp exists to make mobile automation usable from MCP clients (agents, CLIs, IDE assistants) with production-like behavior:
- one MCP endpoint for both Android and iOS
- strict per-device action serialization with cross-device parallelism
- snapshot-based element references (
ref_id) for stable follow-up actions - small response payloads for LLM-friendly tool usage
- binary screenshot streaming over gRPC between gateway and workers
Use this project if you want a mobile MCP server that is fast, deterministic, and easy to plug into any stdio-compatible MCP client.
Monorepo Layout
gateway-mcp/: MCP server (Node.js + TypeScript) with validation, per-device queueing, gRPC routing, retries, and response shaping.worker-android/: Android worker (Go) with cached discovery, persistent uiautomator2 clients, snapshot store, and serial per-device executors.worker-ios/: iOS worker (Go) with simulator discovery, persistent WebDriverAgent clients, snapshot store, and serial per-device executors.proto/: shared protobuf contract and generated code output location.shared/: shared config and shared Go packages (snapshot model).
Prerequisites
- Go (1.22+)
protoc(Protocol Buffers compiler)- Node.js (20+) + npm
adbinPATHfor Android runtimexcrun simctl+ WebDriverAgent for iOS runtime- Android
uiautomator2HTTP server reachable on forwarded device port (default7912) - iOS WebDriverAgent reachable on configured host/port (default
http://127.0.0.1:8100+)
Quick Start
- Install gateway dependencies:
cd gateway-mcp && npm install
- Generate protobuf stubs:
- Linux/macOS:
./scripts/gen-proto.sh - Windows:
powershell -ExecutionPolicy Bypass -File .\scripts\gen-proto.ps1
- Linux/macOS:
- Build gateway:
cd gateway-mcp && npm run build
One-Command MCP Server (for CLI clients)
Use this as your MCP server command in any stdio-compatible client:
- Windows PowerShell:
powershell -ExecutionPolicy Bypass -File <repo>\scripts\mcp-stdio.ps1 - Windows cmd:
<repo>\scripts\mcp-stdio.cmd - Linux/macOS:
<repo>/scripts/mcp-stdio.sh - Fallback:
node <repo>/gateway-mcp/scripts/mcp-stdio.mjs
Important: replace <repo> with your real local path. Do not paste C:\path\to\... literally.
Detailed client config mapping: docs/CLI_SETUP.md
Includes explicit setup for Codex CLI, Claude Code, Claude Desktop, and Cursor.
What this launcher does:
- starts local Android worker by default
- starts local iOS worker only on macOS by default
- starts gateway on stdio so MCP clients can connect directly
Launcher env switches:
FMMCP_START_ANDROID=0to disable local Android workerFMMCP_START_IOS=1to force starting local iOS workerFMMCP_BOOTSTRAP=1to allow startup-timenpm install/build(disabled by default for faster, stable MCP handshakes)
Install in Popular MCP Clients
Use this repo's launcher command in your client config:
powershell -ExecutionPolicy Bypass -File C:\path\to\fast-mobile-mcp\scripts\mcp-stdio.ps1
Codex CLI
codex mcp add fast-mobile-mcp -- powershell -ExecutionPolicy Bypass -File C:\path\to\fast-mobile-mcp\scripts\mcp-stdio.ps1
codex mcp list
~/.codex/config.toml alternative:
[mcp_servers.fast-mobile-mcp]
command = "powershell"
args = ["-ExecutionPolicy", "Bypass", "-File", "C:\\path\\to\\fast-mobile-mcp\\scripts\\mcp-stdio.ps1"]
[mcp_servers.fast-mobile-mcp.env]
FMMCP_START_ANDROID = "1"
FMMCP_START_IOS = "0"
Claude Code
claude mcp add-json fast-mobile-mcp "{\"type\":\"stdio\",\"command\":\"powershell\",\"args\":[\"-ExecutionPolicy\",\"Bypass\",\"-File\",\"C:\\\\path\\\\to\\\\fast-mobile-mcp\\\\scripts\\\\mcp-stdio.ps1\"],\"env\":{\"FMMCP_START_ANDROID\":\"1\",\"FMMCP_START_IOS\":\"0\"}}"
claude mcp list
Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"fast-mobile-mcp": {
"type": "stdio",
"command": "powershell",
"args": [
"-ExecutionPolicy",
"Bypass",
"-File",
"C:\\path\\to\\fast-mobile-mcp\\scripts\\mcp-stdio.ps1"
],
"env": {
"FMMCP_START_ANDROID": "1",
"FMMCP_START_IOS": "0"
}
}
}
}
Startup Error Fix (Codex)
If Codex shows:
MCP startup failed: ... initialize response
it is usually a bad script path in the MCP config. Verify and fix with:
codex mcp get fast-mobile-mcp
codex mcp remove fast-mobile-mcp
codex mcp add fast-mobile-mcp -- powershell -ExecutionPolicy Bypass -File C:\Users\nagar\fast-mobile-mcp\scripts\mcp-stdio.ps1
codex mcp list
Cursor
Add to .cursor/mcp.json or ~/.cursor/mcp.json:
{
"mcpServers": {
"fast-mobile-mcp": {
"type": "stdio",
"command": "powershell",
"args": [
"-ExecutionPolicy",
"Bypass",
"-File",
"C:\\path\\to\\fast-mobile-mcp\\scripts\\mcp-stdio.ps1"
],
"env": {
"FMMCP_START_ANDROID": "1",
"FMMCP_START_IOS": "0"
}
}
}
}
MCP Tool Surface
The gateway exposes these tools:
list_devicesget_active_appget_ui_treefind_elementstaptypeswipescreenshot_stream
Runtime Smoke E2E
Run a runtime smoke check through MCP (workers + gateway):
cd gateway-mcp && npm run e2e:smoke
What it validates:
- tool registration (
tools/list) list_devicesreturns at least one ready deviceget_ui_treereturns a snapshotfind_elementsworks against that snapshotscreenshot_streamreturns frame metadata- invalid device request fails as expected
Note: action-level checks (get_ui_tree, tap/type/swipe, screenshots) require platform automation servers to be alive:
- Android:
uiautomator2endpoint responds to/version - iOS: WDA endpoint responds to
/status
Optional E2E env switches:
FMMCP_E2E_DEVICE_ID=<device-id>to target a specific deviceFMMCP_E2E_PLATFORM=PLATFORM_ANDROID|PLATFORM_IOSto target platformFMMCP_E2E_ENABLE_ACTIONS=1to include a small swipe action check
Quick Verification for Reviewers
For anyone checking the repo directly, this is the fastest verification path:
cd gateway-mcp && npm install && npm run build- from repo root:
powershell -ExecutionPolicy Bypass -File .\scripts\gen-proto.ps1(Windows) or./scripts/gen-proto.sh(Linux/macOS) cd worker-android && go build ./cmd/workercd worker-ios && go build ./cmd/workercd gateway-mcp && npm run e2e:smoke(requires runtime dependencies and at least one ready device)
Build Targets
make protomake build-gatewaymake build-workersmake mcp-stdiomake e2e-smoke
Runtime Design Guarantees
- parallel automation across devices
- strict serial execution per device
- snapshot-based
ref_idaddressing - small, shaped payloads to MCP clients
- gRPC binary screenshot chunk streaming
Environment
- Gateway env:
gateway-mcp/.env.example - Android env:
worker-android/.env.example - iOS env:
worker-ios/.env.example - Unified sample config:
shared/config/sample.yaml
Похожие серверы
Two Minute Reports MCP
Analyse SEO, PPC, E-Commerce from 30+ marketing sources
Image
Fetch and process images from URLs, local file paths, and numpy arrays, returning them as base64-encoded strings.
UN World Population Demographics
Global population data from 1950-2023. Fertility rates, life expectancy, mortality, and migration for 298 countries via MCP.
Alpaca Trading
Manage stock and crypto portfolios, place trades, and access market data via the Alpaca Trading API.
httpay x402 MCP Server
MCP server exposing 90+ crypto API tools with automatic x402 USDC micropayment handling — gas oracle, token lookup, wallet risk analysis, market mood, and more on Base.
kabu-mcp
Japanese & Global stock market data for AI assistants. Real-time quotes, technical analysis (RSI/MACD/BB), market screening. The only MCP with Japanese stock support.
BloodHound MCP
Enables Large Language Models to interact with BloodHound Community Edition data.
N.I.N.A. Advanced API
Control the N.I.N.A. (Nighttime Imaging 'N' Astronomy) software through its Advanced API.
Food Recipe MCP
Semantic search across 50,000+ Food.com recipes, filter by diet, cooking time and difficulty.
OpenHue MCP Server
Control Philips Hue lights using LLM interfaces via the OpenHue CLI.