adbmcp
One line: adbmcp exposes the Android Debug Bridge (adb) as MCP tools, letting an AI agent inspect, control, and transfer files to/from Android devices and emulators.
Discover and inspect devices — list connected devices/emulators (
list_devices) and read build properties, screen size, and density (get_device_info). Most device-scoped tools accept an optionaldeviceserial for multi-device setups.Run shell commands and system queries — execute arbitrary
adb shellcommands (with guardrails) and query curateddumpsysservices (battery, activity, window, connectivity).Manage apps — list installed packages, install APKs (with replace), uninstall apps, force-stop, launch by package, and start activities/intents.
Manage permissions and data — grant/revoke runtime permissions and clear app data (allowlist-gated).
Read logs — take bounded logcat snapshots or start/read/stop long-lived logcat streams.
Automate the UI — capture screenshots, dump the UI hierarchy, and inject input via tap, swipe, text typing, and key events.
Transfer files — pull files from the device (no overwrite by default) and push files into allowed remote roots.
Port forwarding — create/remove/list host-to-device forwards and device-to-host reverses.
Wireless debugging — connect/disconnect TCP/IP devices and pair Android 11+ devices for wireless debugging.
Recover the adb server — restart the shared adb server after version conflicts or stuck devices.
Provides tools for interacting with Android devices through the Android Debug Bridge (adb), including listing devices, running shell commands, installing and uninstalling apps, reading logcat, taking screenshots, driving the UI with taps/swipes/typing/key events, querying system services with dumpsys, transferring files, forwarding ports, managing app permissions, and pairing/connecting over Wi-Fi.
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., "@adbmcp screenshot the screen of emulator-5554"
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.
adbmcp — Android Debug Bridge, as MCP tools
adbmcp is a Model Context Protocol server that exposes the
Android Debug Bridge (adb) to AI agents: list devices, run shell commands, install apps, read
logcat, take screenshots, drive the UI (tap/swipe/type/key events), query system services with
dumpsys, transfer files, forward ports, manage app permissions and pair/connect to devices over
Wi-Fi. It is a thin, predictable wrapper around the official
adb binary — no re-implemented adb protocol, no test framework, no extra state.
Multi-device first — every device-scoped tool takes an optional
deviceserial and every adb call is scoped withadb -s <serial>; ambiguity is an error listing the candidates.Failures an agent can act on — adb stderr/exit codes are mapped to typed causes (
NO_DEVICE,MULTIPLE_DEVICES,DEVICE_UNAUTHORIZED,DEVICE_OFFLINE,ADB_SERVER_CONFLICT,TIMEOUT,COMMAND_FAILED) with a hint for the next step.Safety by construction — full MCP annotations on every tool plus server-side guardrails that are enforced even if a host ignores annotations.
stdio by default, Streamable HTTP optional — the client launches
adbmcpas a subprocess;--httpserves the same tools over/mcpfor shared-device-host deployments.
Implements the MVP plus v2.0 items 1–7 in docs/design/product-design-v0.md.
Install
Requires Node.js >= 20 and Android platform-tools (adb) on PATH — or ADB_PATH pointing at the
binary.
# from npm
npx -y @yhuangsh/adbmcp
# from a checkout
git clone https://github.com/yhuangsh/adbmcp.git && cd adbmcp
npm install
npm run build
node dist/index.js # speaks MCP on stdin/stdoutClaude Desktop (claude_desktop_config.json)
{
"mcpServers": {
"adb": {
"command": "npx",
"args": ["-y", "adbmcp"],
"env": {
"ADB_PATH": "/Users/me/Library/Android/sdk/platform-tools/adb"
}
}
}
}Cursor (.cursor/mcp.json)
{
"mcpServers": {
"adb": {
"command": "node",
"args": ["/absolute/path/to/adbmcp/dist/index.js"],
"env": {
"ADBMCP_ALLOWED_DEVICES": "emulator-5554"
}
}
}
}Other stdio clients work the same way: a command plus args, with ADB_PATH / ADBMCP_*
environment variables passed through. In stdio mode, stdout carries MCP protocol traffic only;
diagnostics go to stderr.
Streamable HTTP (shared device host)
Use HTTP when several agents or MCP clients should share one machine's adb server, devices and
allowlist — an emulator farm, a lab phone, or a remote desktop — instead of each client launching its
own subprocess. stdio stays the default: with no flags, adbmcp speaks MCP on stdin/stdout.
node dist/index.js --http # http://127.0.0.1:3331/mcp
ADBMCP_HTTP_TOKEN=secret node dist/index.js --http --host 0.0.0.0 --port 8080Flag / variable | Default | Meaning |
| off | Enable the Streamable HTTP transport. Without it the server is stdio-only. |
|
| Listen port ( |
|
| Bind address ( |
| unset | When set, every |
| derived | Comma-separated exact |
The endpoint is stateful: initialize creates a session, Mcp-Session-Id identifies it, and
DELETE /mcp closes it. All sessions share one device host, one ADBMCP_ALLOWED_DEVICES allowlist
and one logcat stream registry — streams started in one session can be read from another. Sessions
are the same trust domain, not isolation between agents.
Client config (Claude Desktop, Cursor, or any Streamable HTTP client):
{
"mcpServers": {
"adb": {
"type": "http",
"url": "http://localhost:3331/mcp"
}
}
}When ADBMCP_HTTP_TOKEN is set, add "headers": { "Authorization": "Bearer <token>" } to the
server entry (client support for header config varies).
Security notes:
Loopback by default. Binding a non-loopback host without
ADBMCP_HTTP_TOKENis refused at startup; the error explains the two ways forward (set a token, or bind127.0.0.1).Token auth is pre-MCP. With a token configured, missing/incorrect credentials get
401before any MCP session handling; comparison is constant-time (node:cryptotimingSafeEqual).DNS-rebinding protection. The SDK transport rejects requests whose
Hostheader is not the bound host or a loopback alias (localhost,127.0.0.1,::1) on the actual port. Override withADBMCP_HTTP_ALLOWED_HOSTSwhen a reverse proxy forwards a different hostname.One device host, many agents.
shellis available to every session; on a shared host preferADBMCP_ALLOWED_DEVICESandADBMCP_SHELL_ALLOWED_PREFIXES, and put the server behind the token.No in-process TLS. The server speaks plain HTTP; terminate TLS in a reverse proxy for non-loopback deployments and set
ADBMCP_HTTP_ALLOWED_HOSTSto the forwardedHostvalue.Only
/mcpis served; POST bodies are capped at 1 MiB (413above that), unsupported methods get405, and unknown paths get404.
Deploying over a VPN mesh (Tailscale example)
A common topology: your agent runs on a public server, and one or more device hosts (machines with USB-attached phones) are joined to a private mesh such as a Tailscale tailnet. Nothing needs to be exposed to the public internet — the agent reaches device hosts through the mesh.
Shape A — bind the mesh interface directly. On each device host, set the token, bind to the
mesh IP (or 0.0.0.0), and allow the hostname the agent will dial:
ADBMCP_HTTP_TOKEN=<token> ADBMCP_HTTP_ALLOWED_HOSTS='phonehost.tailnet-name.ts.net:3331,127.0.0.1:3331,localhost:3331' \
adbmcp --http --host 0.0.0.0 --port 3331WireGuard encrypts mesh traffic; the bearer token stays as the application-level gate so a
misconfigured ACL or a compromised mesh member still cannot touch your devices. ALLOWED_HOSTS must
contain the exact Host header the agent sends — MagicDNS name and port. Note the override
replaces the derived loopback defaults, so loopback entries are re-added for local health checks.
Shape B — loopback + tailscale serve (nice for always-on hosts). Keep adbmcp bound to
127.0.0.1 (optionally with a token still set), then let Tailscale expose it:
adbmcp --http --host 127.0.0.1 --port 3331 &
tailscale serve --bg --https=443 http://127.0.0.1:3331 # --https=443 is the default modeKeep the token set even in this shape — tailscale serve terminates TLS and limits reachability to
the tailnet, but adbmcp should still authenticate its clients. Point the agent at
https://phonehost.tailnet-name.ts.net/mcp (tailscale serve passes the original Host header
through, so the portless ADBMCP_HTTP_ALLOWED_HOSTS entry is correct here).
Caveats that apply to both shapes: one adbmcp node per device host (the agent configures one MCP server entry per host — there is no cross-host device registry); sessions live until the client deletes them or the process restarts, so a device host that suspends or redeploys drops its logcat streams and agents must re-initialize; and provision the token to the agent out-of-band (secret manager, not chat).
Related MCP server: scrcpy-mcp
Tools
device is optional on every device-scoped tool and required when more than one device is connected.
Annotation columns: RO = readOnlyHint, D = destructiveHint, I = idempotentHint,
O = openWorldHint.
Tool | What it does | RO | D | I | O |
|
| ✅ | — | ✅ | — |
| Curated build properties (model, Android version, SDK, ABI) + screen size/density | ✅ | — | ✅ | — |
| Curated | ✅ | — | ✅ | — |
| Arbitrary | — | — | — | ✅ |
|
| ✅ | — | ✅ | — |
|
| — | — | — | — |
|
| — | ✅ | ✅ | — |
|
| — | ✅ | ✅ | — |
|
| — | ✅ | ✅ | — |
|
| — | ✅ | ✅ | — |
| Bounded | ✅ | — | ✅ | — |
| Start a long-lived | ✅ | — | — | — |
| Drain buffered output since the last read | ✅ | — | — | — |
| Stop the stream, return unread output | ✅ | — | ✅ | — |
|
| ✅ | — | ✅ | — |
|
| — | — | — | — |
|
| — | — | — | ✅ |
|
| — | — | ✅ | — |
|
| — | — | ✅ | — |
|
| — | — | ✅ | — |
|
| — | — | ✅ | — |
|
| ✅ | — | ✅ | — |
|
| ✅ | — | ✅ | — |
|
| ✅ | — | ✅ | ✅ |
|
| — | — | ✅ | ✅ |
|
| — | — | ✅ | ✅ |
|
| — | — | ✅ | ✅ |
|
| — | — | ✅ | ✅ |
|
| — | — | — | — |
| Resolve a package's LAUNCHER activity, then | — | — | — | — |
|
| — | — | ✅ | — |
|
| ✅ | — | ✅ | — |
|
| — | — | — | — |
|
| — | — | — | — |
|
| — | — | — | — |
|
| — | — | — | — |
|
| — | — | — | — |
Also shipped:
Resource
adb://devices— live device list as JSON (serial,state,model,allowed). State is never cached; re-read the resource to refresh.Prompts —
debug_crash,install_and_launch,capture_bug_report: step-by-step orchestrations of the tools above.
uninstall_package, grant_permission, revoke_permission and clear_app_data are the tools with
destructiveHint: true; shell, push_file, discover_wireless, connect, disconnect,
wireless_pair and reconnect_wireless are the openWorldHint: true tools. They are never merged
with read-only tools, so hosts can auto-approve reads and confirm writes.
Wireless discovery
Wireless-debugging targets do not have to be known in advance: discover_wireless runs
adb mdns services and returns the _adb-tls-pairing._tcp / _adb-tls-connect._tcp services the
device advertises as a JSON array of {name, type, address, port} candidates, so an agent can go
discover → pair → connect without asking the user for a host:port:
Pairing candidates (type containing
adb-tls-pairing) feedwireless_pair:host=address,pair_port=port. The six-digit code still has to come from the device's "Pair device with pairing code" dialog, and the pairing advertisement only exists while that dialog is open — calldiscover_wirelessagain after opening it.Connect candidates (type containing
adb-tls-connect) feedconnect:address="address:port". IPv6 addresses are reported as-is, butconnectonly accepts hostname/IPv4.Entries with
port: nullare announced but unresolved — retrydiscover_wirelessshortly; advertisements are periodic.
Typed failures instead of raw adb output: [MDNS_UNAVAILABLE] means the adb build predates mDNS or
its mDNS backend is disabled (upgrade platform-tools, make sure the adb server is running, or fall
back to the host:port shown in the device's Wireless debugging settings); [MDNS_NO_SERVICES] means
discovery worked but nothing was advertised (enable Wireless debugging in Settings > Developer
options, keep both machines on the same LAN, retry a few seconds later). Discovery can be disabled
with ADBMCP_MDNS_ENABLED=false and its service-type filter narrowed with
ADBMCP_MDNS_SERVICE_TYPES (see the table below).
Pairing-code elicitation (MRTR)
On the 2026-07-28 protocol revision, wireless_pair can be called without the
six-digit pairing code: the server answers with an input_required result whose
embedded elicitation/create request asks for the code, the client prompts the user
(or its host does) and retries the original call carrying the code in
inputResponses — the multi-round-trip flow (MRTR, SEP-2322). The elicited code is
validated exactly like a code argument (six digits, optional hyphen) before any
adb pair runs, and a declined or cancelled prompt surfaces as a normal tool error.
Clients on the 2025-era revision — or 2026-07-28 clients that did not declare the
elicitation capability — keep the code-as-argument behavior: omit code there and
wireless_pair fails with an actionable error instead of prompting. Pairing codes
still expire after a couple of minutes either way, so retry with a fresh code from
the device's "Pair device with pairing code" dialog when pairing fails.
Persistent wireless targets
Wireless devices can be declared once in ADBMCP_WIRELESS_TARGETS (label=host:port or host:port,
comma-separated) and re-established whenever the connection drops — a Wi-Fi blip, a device reboot,
an adb or host restart:
On demand:
reconnect_wirelessrunsadb connectfor every declared target and reports per-target{address, label, status, cause, detail}as JSON —connected(including "already connected") orfailedwith the typed adb failurecause(e.g.COMMAND_FAILED,DEVICE_OFFLINE).On first use: when a declared target is missing, any device-scoped call retries it once before failing — resolution runs one bounded reconnect pass (only the requested declared target when an explicit
deviceserial matches one, all of them for implicit resolution) and re-lists. If the device is still gone, theNO_DEVICEerror says the targets were already retried once.
There is deliberately no background reconnect loop: adbmcp stays request-scoped and
spawn-per-call, so reconnection happens inside a request (the tool call or the failing resolution),
never from a timer or daemon. Pairing is not automatic — declare targets only for devices that are
already paired; new devices still need wireless_pair (with discover_wireless to find them).
Non-ASCII text input
Android's input text is ASCII-only: typing non-ASCII text (e.g. CJK) through it crashes on the
device with a NullPointerException instead of typing anything (issue #3). type_text therefore
has two paths:
ASCII text (default and unchanged) is sent as
input textwith%sspace encoding and device-shell quoting — one round trip, no extra device calls.Non-ASCII text is sent as
am broadcast -a ADB_INPUT_B64 --es msg <base64-utf8>to the active input method. This requires a broadcast-capable IME to be the active IME; the reference implementation is ADB Keyboard (com.android.adbkeyboard/.AdbIME). On every non-ASCII call adbmcp queriessettings get secure default_input_method(never cached) and broadcasts only when the active IME matches a configured capable component.
One-time setup, run from your own shell (adbmcp detects the IME but deliberately never installs or switches IMEs on its own):
adb install ADBKeyboard.apk # from the ADBKeyBoard releases
adb shell ime enable com.android.adbkeyboard/.AdbIME
adb shell ime set com.android.adbkeyboard/.AdbIME # must be the ACTIVE input methodFailure modes, both typed and actionable instead of leaking the device-side NPE:
[IME_UNAVAILABLE]— the text is non-ASCII but the active IME is not broadcast-capable (or no IME is selected). The message names the active IME and the hint gives theime enable/ime setcommands above.[TEXT_NOT_ASCII]—ADBMCP_TYPE_TEXT_NON_ASCII=rejectopts out of the broadcast path, so non-ASCII text is refused before any device call.
IMEs other than ADB Keyboard can be declared broadcast-capable with
ADBMCP_IME_BROADCAST_COMPONENTS (see the table below); both the short pkg/.Class form and the
flattened pkg/pkg.Class form match.
Configuration
Variable | Default | Meaning |
|
| Path to the adb binary. Must match the version of any running adb server. |
| unset (all allowed) | Comma-separated serial allowlist. Operations on other serials are refused. |
|
| Comma-separated JavaScript regex sources tested against the whole |
| unset (no prefix restriction) | When set, a |
|
| Remote roots |
| unset (refuse every clear) | Comma-separated package allowlist for |
|
| How |
|
| Comma-separated IME component ids accepted as broadcast-capable for the |
|
| Whether |
|
| Comma-separated service types |
| unset | Comma-separated wireless devices adbmcp re-establishes on demand ( |
|
| Default subprocess timeout ( |
|
| Head+tail byte cap per call; the dropped middle is reported inline. |
|
| Ring-buffer cap per logcat stream; overflow is reported as |
|
| HTTP mode listen port (equivalent to |
|
| HTTP mode bind address (equivalent to |
| unset | Bearer token required on every |
| derived | Comma-separated exact |
Safety notes
Annotations are advisory, guardrails are authoritative. The host decides what to auto-approve;
adbmcpenforces its own limits regardless: blockedshellpatterns, the device allowlist, remote push roots, and the pull overwrite check.shellis arbitrary code execution on the device. It is annotated as not read-only and open-world, blocklisted by default, and documented as the escape hatch — keepshelldisabled or prefix-restricted (ADBMCP_SHELL_ALLOWED_PREFIXES) on shared or CI machines. The default blocklist covers reboot/power-state changes,su,mkfs,wipe,rmof/(including split/reordered flags and the/*glob), and pipelines intosh/bashsuch ascurl … | shor… | sudo bash. This is a guardrail, not a sandbox: a deliberately obfuscated command can still get through. A pattern-based guardrail: matching runs on the raw command text, including inside quotes, so even prose likeecho "use curl | sh to install"is refused — precision always yields to safety here. maintainer can replace the patterns withADBMCP_SHELL_BLOCKED_PATTERNS.uninstall_packagedeletes app data unlesskeep_data: true.clear_app_datadeletes app data permanently and is refused unless the package is listed inADBMCP_CLEAR_ALLOWED_PACKAGES(unset/empty refuses every clear).grant_permission/revoke_permissionchange an app's granted permissions. All four are markeddestructiveHint: true.Device scoping is explicit. With multiple devices connected, calls without
devicefail withMULTIPLE_DEVICESand the candidate serials instead of guessing.Filesystem writes are bounded.
pull_filenever overwrites silently;push_filerefuses writes outside the allowed remote roots and rejects..traversal and relative paths. Root containment is lexical: it does not resolve on-device symlinks, so a link pre-created inside an allowed root (e.g./data/local/tmp/x -> /data/system) can still redirect a push outside it.No privilege escalation.
adbmcpnever runsadb root/suitself and never retries a permission failure with elevation.The adb server is shared host state.
adbmcpnever kills or restarts it implicitly;adb_server_restartexists for the version-conflict case and says so in its description.Logcat streams are cleaned up. Streams are killed on
stop_logcat_stream, and all remaining streams are terminated on SIGINT/SIGTERM (server shutdown).
Development
npm install
npm run build # tsc -> dist/
npm test # vitest, no adb binary or device required
npm run typecheckTests drive a fake adb runner and a fake stream spawner, so the whole suite runs without platform-tools, a device or an emulator. Layout:
src/
index.ts entrypoint: stdio by default, --http for Streamable HTTP
http.ts HTTP sessions, bearer auth, loopback guard, DNS-rebinding allowlist
server.ts assembles config + runner + tools/resources/prompts
config.ts env config, shell/device/push/clear guardrails
devices.ts device parsing, resolution rule, list_devices tool
adb/runner.ts subprocess per call: -s scoping, timeouts, head+tail caps
adb/errors.ts typed causes mapped from adb stderr/exit codes
streams/registry.ts long-running logcat handles + ring buffer
tools/ one module per tool group (37 tools, MVP + v2.0 items 1–6 + v0.6.0 additions)
resources/devices.ts, prompts/index.ts
test/ vitest suites (fakes in test/helpers/)Status
Implements the MVP plus v2.0 items 1–7 from the design (§4.2): reverse port forwards and structured
forward/reverse listings, pm grant/revoke plus allowlist-gated clear_app_data, wireless
TCP/IP connect/disconnect/wireless_pair, first-class input injection (tap, swipe,
type_text, key_event — typed schemas that fix the input text quoting footgun, no DSL), the
curated dumpsys_query, and the pulled-forward Streamable HTTP transport. v0.4.0 was a
hardening/polish release (no new tools): shell guardrails now also block pipe-to-shell payloads and
split/globbed root-deleting rm, address-targeted disconnect failures are reported as typed
errors, and reverse_port rejects forward-only device-side specs pre-spawn. v0.5.0 adds Streamable
HTTP (/mcp, stateful sessions, one shared device/stream context, optional bearer auth, loopback
binding guard, DNS-rebinding protection). v0.6.0 adds launch_package (resolve a package's launcher
activity and start it, returning the component) and get_ui_hierarchy to_file (keep large dumps
on-device as {path, bytes} for pull_file instead of returning structurally truncated inline XML).
v0.6.1 teaches type_text non-ASCII (CJK) input: text rides the ADB_INPUT_B64 broadcast to a
capable IME (ADB Keyboard by default) when one is the active input method, with typed
IME_UNAVAILABLE/TEXT_NOT_ASCII errors otherwise (ADBMCP_TYPE_TEXT_NON_ASCII chooses the
posture). v0.7.0 moves onto the MCP TypeScript SDK v2 packages and serves both protocol revisions:
legacy clients keep stateful Streamable HTTP sessions while 2026-07-28 clients get stateless
serving (server/discover, resultType, per-request _meta), same guardrails on both paths.
v0.8.0 rounds out wireless debugging: discover_wireless finds pairing/connect candidates via
mDNS (adb mdns services), wireless_pair accepts MRTR elicitation on 2026-07-28 clients
(omit code and answer the server's input_required prompt), and ADBMCP_WIRELESS_TARGETS
with reconnect_wireless re-establishes declared wireless devices after drops or restarts.
Not implemented: screenrecord, bugreport, iOS, emulator lifecycle management. Windows is
best-effort (POSIX-first, like most of the ecosystem).
Contributing
Bug reports and use-case-driven feature requests are welcome — see CONTRIBUTING.md for what makes a good issue, how triage works, and the development setup.
Available Tools
35 toolsadb_server_restartRestart the adb serverA
Recover from adb server version conflicts by running adb kill-server followed by adb start-server, then report the device list. Affects the shared adb server on this host (Android Studio and other tools use it too), so call it only when adb reports a server/version problem or a device is stuck.
Inputs: no named parameters.
clear_app_dataClear app dataADestructiveIdempotent
Delete all data stored by an app (pm clear <package>). Destructive and allowlist-gated: the server refuses unless the package is listed in ADBMCP_CLEAR_ALLOWED_PACKAGES (comma-separated); an unset or empty value refuses every clear.
Inputs: package (required), device.
connectConnect to a device over TCP/IPAIdempotent
Connect adb to a device over TCP/IP (adb connect <host>:<port>), e.g. "192.168.1.42:5555"; a successful connect adds the device to list_devices. Not device-scoped: the address selects the device, and no serial exists until the connection is established. IPv6 literals (e.g. "[::1]:5555") and a bare host without :port are not accepted; specify host:port explicitly. On Android 10+ enable Wireless debugging on the device first; on Android 11+ that also needs a one-time pairing first — call wireless_pair with the code from the Wireless debugging screen, then connect to the port shown there (the pairing port and this connect port are different).
Inputs: address (required).
disconnectDisconnect TCP/IP devicesAIdempotent
Disconnect one TCP/IP-connected device (adb disconnect <host>:<port>) or, when address is omitted, every TCP/IP-connected device (adb disconnect). USB connections are unaffected. Not device-scoped: for a TCP/IP device the address itself is the serial.
Inputs: address.
dumpsys_queryQuery a dumpsys serviceARead-onlyIdempotent
Read a curated Android system service dump (dumpsys <service> [args...]): "battery" for charge/level, "activity" for tasks and activities, "window" for windows and display state, "connectivity" for network state. Output can be huge — "activity" especially — so it is capped (64 KB maximum) with a head+tail truncation marker where bytes were dropped; pass extra_args to narrow it (e.g. "activities" or "windows"). Other dumpsys services are intentionally not exposed; use shell for those.
Inputs: service (required), device, extra_args, timeout_ms.
force_stop_appForce-stop an appAIdempotent
Stop all processes of a package on one device (am force-stop). Idempotent; safe to call when the app is not running.
Inputs: package (required), device.
forward_portForward a host port to the deviceAIdempotent
Create a port forward from the host to the device (adb forward), e.g. local "tcp:8080" to remote "tcp:8080". Use it to reach a device-side server (app HTTP server, debug port) from host-only test tooling.
Inputs: local (required), remote (required), device, no_rebind.
get_device_infoGet device informationARead-onlyIdempotent
Read a curated set of build properties (model, Android version, SDK level, ABI) plus screen size and density for one device. Use it instead of shell getprop when you only need identity/build details.
Inputs: device.
get_ui_hierarchyGet the UI hierarchyARead-onlyIdempotent
Dump the current view hierarchy of one device as uiautomator XML (uiautomator dump), including bounds, resource ids, text and clickability. Use it to find stable selectors before driving the UI through shell (input tap/text). With to_file: true the XML is kept on the device at /data/local/tmp/adbmcp-ui-.xml and returned as {path, bytes} instead of inline text, so large dumps stay structurally valid; retrieve it with pull_file. Dumps accumulate at that prefix by design — remove them with the shell tool (rm ) after pulling.
Inputs: device, to_file, timeout_ms.
grant_permissionGrant a runtime permissionADestructiveIdempotent
Grant a runtime permission to an app (pm grant <package> <permission>). Destructive: it changes the permissions the app holds; revoke_permission reverses it. Only changeable runtime permissions work; on stock Android these can be granted to non-debuggable apps too, though some restricted permissions still reject the shell.
Inputs: package (required), permission (required), device.
install_apkInstall an APKA
Install a local APK on one device via adb install. Fails with INSTALL_FAILED_* details from the device when the package cannot be installed.
Inputs: apk_path (required), device, replace, timeout_ms.
key_eventSend a key eventA
Send one key event to the device (input keyevent <code>). Pass a named key (HOME, BACK, ENTER, DEL, MENU, POWER, VOLUME_UP, VOLUME_DOWN, TAB, ESCAPE, APP_SWITCH, WAKEUP, SLEEP) or a raw Android keycode 0-300. Use WAKEUP (or POWER) before driving a screen that may be off, and BACK/HOME to navigate.
Inputs: key (required), device.
launch_packageLaunch an app by package idA
Launch an installed app by package id: resolve its LAUNCHER activity (cmd package resolve-activity --brief) and start it (am start -n, with -W when wait is true). Returns the resolved component so later calls can use start_activity without re-resolving. The monkey -p <package> 1 one-liner exists, but this keeps everyday launches off the shell escape hatch.
Inputs: package (required), wait, device, timeout_ms.
list_devicesList connected Android devicesARead-onlyIdempotent
List Android devices and emulators known to adb with their serial, connection state and model. Call this first to discover serials for the "device" parameter of other tools.
Inputs: no named parameters.
list_forwardsList port forwardsARead-onlyIdempotent
List the forward socket connections of one device (adb forward --list) as a JSON array of {serial, local, remote} objects (empty array when there are none).
Inputs: device.
list_packagesList installed packagesARead-onlyIdempotent
List package names installed on one device (optionally filtered by a substring of the package name), e.g. filter "com.example" to find only the app you care about.
Inputs: device, filter.
list_reversesList reverse port forwardsARead-onlyIdempotent
List the reverse socket connections of one device (adb reverse --list) as a JSON array of {serial, remote, local} objects (empty array when there are none). remote is the device-side listen spec, local the host-side target.
Inputs: device.
logcat_snapshotRead a logcat snapshotARead-onlyIdempotent
Dump the current logcat buffer (adb logcat -d) from one device, optionally filtered to a log tag. Bounded output; use the stream tools when you need to watch logs over time.
Inputs: device, max_lines, timeout_ms, filter_spec.
pull_filePull a file from the deviceA
Copy a file from the device to the host machine (adb pull). Refuses to overwrite an existing host file unless overwrite is true. This writes to the host filesystem, so it is not a read-only tool.
Inputs: local_path (required), remote_path (required), device, overwrite.
push_filePush a file to the deviceA
Copy a file from the host machine to the device (adb push). For safety the remote path must be inside the configured allowed roots (default /sdcard, /storage/emulated/0, /data/local/tmp).
Inputs: local_path (required), remote_path (required), device.
read_logcat_streamRead a logcat streamARead-only
Return buffered logcat output accumulated since the previous read of this stream. Output is capped per call; anything not returned stays buffered for the next read. Dropped bytes are reported when the ring buffer overflowed.
Inputs: stream_id (required), max_bytes.
remove_forwardRemove a port forwardAIdempotent
Remove a port forward created with forward_port (adb forward --remove <local>).
Inputs: local (required), device.
remove_reverseRemove a reverse port forwardAIdempotent
Remove a reverse socket connection created with reverse_port (adb reverse --remove <remote>).
Inputs: remote (required), device.
reverse_portReverse a device port to the hostAIdempotent
Create a reverse socket connection (adb reverse): the device listens on the remote spec and connections are forwarded to the local spec on the host machine. Use it to let device-side code (app under test, on-device scripts) reach a server running on your machine.
Inputs: local (required), remote (required), device, no_rebind.
revoke_permissionRevoke a runtime permissionADestructiveIdempotent
Revoke a runtime permission from an app (pm revoke <package> <permission>). Destructive: the app loses the permission immediately and may fail until it is granted again.
Inputs: package (required), permission (required), device.
screenshotCapture a screenshotARead-onlyIdempotent
Capture the current screen of one device (exec-out screencap -p) and return it as a PNG image. Follow up with get_ui_hierarchy when you need element coordinates instead of pixels.
Inputs: device.
shellRun a device shell commandA
Escape hatch: run an arbitrary command through adb shell on one device and return stdout/stderr. Powerful but not read-only — destructive commands are refused by default (reboot, su, mkfs, wipe, rm of / including split/reordered flags and the /* glob, and pipelines into sh/bash such as curl … | sh or … | sudo bash). This is a guardrail, not a sandbox: a deliberately obfuscated command can still get through. Prefer the dedicated tools (list_packages, install_apk, get_ui_hierarchy, …) when they cover the job. A non-zero remote exit code is reported as exit_code: N in the output. If the call times out, only the host-side adb client is killed; the command keeps running on the device (inherent to adb).
Inputs: command (required), device, timeout_ms.
start_activityStart an activityA
Launch an activity on one device (am start) either by component ("com.example/.MainActivity") or by intent action ("android.intent.action.VIEW" with optional data/extras). Use wait: true to block until the activity is reported as displayed.
Inputs: data, wait, action, device, +5 more.
start_logcat_streamStart a logcat streamARead-only
Start a long-lived adb logcat process on one device and return a stream_id. Poll it with read_logcat_stream and release it with stop_logcat_stream. Streams are killed when the server shuts down.
Inputs: device, filter_spec.
stop_logcat_streamStop a logcat streamARead-onlyIdempotent
Terminate a logcat stream and forget its stream_id. Up to max_bytes of output buffered but not yet read is returned in this result; any excess is discarded and reported.
Inputs: stream_id (required), max_bytes.
swipeSwipe the screenA
Swipe from (x1, y1) to (x2, y2) (input swipe X1 Y1 X2 Y2 [duration_ms]), e.g. to scroll a list or dismiss a card. duration_ms is the gesture time in milliseconds (device default 300 when omitted); a longer duration drags more slowly. Coordinates are device pixels; screenshot afterwards to verify the result.
Inputs: x1 (required), x2 (required), y1 (required), y2 (required), +2 more.
tapTap the screenA
Tap a point on the device screen (input tap X Y). Coordinates are device pixels: read them from get_ui_hierarchy bounds or get_device_info screen_size, and screenshot after the tap to verify the result (screenshot → decide → act loop). If the display is off, wake it first with key_event WAKEUP — input events are dropped while the screen is off.
Inputs: x (required), y (required), device.
type_textType textA
Type text into the focused input field (input text <text>). Spaces are encoded as %s (adb's space form) and shell metacharacters are quoted, so the text reaches the device intact; note that a literal "%s" in text still becomes a space on the device. Focus the field first (tap it), and screenshot to confirm what was typed.
Inputs: text (required), device.
uninstall_packageUninstall a packageADestructiveIdempotent
Remove an application from one device via adb uninstall. Destructive: the app is deleted from the device (use keep_data to keep its data directory).
Inputs: package (required), device, keep_data, timeout_ms.
wireless_pairPair a device for wireless debuggingAIdempotent
Pair with an Android 11+ device for wireless debugging (adb pair <host>:<pair_port> <code>), using the pairing code from Settings > Developer options > Wireless debugging > "Pair device with pairing code". This is step one of a two-step flow: after "Successfully paired", call connect with the same host and the port shown on the main Wireless debugging screen — the temporary pairing port above is not that connect port. Pairing codes expire after a couple of minutes, so ask the user for a fresh code if this fails.
Inputs: code (required), host (required), pair_port (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 35 tools
Most tools have clearly distinct purposes, and the forward/reverse and logcat streaming tool groups are well differentiated by their descriptions. Minor ambiguity exists between start_activity and launch_package, and shell intentionally overlaps with many dedicated tools, but the descriptions explicitly guide correct selection.
All names use snake_case, and most follow a verb_noun pattern (list_devices, install_apk, grant_permission, pull_file). A few deviate with noun-first or single-word names (logcat_snapshot, dumpsys_query, screenshot, shell), but the convention remains readable and consistent.
35 tools is heavy for a single server. Each tool maps to a distinct adb operation, which justifies breadth, but some groups could be consolidated (e.g., forward/reverse families, logcat stream lifecycle), making the set borderline overloaded.
The surface covers device connection, app lifecycle, file transfer, logging, UI automation, shell, and dumpsys querying well. Minor gaps exist around device reboot, system settings, and screen recording, but most workflows can be completed with the available tools.
Maintenance
Related MCP Connectors
Cloud Android devices for AI agents: install an APK, read the screen, tap, type, read logcat.
Give your AI agent a real cloud Android phone: push APKs, drive it, get screenshots and logs.
Let Claude, ChatGPT and other agents use your Android phone: see the screen, tap, type, open apps.
Cloud Android phones for AI agents: create a phone, read the screen, tap, type, install APKs, park.
Related MCP Servers
- AlicenseAqualityCmaintenanceEnables AI agents to control, inspect, and automate Android devices, Waydroid containers, and AVD emulators over ADB. Provides tools for screenshots, UI-hierarchy text-based tapping, gestures, key presses, text input, app management, and raw shell commands.12MIT
- AlicenseNot gradedqualityAmaintenanceEnables AI agents to visually perceive and directly control Android devices via ADB and screen-control tooling, including screenshots, taps, swipes, typing, app management, UI inspection, file transfer, shell commands, and audio/video streaming.801 npmMIT
- AlicenseNot gradedqualityAmaintenanceEnables AI agents to see and control Android devices through ADB and screen mirroring, supporting screen capture, touch input, app management, UI element finding, file transfer, shell commands, clipboard access, and audio/video streaming.801 npmMIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to drive a connected Android phone over ADB with 28 tools covering screenshots and UI inspection, taps/swipes/typing, app install and launch, file transfer, wireless pairing, and one-call scripted flows like tap-by-text and wait-for-text.MIT