scrcpy-agent
Allows observing and controlling an authorized Android device over USB via ADB, including screenshots, UI hierarchy inspection, semantic interaction, app inspection, logcat capture, and optional scrcpy mirroring.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@scrcpy-agentwhat's on the device screen right now?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Android Device MCP (scrcpy-agent)
Android Device MCP is a local, security-conscious MCP server for observing and controlling an explicitly authorized Android development phone over USB. It exposes ADB-backed screenshots, UIAutomator state, semantic interaction, package diagnostics, bounded logcat, evidence recording, and an optional server-owned scrcpy mirror.
The server does not call a language model and does not bypass Android locks, authentication, Play Integrity, DRM, root detection, permission prompts, or enterprise policy.
Status
Implemented and locally verified:
TypeScript build and strict type-checking
23 automated unit and MCP stdio protocol tests
ADB/scrcpy adapters with injectable command runners
Device discovery, explicit selection, screenshots, UIAutomator parsing, semantic selectors, input, app inspection, logcat, scrcpy ownership, and evidence sessions
Path-restricted APK installation and approval-gated mutations
Physical-device validation is opt-in and remains a separate gate. At the latest validation point no USB device was connected. Do not interpret the passing mocked tests as proof of phone behavior.
Related MCP server: @wilsonbeam/openclaw-adb-mcp
Requirements
Linux desktop is the supported initial platform; Manjaro/Arch is the primary tested distribution.
Node.js 22 or newer.
Android platform-tools (
adb).scrcpyis optional for headless tools and required only for mirroring.A phone with Developer Options and USB debugging enabled, with this host’s RSA key accepted.
The server does not install ADB or scrcpy. Verify the host tools without changing system state:
adb version
scrcpy --version
adb devices -lInstall from a checkout
git clone https://github.com/EF-Code/scrcpy-mcp.git
cd scrcpy-mcp
npm ci
npm run buildThe executable is then:
/absolute/path/to/scrcpy-mcp/dist/index.jsRun it directly over stdio:
node /absolute/path/to/scrcpy-mcp/dist/index.jsThe process reads MCP messages from stdin and writes MCP messages to stdout. Diagnostics go to stderr.
Codex registration
Resolve the checkout path first, then register the local stdio server:
PROJECT_DIR="$(pwd)"
codex mcp add android-device -- node "$PROJECT_DIR/dist/index.js"
codex mcp listThe current official OpenAI MCP guidance documents local stdio servers and the same codex mcp add <name> -- <command> shape. Restart Codex after registration so the server and its tools are loaded. A project-scoped .codex/config.toml can also be used for trusted projects.
Configuration
Configuration is optional. Without a file, conservative defaults are used. Select a JSON file with ANDROID_DEVICE_MCP_CONFIG:
ANDROID_DEVICE_MCP_CONFIG=/absolute/path/to/android-device-mcp.json \
node /absolute/path/to/scrcpy-mcp/dist/index.jsExample:
{
"adbPath": "adb",
"scrcpyPath": "scrcpy",
"autoSelectSingleDevice": true,
"allowedPackages": ["com.example.test"],
"sensitivePackages": ["com.android.settings", "*.bank.*", "*.wallet.*"],
"allowedApkRoots": ["/home/user/projects"],
"evidenceRoot": "/home/user/android-device-mcp-evidence",
"maxScreenshotBytes": 25000000,
"maxApkBytes": 500000000,
"maxLogBytes": 2000000,
"maxCommandOutputBytes": 4000000,
"maxEvidenceBytes": 100000000,
"maxEvidenceFiles": 500,
"defaultTimeoutMs": 15000,
"uiSnapshotMaxAgeMs": 3000,
"approvalMode": "prompt",
"mirror": {
"maxSize": 1600,
"maxFps": 30,
"audio": false
}
}Environment overrides use the ANDROID_DEVICE_MCP_ prefix. Lists are comma-separated. Configuration never contains a phone PIN, password, account credential, API key, cookie, or authorization token.
Preferred operating loop
Call
device_list.Call
device_selectwhen selection is not unambiguous.Call
device_infoand confirm the target.Use
ui_dump/ui_findbefore coordinate tools.For each action, observe, act, wait briefly, observe again, and report uncertainty.
Keep every package inside the configured allowlist.
Ask for approval before APK installation, permission changes, clear-data, or other mutating operations.
Use
mirror_startonly when the user wants a visible scrcpy window; continue to act through ADB tools.Use
evidence_begin, explicitly capture the desired artifacts, thenevidence_finish.
No generic shell tool is exposed.
Tests
npm run typecheck
npm test
npm run buildThe automated suite uses fake/injectable command boundaries and a child-process MCP client. It does not require a phone and does not install packages or alter device state.
Opt-in physical tests are separate:
ANDROID_DEVICE_MCP_PHYSICAL=1 npm run test:physicalThey require a designated harmless test package and a connected authorized phone. Destructive tests are not run automatically.
Tool groups
Read-only tools include device_list, device_info, mirror_status, screen_capture, ui_dump, ui_find, app_list, app_info, permissions_list, logcat_capture, and logcat_crashes.
Interactive tools include device_select, mirror_start, mirror_stop, ui_tap, screen_tap, screen_swipe, screen_long_press, key_press, text_type, app_launch, app_stop, and wait_for_ui.
Approval-required tools include app_install, app_clear_data, and permissions_set. Evidence tools are local artifact operations with bounded storage and redaction.
Limitations
USB ADB and display 0 are the initial supported targets.
UIAutomator may omit WebViews, games, video, Compose accessibility gaps, and custom canvases; warnings are surfaced.
Node IDs are snapshot-local and expire after the configured freshness window or a foreground change.
Default text entry is printable ASCII only and rejects password fields.
scrcpy audio/control flags are mapped only when supported by the detected version.
No wireless pairing, multiple-device parallel control, OCR, continuous video MCP frames, root features, iOS, or remote listener is provided.
See SECURITY.md and the documents under docs/ for operational details.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityAmaintenanceMCP server that gives AI agents full vision and control over Android devices via ADB and scrcpy. Supports screenshots, input, apps, UI automation, shell, files, and clipboard.3825970MIT
- FlicenseBqualityDmaintenanceMCP server for Android device automation via ADB, enabling screen control, phone functions, app management, and device control.301
- Alicense-qualityDmaintenanceEnables MCP-compatible agents to control an Android device over the network via ADB, providing tools for shell commands, screen capture, UI inspection, file operations, and input simulation.17MIT
- Flicense-qualityDmaintenanceA powerful MCP server that provides comprehensive Android device automation capabilities through ADB, enabling AI agents to interact with Android devices for testing, automation, and device control tasks.1
Related MCP Connectors
Remote MCP for Android CLI agent build gate, structured receipts, audit logs, and reviewer-ready evi
MCP server for Appcircle mobile CI/CD platform.
Personal assistant MCP server with search, execute, packages, jobs, secrets, and integrations.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/EF-Code/scrcpy-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server