
turbo-android-mcp
io.github.Tthanh2k6/turbo-android-mcp
Android ADB MCP server with UI tree deltas, Unicode IME, Chrome CDP bridge, and deny-zones.
Documentation
turbo-android-mcp
turbo-android-mcp is a zero-dependency Node.js MCP server that drives Android phones, tablets, and emulators over standard adb (npx -y turbo-android-mcp) on Windows, macOS, and Linux without device root. When connected over adb (AdbTransport), tools/list exposes only the 12 non-root screen and app tools and hides the 7 host root tools so the model does not waste context tokens or call unavailable commands.
Core capabilities over standard adb:
- Multi-window UI trees and delta diffs:
ui_treedumps the Android accessibility hierarchy viauiautomator dump --windows(preserving split-screen panes and dialogs), strips system bars, and formats clickable or text nodes with center coordinates(cx,cy)capped at 6,000 characters. PassonlyChanged: truefor a+/~/-delta diff against the previous snapshot, and passindex,text, oriddirectly totap,type_text, andbatch_actions. - Mobile Chrome and WebView CDP bridge on port
9333: Android browsers and WebViews often expose empty trees touiautomator. The built-in CDP bridge (daemon/cdp-bridge.mjs) detects@chrome_devtools_remote,@brave_devtools_remote, and@webview_devtools_remote_<pid>sockets, checks the active package against the deny-zone list, and forwards DevTools traffic to127.0.0.1:9333forturbo-browser-mcp. - Banking, wallet, and password deny-zones: Every screen read, tap, swipe, text input, app launch, and CDP attach blocks banking and e-wallet apps (
momo,zalopay,vnpay,shopeepay,paypal,vcb,techcombank,mbbank,bidv,vietinbank),VNeID, password managers (1password,bitwarden,keepass,lastpass,dashlane,protonpass), and root managers (KernelSU). Password nodes (password="true") are masked as"••••", andtype_textrejects calls when a password field is focused or targeted. - Vietnamese and Unicode IME input: ASCII text uses
input text, while accented Vietnamese, CJK, and emoji text is sent as Base64 broadcasts viaTurboImeServicewith automatic restoration of the previous keyboard (/data/local/tmp/turbo_prev_ime).
Install and configure
Requires Node 20 or newer and adb (Android Platform Tools) with USB debugging or Wireless debugging enabled on the target Android device.
Claude Code:
claude mcp add turbo-android -- npx -y turbo-android-mcp
MCP clients using an mcpServers JSON file (Cursor, Claude Desktop, Antigravity):
{
"mcpServers": {
"turbo-android": {
"command": "npx",
"args": ["-y", "turbo-android-mcp"],
"env": {
"TURBO_ANDROID_ADB": "adb",
"TURBO_ANDROID_SERIAL": "",
"TURBO_ANDROID_LANG": "en"
}
}
}
}
From source:
git clone https://github.com/Tthanh2k6/turbo-android.git
cd turbo-android
node --test test/*.test.mjs
Environment variables
| Variable | Default | Purpose |
|---|---|---|
TURBO_ANDROID_ADB | adb | Path or binary name for the Android Debug Bridge executable (AdbTransport). |
TURBO_ANDROID_SERIAL | (empty) | Target device serial passed to adb -s <serial> when multiple devices are connected. |
TURBO_ANDROID_LANG | en | Language for tool output and error messages (en or vi). |
TURBO_ANDROID_IME_PACKAGE | vn.trungthanh.turboandroid | Package name (or package/.Service) of the companion TurboImeService APK used for Base64 Unicode and Vietnamese text input. |
TURBO_ANDROID_TRANSPORT | auto (adb on PC/Mac, chroot when UID 0 on Linux) | Force adb or chroot transport. |
TURBO_ANDROID_URL | (empty in direct ADB mode) | When set (or when TURBO_ANDROID_TOKEN / TURBO_SESSION_ID is present), android-mcp forwards tool calls over HTTP to turbo-android-d (POST /internal/tool). |
MCP tools
Screen navigation and app tools (no root required over ADB)
| Tool | Purpose | Key parameters |
|---|---|---|
ui_tree | Dump and parse the current screen UI hierarchy into compact nodes with (cx,cy) center coordinates, or return a + / ~ / - delta diff | onlyChanged (default false) |
screenshot | Capture the screen as a PNG image (downscaled when Python + Pillow are available) | maxSide (default 1024) |
tap | Tap a node by index, text, or id from the latest ui_tree, or at physical pixel coordinates | index, text, id, x, y |
swipe | Swipe from (x1, y1) to (x2, y2) | x1, y1, x2, y2, durationMs (default 300) |
key | Send a hardware or navigation key event | key (BACK, HOME, ENTER, RECENTS, VOLUME_UP, VOLUME_DOWN, POWER) |
type_text | Type text into the focused field, or first tap a field matched by index, id, or targetText from the latest ui_tree | text, value, index, id, targetText, submit (default false) |
open_app | Launch an installed application by package name | package |
open_settings | Open an Android Settings screen directly | page (main, wifi, bluetooth, display, sound, battery, apps, app_details, location, notifications, storage, developer, date, language, accessibility, network), package |
list_apps | List installed package names | filter, thirdPartyOnly (default true) |
current_app | Get the foreground package and activity from dumpsys window | (none) |
wait | Sleep for a bounded duration | ms (max 5000, default 1000) |
batch_actions | Run multiple non-root UI steps (tap, type_text, swipe, key, wait, open_app, open_settings, ui_tree) in one call | steps, stopOnError (default true), returnUiTree (default false), onlyChanged (default false) |
System inspection and privileged tools (daemon / chroot root mode only)
These 7 tools are hidden from tools/list in standard AdbTransport mode. When running inside the on-device daemon (turbo-android-d) or ChrootRootTransport, mutating tools pause and request user approval on the Android screen.
| Tool | Purpose | Key parameters |
|---|---|---|
settings_get | Read a system, secure, or global setting | namespace, key |
settings_put | Write a system, secure, or global setting (security keys like adb_enabled and enabled_accessibility_services are blocked) | namespace, key, value |
app_manage | Inspect or manage a package (protected system and deny-zone packages are blocked) | action (info, force_stop, clear_data, enable, disable, grant_perm, revoke_perm), package, permission |
root_file | stat, list, read, or write files with realpath symlink confinement | action, path, content, encoding (utf8, base64), maxBytes |
system_diagnostics | Read battery, memory, storage, thermal, redacted logcat, or filtered dumpsys | kind, service, lines, filter |
power_saver | Inspect or control Battery Saver and App Standby Bucket | action (status, set_low_power, app_standby_bucket), enabled, package, bucket |
root_shell | Execute a host shell command (destructive commands and /data/adb access are blocked) | command |
Safety boundaries
- Deny zones:
ui_tree,screenshot,tap,swipe,type_text,open_app,app_manage, and the CDP bridge refuse to inspect or interact with banking apps, e-wallets (momo,zalopay,vnpay,shopeepay,paypal,vcb,techcombank,mbbank,bidv,vietinbank),VNeID, password managers (1password,bitwarden,keepass,lastpass,dashlane,protonpass), and root managers (KernelSU). - Password masking and input refusal:
parseUiTreeXmlmasks any node withpassword="true"as"••••"and strips itscontent-desc. If a password field is focused in the latest UI tree,type_textrejects the call so the user can enter credentials manually. - Log and audit redaction:
system_diagnosticsand the SHA-256 hash-chained audit log (daemon/audit-log.mjs) redact Bearer tokens, URL token query parameters, JWTs, and 32+ character hex secrets.
On-device daemon and control app (advanced mode)
In addition to standalone adb usage from a computer, this repository includes the full on-device stack for rooted Android tablets running a Debian arm64 chroot:
daemon/: zero-dependency Node ESM HTTP + SSE server (127.0.0.1:8765), CLI adapters (claude,codex,agy,opencode), project/git/terminal workers, and a local CDP bridge (127.0.0.1:9333) that forwards Android Chrome or Brave DevTools sockets toturbo-browser-mcp.app/: Kotlin + Jetpack Compose control client (minSdk 26,targetSdk 36), foreground service, floating cross-app emergencySTOPoverlay, andTurboImeService.scripts/: chroot installer (install.sh), daemon start/stop scripts, andwatchdog.sh.
License
MIT
turbo-android-mcpnpm install turbo-android-mcp