Local Android MCP
Operates a local Android device (USB or wireless ADB) through a constrained tool surface: list attached devices and authorization state, read allow-listed build properties, capture screenshots as PNG, dump the UIAutomator XML hierarchy, tap and swipe at bounded coordinates, type conservative text, press allow-listed navigation keys, list installed packages, and launch or force-stop apps. Includes a deviceless free form—no arbitrary shell, no install/uninstall/clear-data/reboot/file-transfer/root—plus a localhost-only web panel for choosing the default device and starting AVDs.
Click on "Deploy 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., "@Local Android MCP take a screenshot of my Android device and open the Settings app"
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.
Local Android MCP
A local-only, model-agnostic MCP server and installer that lets GitHub Copilot, Codex, Claude, Cursor, Gemini, Devin/Windsurf, and other MCP clients operate an Android device through ADB.
The server contains no language model and calls no cloud API. The MCP client supplies the reasoning; this package supplies a deliberately constrained Android tool surface.
Requirements
Node.js 20 or newer
Android platform-tools (
adb)An Android device with USB debugging enabled, or an authorized wireless ADB device
Confirm the device before setup:
adb devices -lThe device state must be device, not unauthorized or offline.
Related MCP server: phone-control
Get the source
git clone https://github.com/manuelcabrera1193/droid.git
cd droid
npm ciThe GitHub repository is public. The npm package remains marked private to
prevent accidental registry publication; local installation is supported.
One-command multi-client setup
Install a self-contained global copy, detect the AI clients on this computer, review the plan, and apply it:
npm install
npm run install:global
local-android-mcp detect
local-android-mcp setup
local-android-mcp setup --yes --force
local-android-mcp doctor
local-android-mcp uisetup without --yes is always a read-only plan. The applied setup:
registers one stable
local-android-mcpcommand, never the source folder;configures every detected compatible client;
merges existing JSON/JSONC instead of replacing it;
creates timestamped sibling backups before changes;
uses vendor CLIs for Codex, Claude Code, and Devin;
refuses malformed configuration and conflicting entries unless
--forceis explicit.
--force is required for Codex, Claude Code, and Devin because their official
CLI may replace an existing same-named entry and does not expose portable
installer ownership metadata. Always inspect the plan first.
Limit setup to selected clients when needed:
local-android-mcp setup --client vscode,cursor,codex
local-android-mcp setup --client vscode --yes
local-android-mcp uninstall --client vscode --yesUninstalling a provider-CLI-owned entry (codex, claude-code, or devin)
requires --force because those formats do not expose portable ownership
metadata. Inspect the plan and provider configuration first.
Supported IDs are vscode, copilot, cursor, claude-code,
claude-desktop, codex, gemini, devin, and windsurf-legacy.
Windows configurations use cmd.exe with the absolute npm shim dynamically
resolved during setup, preventing an untrusted workspace from shadowing the
command. macOS and Linux use the stable global command directly. Rerun setup
after moving to another computer or changing the Windows Node installation.
Local device selector
Run:
local-android-mcp uiThe command starts an ephemeral web server bound only to 127.0.0.1, opens the
default browser, and remains active until you press Ctrl+C. From the panel you
can select or clear the default device, inspect authorization state, refresh a
screenshot, and start a configured Android Virtual Device. The page refreshes
its inventory automatically.
The selected card exposes Deseleccionar, which removes the saved preference
and returns to automatic selection. If Actualizar cannot reach the local
service, keep the terminal that runs local-android-mcp ui open. With a fixed
port, restarting local-android-mcp ui --port 3210 lets the same page renew its
local session on the next refresh.
The selection is read dynamically by the MCP server, so changing it does not require editing every AI client. Selection precedence is:
the
deviceargument supplied by an MCP tool;ANDROID_SERIALfrom the MCP client environment;the device saved by the local web panel;
automatic selection when exactly one authorized device exists.
Use local-android-mcp ui --no-open on a headless machine, or --port 3210
when a predictable localhost port is useful. The UI exposes no LAN listener,
uses a per-process request token, and does not call a cloud service.
See docs/CLIENT-COMPATIBILITY.md for exact
destinations and docs/AI-INTEGRATION.md for a guide
written for both developers and coding agents.
For a new computer, follow docs/INSTALL-MAC-WINDOWS.md.
Workspace-only setup (GitHub Copilot)
npm install
npm test
npm run smoke
npm run smoke:deviceThe repository-root .mcp.json is portable. It runs npm in the
workspace instead of containing an absolute path, so the whole folder can be
moved or copied to another computer. On the other computer, install Node.js and
ADB, run npm install, and open the folder in VS Code.
In VS Code:
Open this folder as the workspace.
Open the Command Palette and run MCP: List Servers.
Start or restart
local-androidif it is not already running.In Copilot Agent mode, ask:
List the connected Android devices using local-android.
GitHub Copilot's portable workspace format uses mcpServers; the older
.vscode/mcp.json format uses a different top-level key and is intentionally
not duplicated here.
Global, source-location-independent installation
To use the server from unrelated workspaces, install a packaged copy:
npm install
npm run install:globalThis builds an npm tarball and installs a copy globally. Moving or deleting the
source folder afterward does not break the local-android-mcp command. The
automatic setup command is recommended; examples/global-mcp.json
remains available for manual clients.
Common destinations:
GitHub Copilot CLI:
$COPILOT_HOME/mcp-config.json, or~/.copilot/mcp-config.jsonCodex:
$CODEX_HOME/config.toml, or~/.codex/config.tomlClaude Code:
$CLAUDE_CONFIG_DIR/.claude.json, or~/.claude.jsonA compatible workspace:
.mcp.jsonClaude Desktop: its
mcpServersconfiguration
Do not overwrite an existing global configuration file; merge only the
local-android entry.
Dynamic ADB and device selection
The server resolves ADB in this order:
ANDROID_ADB_PATHADB_PATHANDROID_SDK_ROOT/platform-tools/adbANDROID_HOME/platform-tools/adbadbfound onPATH
No repository, SDK, home-directory, or device path is hard-coded.
When exactly one authorized device exists, it is selected automatically. With
multiple devices, pass device to a tool or set ANDROID_SERIAL before the MCP
client starts.
Examples:
export ANDROID_SERIAL=emulator-5554
export ANDROID_ADB_PATH=/custom/android-sdk/platform-tools/adbThese variables are optional. Keep machine-specific values outside committed MCP configuration.
The UI also resolves the Android Emulator through ANDROID_EMULATOR_PATH,
EMULATOR_PATH, the active Android SDK, and finally PATH.
Exposed tools
Tool | Effect |
| List attached devices and authorization state |
| Read an allow-listed subset of build properties |
| Return the current screen as PNG |
| Return the UIAutomator XML hierarchy |
| Tap a bounded coordinate |
| Swipe between bounded coordinates |
| Type a conservative, shell-safe character set |
| Press an allow-listed navigation key |
| List package identifiers |
| Launch a validated package identifier |
| Stop an app without deleting its data |
Security boundaries
Commands use process argument arrays with local shell execution disabled.
There is no arbitrary
adb shelltool.Package names, coordinates, durations, keys, and text are validated.
Text containing shell metacharacters is rejected before reaching the device.
Commands have timeouts and output-size limits.
There are no install, uninstall, clear-data, reboot, file-transfer, or root tools.
MCP runs over local stdio and opens no listening network port.
ADB itself is a privileged debugging interface. Use a dedicated test device and review tool approvals in the MCP client.
Do not commit device screenshots, UI dumps, private design links, device identifiers, credentials, or signing keys. The repository excludes common local artifacts, and CI scans the Git history with Gitleaks. Test fixtures use synthetic device names and documentation-only network addresses.
Development and verification
npm run check # TypeScript without output
npm test # Build plus unit tests
npm run smoke # Start a real MCP client/server session and list devices
npm run smoke:device # Read device info, screenshot, and UI tree
npm pack --dry-run # Inspect the portable package contents
local-android-mcp detect --json
local-android-mcp setup --dry-runThe unit tests cover portable ADB discovery, device parsing and selection, argument construction, client detection, JSONC-preserving configuration merges, backup/conflict behavior, package validation, and remote-shell text rejection.
Documentation map
AGENTS.md: repository rules and implementation map for coding agents.llms.txt: compact discovery entrypoint for language models.docs/AI-INTEGRATION.md: implementation and project-integration contract.docs/CLIENT-COMPATIBILITY.md: supported clients and configuration ownership.docs/INSTALL-MAC-WINDOWS.md: portable setup on another macOS or Windows computer.docs/local-android.manifest.json: machine-readable capability manifest.
Available Tools
11 toolsandroid_device_infoInspect Android deviceARead-onlyIdempotent
Read a small allow-listed set of Android build and hardware properties.
Inputs: device.
android_force_stop_appStop Android appBDestructiveIdempotent
Force-stop one installed package. This does not clear application data.
Inputs: packageName (required), device.
android_get_ui_treeRead Android UI treeBRead-onlyIdempotent
Return the current UIAutomator XML hierarchy for locating visible controls. Read-only.
Inputs: device.
android_launch_appLaunch Android appB
Launch an installed package through its launcher activity.
Inputs: packageName (required), device.
android_list_devicesList Android devicesARead-onlyIdempotent
List locally attached ADB devices and their authorization state. Read-only.
Inputs: no named parameters.
android_list_packagesList Android packagesCRead-onlyIdempotent
List installed Android package identifiers. Read-only.
Inputs: device, thirdPartyOnly.
android_press_keyPress safe Android keyA
Press one allow-listed Android key; arbitrary key codes are not accepted.
Inputs: key (required), device.
android_screenshotCapture Android screenCRead-onlyIdempotent
Capture the current screen as a PNG. Read-only.
Inputs: device.
android_swipeSwipe Android screenC
Swipe between two coordinates with a bounded duration.
Inputs: x1 (required), x2 (required), y1 (required), y2 (required), +2 more.
android_tapTap Android screenC
Tap one screen coordinate on the selected Android device.
Inputs: x (required), y (required), device.
android_type_textType safe text on AndroidA
Type text through ADB. For safety, only letters, digits, spaces, and @ . _ + - / : , are accepted.
Inputs: text (required), device.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 11 tools
Each tool targets a clearly distinct action-resource pair: device enumeration, device info, screenshot, UI tree, tap, swipe, typing, key press, package listing, app launch, and force-stop. There is no meaningful overlap, and read-only tools are even flagged.
All tools share a consistent android_ prefix and mostly follow verb_noun (list_devices, get_ui_tree, launch_app, force_stop_app). A few are noun-only (android_device_info, android_screenshot), a minor deviation from the dominant pattern.
11 tools is well-scoped for Android device automation, covering inspection plus interactions without padded or redundant entries. Each tool earns its place in a coherent workflow.
The core automation lifecycle—inspect (devices, info, screenshot, UI tree, packages) and act (tap, swipe, type, key, launch, stop)—is covered end to end. Gaps exist around app install/uninstall and clearing app data, but agents can largely work around them within the stated scope.
Related MCP Connectors
Remote MCP server that lets AI assistants operate your own Android phone (Android 11+, no root) with per-app allowlists, on-phone approval, hidden verification codes, and mandatory confirmation for banking and payment apps that Tongs recognizes.
Let Claude, ChatGPT and other agents use your Android phone: see the screen, tap, type, open apps.
Cloud Android devices for AI agents: install an APK, read the screen, tap, type, read logcat.
Melaya is a remote MCP server. It gives an assistant hands on your own Android phone and browser: it reads the screen through the accessibility tree, then taps, types and navigates inside the apps and sites you allow-list, with no per-app API. It also builds, schedules and runs agent pipelines across 6k+ connected tools. OAuth 2.1, nothing to install.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables AI agents and test runners to control Android devices via local ADB, including listing devices, tapping, swiping, typing, sending system keys, launching apps, and dumping UI hierarchy. Communicates over MCP stdio without exposing network listeners.-
- AlicenseNot gradedqualityBmaintenanceEnables controlling an Android device from an MCP client via ADB, including wireless debugging discovery, UI-tree inspection, and performing taps, swipes, typing, app actions, and shell commands without relying on screen coordinates.MIT
- AlicenseNot gradedqualityBmaintenanceEnables bounded, local-first Android device perception and interaction over ADB, including screenshots, UI hierarchy inspection, allowlisted key/app/URI actions, and guarded verified taps. It also exposes passive health, runtime status, capability, permission, and unified device-contract surfaces.Apache 2.0
- AlicenseNot gradedqualityCmaintenanceEnables Android device control over ADB through MCP tools that mirror CLI subcommands, including taps, swipes, text input, app launch/stop, screenshots, UI inspection, and running action sequences. Coordinates from screenshots are converted to screen coordinates automatically.MIT