Repository avatar
Browser Automation
v0.1.0
active

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_tree dumps the Android accessibility hierarchy via uiautomator 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. Pass onlyChanged: true for a + / ~ / - delta diff against the previous snapshot, and pass index, text, or id directly to tap, type_text, and batch_actions.
  • Mobile Chrome and WebView CDP bridge on port 9333: Android browsers and WebViews often expose empty trees to uiautomator. 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 to 127.0.0.1:9333 for turbo-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 "••••", and type_text rejects 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 via TurboImeService with 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

VariableDefaultPurpose
TURBO_ANDROID_ADBadbPath 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_LANGenLanguage for tool output and error messages (en or vi).
TURBO_ANDROID_IME_PACKAGEvn.trungthanh.turboandroidPackage name (or package/.Service) of the companion TurboImeService APK used for Base64 Unicode and Vietnamese text input.
TURBO_ANDROID_TRANSPORTauto (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)

ToolPurposeKey parameters
ui_treeDump and parse the current screen UI hierarchy into compact nodes with (cx,cy) center coordinates, or return a + / ~ / - delta diffonlyChanged (default false)
screenshotCapture the screen as a PNG image (downscaled when Python + Pillow are available)maxSide (default 1024)
tapTap a node by index, text, or id from the latest ui_tree, or at physical pixel coordinatesindex, text, id, x, y
swipeSwipe from (x1, y1) to (x2, y2)x1, y1, x2, y2, durationMs (default 300)
keySend a hardware or navigation key eventkey (BACK, HOME, ENTER, RECENTS, VOLUME_UP, VOLUME_DOWN, POWER)
type_textType text into the focused field, or first tap a field matched by index, id, or targetText from the latest ui_treetext, value, index, id, targetText, submit (default false)
open_appLaunch an installed application by package namepackage
open_settingsOpen an Android Settings screen directlypage (main, wifi, bluetooth, display, sound, battery, apps, app_details, location, notifications, storage, developer, date, language, accessibility, network), package
list_appsList installed package namesfilter, thirdPartyOnly (default true)
current_appGet the foreground package and activity from dumpsys window(none)
waitSleep for a bounded durationms (max 5000, default 1000)
batch_actionsRun multiple non-root UI steps (tap, type_text, swipe, key, wait, open_app, open_settings, ui_tree) in one callsteps, 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.

ToolPurposeKey parameters
settings_getRead a system, secure, or global settingnamespace, key
settings_putWrite a system, secure, or global setting (security keys like adb_enabled and enabled_accessibility_services are blocked)namespace, key, value
app_manageInspect 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_filestat, list, read, or write files with realpath symlink confinementaction, path, content, encoding (utf8, base64), maxBytes
system_diagnosticsRead battery, memory, storage, thermal, redacted logcat, or filtered dumpsyskind, service, lines, filter
power_saverInspect or control Battery Saver and App Standby Bucketaction (status, set_low_power, app_standby_bucket), enabled, package, bucket
root_shellExecute a host shell command (destructive commands and /data/adb access are blocked)command

Safety boundaries

  1. 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).
  2. Password masking and input refusal: parseUiTreeXml masks any node with password="true" as "••••" and strips its content-desc. If a password field is focused in the latest UI tree, type_text rejects the call so the user can enter credentials manually.
  3. Log and audit redaction: system_diagnostics and 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 to turbo-browser-mcp.
  • app/: Kotlin + Jetpack Compose control client (minSdk 26, targetSdk 36), foreground service, floating cross-app emergency STOP overlay, and TurboImeService.
  • scripts/: chroot installer (install.sh), daemon start/stop scripts, and watchdog.sh.

License

MIT