adb-mcp

by iksnerd

Not rated
GitHub

About

Drives an Android emulator or a real device over adb: screenshots, UI hierarchy with true device-pixel coordinates, tap and type, app lifecycle, logcat, and Gradle builds and tests.

Details

Author
iksnerd
Categories
Developer Tools, Other

Setup

Install adb-mcp in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/iksnerd/adb-mcp

Follow the installation instructions in the repository README, then restart your MCP client.

AnMCPserver that drives Android emulators and devices overadb

Boot an AVD, screenshot, read the UI hierarchy, tap/swipe/type, set a device lock, readlogcat, run Gradle builds and tests.78 tools, from Claude Code, Cursor, VS Code, or any MCP client over stdio.

It is the Android counterpart toXcodeBuildMCP, built on the officialGo MCP SDK.

describe_uitap_on_textscreenshot, driven live against a real emulator (emulator-5556), showing the actual tool calls and their actual output.

Android is a trademark of Google LLC.adb-mcpis an independent, unofficial tool built for Android and is not affiliated with, sponsored, or endorsed by Google. The Android robot above is reproduced/modified from work created and shared by Google and used according to terms described in theCreative Commons 3.0 Attribution License.

Driving Android by hand means a long runbook of rawadbcommands, and it is easy to get wrong (stale tap coordinates, CRLF-corrupted screenshots, forgettingexec-out, guessing coordinates off a downscaled image). This server bakes that knowledge into its tools, so the agent doesn't have to relearn it:

- Screenshots useexec-out screencap(no CRLF corruption) and are auto-downscaled so the image reader accepts them.
- describe_uireturns each element'scenter in true device pixels(so taps land where you mean them to, no guessing off the image) and retries the transient "could not get idle state" failure on its own.

The workflow itself ships as readableresourcesthe agent can pull up mid-task (the observe→act loop, native PIN/lock handling, crash triage, see below) instead of relearning them each session.

- Android SDK withplatform-tools(adb) andemulator. The server finds it via$ANDROID_HOME/$ANDROID_SDK_ROOT, else the platform default (~/Library/Android/sdkon macOS). If your MCP client launches the server without those set, pass--sdk /path/to/sdkin the client config'sargs(the server then exports it, so Gradle finds the SDK too).doctorprints the location it resolved.
- At least one AVD (create one in Android Studio's Device Manager).

Go isnotrequired: releases ship prebuilt binaries, and it's only needed tobuild from source.

curl -fsSL https://raw.githubusercontent.com/iksnerd/adb-mcp/main/install.sh | sh

The script (install.sh) picks the right archive for your OS/architecture, verifies its SHA-256 against the release'schecksums.txt, and installs to~/.local/bin(override withBIN_DIR=...; pin a version withVERSION=v0.17.0).

Prefer to grab the binary yourself? Every platform's archive (macOS, Linux, and Windows, amd64 and arm64) is on theReleases page, each with a checksum inchecksums.txt. On Windows, download thewindows_amd64orwindows_arm64zip and putadb-mcp.exesomewhere on yourPATH.

Once installed, stay current with the built-in updater. It fetches the latest release, verifies its checksum, and swaps the binary in place:

The registration below launches the server by the bare nameadb-mcp, so it must be on your$PATH(which adb-mcpshould resolve; the installer warns if~/.local/binisn't on it). Otherwise point the client at the absolute path to the binary instead.

(When working inside this repo itself, the bundled.mcp.jsonis picked up automatically, no registration needed.)

Cursor / VS Code: one-click install (assumesadb-mcpis on yourPATHfrom step 2):

Any other client(Windsurf, Codex, …): runadb-mcpover stdio. The usual config shape:

{ "mcpServers": { "adb": { "command": "adb-mcp" } } }

To confirm it's wired up, ask your agent to "boot an emulator and take a screenshot".

make install # builds ./bin/adb-mcp and copies it to ~/.local/bin # or: go build -o bin/adb-mcp ./cmd/adb-mcp # or straight from the module (note the /cmd/adb-mcp suffix): go install github.com/iksnerd/adb-mcp/cmd/adb-mcp@latest

78 tools across ten areas. Every device-facing tool takes an optionalserial(adb-s). Omit it with one device attached, or pass one fromlist_deviceswith several. Full reference:docs/TOOLS.md.

- Emulator / device: boot, list, wait-for-boot, shut down, connect over Wi-Fi,adb_reverseport forwarding (Metro!)
- Observe:screenshotto see (works on multi-display foldables, pick a panel withdisplay),describe_uifor true-pixel element centers, with the focusedtop window(spot a biometric prompt, or the wrong app entirely, occluding your target via optionalpackage),filter/query/compactmodes, and a hidden-node count so absence is trustworthy
- Interact: tap,tap_on_text/tap_element(id-addressed), swipe, drag, long-press, type, key combos, PIN pads,wait,run_sequence(batch steps + guards in one call, which keeps native-timer flows from being perturbed by per-step round-trips); opt-inverify_changetells you whether a tap/key actually changed the UI; opt-invia_accessibilityontap_on_text/tap_element(EXPERIMENTAL) dispatches a real accessibility click for native views a coordinate tap can't reach, see
bridge/README.md
- Lock / Keystore / Biometrics: set/clear a secure lock screen, check lock state,has_biometric_enrolled+fingerprint_touch/finger_removeto satisfy a BiometricPrompt on the emulator
- Extended Controls (emulator):send_sms(OTP/2FA),phone_call,set_battery(also works on real devices via dumpsys),cellular(roaming/weak-signal/throttled),set_sensor(accelerometer/light/…),rotate_screen,avd_snapshot, driving the emulator's console-only panel thatdescribe_uican't see
- App lifecycle: install/uninstall, launch/stop,app_state(running pid(s) + Metro-vs-embedded bundle),launch_dev_client(Expo dev build → Metro, skipping the Dev Launcher),reload_app/open_dev_menu, clear data, permissions, deep links, push/pull files,last_crash
- Logs & capture: one-shot or streaminglogcat(substring/priority/tag filters,sincetime window, opt-inredactto mask tokens/passwords/API keys before output),clear_logcat,last_crash, screen recording
- Environment & diagnostics: dark mode, mock location, clean status bar,stay_awake(stop a doze-happy screen blanking your screenshots),doctor
- Gradle build & test:assembleDebug, unit tests, instrumented tests, JVM unit-test coverage via JaCoCo (get_coverage_report/get_file_coverage), task + variant + module discovery (list_gradle_variants/list_gradle_projects), one-shotbuild_and_run
- Session defaults: pinproject_dir/serialonce (session_set_defaults) so a multi-module/multi-flavor project or multi-device session doesn't need them repeated on every call

The driving know-how itself ships as five MCPresources(android://guide/*) the client can list and read. Seedocs/TOOLS.mdfor the URIs, or jump straight toandroid://guide/drivingfor the core loop below.

observe → locate → act → re-observe.screenshotto see,describe_uito get true-pixel centers,tap/tap_on_text/swipe/input_textto act, thenscreenshotagain to confirm. Readandroid://guide/drivingfor the full loop and the gotchas that waste turns.

make check # go vet + go test (unit tests need no emulator) make run # run over stdio for manual JSON-RPC poking
cmd/adb-mcp/main.go entry: subcommands (update/version) or serve MCP over stdio internal/tools/ thin MCP tool bindings internal/adb/ the device layer: an adb.Client whose methods are the commands internal/gradle/ host-side Gradle: build, find APKs, parse test reports internal/uiauto/ pure uiautomator-hierarchy model + parsing (unit-tested) internal/sdk/ resolves the Android SDK (adb/emulator paths, PATH env) internal/concurrent/ RunAll/RunIndexed: fan out independent I/O calls, join, done internal/guides/ the skill guides, embedded and served as MCP resources internal/selfupdate/ the adb-mcp update release fetch/verify/swap internal/bridgeupdate/ the adb-mcp bridge install release fetch/verify/install

Dependencies point inward only (tools → adb, gradle, uiauto → sdk), and eachinternal/tools/<domain>.goadaptermirrorsan execution file of the same name (device commands areadb.Clientmethods). Full map, the package graph, and the rules for adding a tool:ARCHITECTURE.md.

- adb-mcp.com: landing page
-
docs/TOOLS.md: full tool-by-tool reference and the guide resources
-
ARCHITECTURE.md: the mirror convention, package layout, and how to add a tool
-
docs/CHANGELOG.md: shipped work, newest first
-
docs/BACKLOG.md: open ideas and XcodeBuildMCP parity gaps

SeeCONTRIBUTING.mdfor setup and conventions. Found a security issue? SeeSECURITY.mdinstead of opening a public issue. Licensed underMIT.

This is a web browser that enables your coding agent, such as Claude Code, to visit websites on your behalf and assist you in identifying bugs or creating UI test cases.

Control Android devices via the Android Debug Bridge (ADB).

An agentic toolkit to control, debug, and profile iOS and Android apps.

The deepest Android Debug Bridge MCP server — 147 tools from UI to baseband.

Proxyman MCP allows AI to inspect HTTP traffic, create debugging rules, and control Proxyman - all through natural language conversations.

Interact with Android devices using the Android Debug Bridge (ADB).

Interact with Android devices using the Android Debug Bridge (ADB).

AI 測試大師 — MCP server driving pytest / Jest / Cypress / Go / Maestro. Analyze, generate, run, advise. Web + Mobile (iOS/Android/BlueStacks).

Control Android devices using the Android Debug Bridge (ADB).

Automate Android devices using the Gbox SDK.

Catch App Store rejections before they happen

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.