Skip to main content
Glama

android-phone-mcp

Open-source MCP (stdio) server that lets an AI client control an Android emulator or USB device over ADB.

This is not AndroMeld, is not affiliated with Catching Now / AndroMeld, and does not implement Continuity, Finder mounting, Meld Mode, Mac widgets, or AndroMeld’s helper app. Tool names follow AndroMeld’s public MCP list (phone_connect, phone_observe, phone_tap, phone_swipe, phone_type, phone_key, phone_launch, phone_apps) so an existing client config is easier to swap. Behavior is ADB-based: an emulator is enough; no physical phone is required for basic verification.


中文简介

用标准 MCP stdio 把 Android 模拟器或真机交给 Cursor / Claude Desktop 等客户端操作。驱动层只有 adb(Android platform-tools),不依赖任何 AndroMeld 二进制或私有 API。

和 AndroMeld 的差异

android-phone-mcp

AndroMeld

连接

adb(模拟器或 USB / 无线调试)

Mac 应用 + 手机助手

界面树

uiautomator dump

无障碍树(Phone Screen)

模拟器

支持,推荐用来验证

面向真机 + Mac

Finder / Continuity / 通话 / 小组件

无

有

安装

git clone https://github.com/liush2yuxjtu/android-phone-mcp.git
cd android-phone-mcp
npm install
npm run build
# 需要本机已安装 adb,且 `adb devices` 能看到 device

MCP 配置(Cursor) — 把路径换成你的克隆目录:

{
  "mcpServers": {
    "android-phone": {
      "command": "node",
      "args": ["/ABS/PATH/android-phone-mcp/dist/index.js"],
      "env": {
        "ANDROID_SERIAL": "emulator-5554"
      }
    }
  }
}

开发时也可用:

{
  "mcpServers": {
    "android-phone": {
      "command": "npx",
      "args": ["tsx", "/ABS/PATH/android-phone-mcp/src/index.ts"],
      "env": { "ANDROID_SERIAL": "emulator-5554" }
    }
  }
}

先启动 AVD,执行 adb devices -l 看到 device,再让客户端调用 phone_connect。


Related MCP server: Android Control MCP Server

English

Requirements

  • Node.js 20+

  • adb on PATH (or set ADB_PATH)

  • An emulator or a device with USB debugging authorized

Install

git clone https://github.com/liush2yuxjtu/android-phone-mcp.git
cd android-phone-mcp
npm install && npm run build && npm test

npm start runs the stdio MCP server (the client should spawn this; do not type into it yourself).

Emulator quickstart

See scripts/start-emulator.md. Short version:

emulator -avd mcp_pixel
adb devices -l          # wait until: emulator-5554    device
export ANDROID_SERIAL=emulator-5554
./scripts/verify-adb.sh

MCP client config

Cursor (~/.cursor/mcp.json or project .cursor/mcp.json):

{
  "mcpServers": {
    "android-phone": {
      "command": "node",
      "args": ["/ABS/PATH/android-phone-mcp/dist/index.js"],
      "env": {
        "ANDROID_SERIAL": "emulator-5554"
      }
    }
  }
}

Claude Desktop (claude_desktop_config.json):

{
  "mcpServers": {
    "android-phone": {
      "command": "node",
      "args": ["/ABS/PATH/android-phone-mcp/dist/index.js"],
      "env": {
        "ANDROID_SERIAL": "emulator-5554"
      }
    }
  }
}

From a clone, npx + tsx also works (see Chinese section). GitHub npx github:liush2yuxjtu/android-phone-mcp can work after prepare builds dist/; the most reliable path is a local node …/dist/index.js.

Device selection

  1. Tool argument device on phone_connect

  2. Else env ANDROID_SERIAL

  3. Else the only online adb device

  4. Else the tool lists serials and asks you to pick

Tools

Aligned with AndroMeld’s documented names (intent: phone control via MCP, not protocol/binary compatibility):

Tool

Role

phone_connect

List/select devices; return current screen summary

phone_observe

UI hierarchy (uiautomator dump); optional screenshot

phone_tap

Tap x,y or last-observe index / text / resourceId / contentDesc

phone_swipe

Coordinates or direction: up / down / left / right

phone_type

Type into the focused field (input text or clipboard paste)

phone_key

HOME, BACK, ENTER, APP_SWITCH, …

phone_launch

Package, component, or alias (settings, chrome, …)

phone_apps

Launchable launcher activities

Extras: phone_screenshot, phone_back, phone_home, phone_devices.

Typical loop: phone_connect → phone_observe → phone_tap / phone_type using [n] indexes. Actions re-observe by default so the model sees the resulting screen.

Verification commands

With an emulator already device in adb devices:

adb devices -l
export ANDROID_SERIAL=emulator-5554
adb -s "$ANDROID_SERIAL" shell wm size
adb -s "$ANDROID_SERIAL" shell uiautomator dump --compressed /data/local/tmp/android-phone-mcp-uidump.xml
adb -s "$ANDROID_SERIAL" exec-out cat /data/local/tmp/android-phone-mcp-uidump.xml | head -c 400
./scripts/verify-adb.sh

Then in the MCP client: “Call phone_connect, then phone_observe, then phone_launch app=settings.”

To prove a Mac-hosted QR can be scanned by the emulator camera (no physical phone), use the project /verify skill (.cursor/skills/verify/SKILL.md) and scripts/verify-qr-mac-scan.md. Verdicts are PASS / FAIL / BLOCKED / SKIP — camera PASS requires /status scanned: true and a scanner User-Agent (e.g. ZXing (Android)), not an adb VIEW intent.

Limitations

  • Needs a reachable adb device; this server does not start the emulator for you.

  • uiautomator dump fails on some secure/DRM surfaces, games, and a few OEM skins — use includeScreenshot / phone_screenshot and tap coordinates.

  • Unicode typing depends on cmd clipboard set-text + paste; some images lack that command.

  • No AndroMeld Continuity, Finder, calls, widgets, or Mac windowing.

  • Full device control is powerful: only attach emulators or phones you intend an AI client to operate.

  • Android 12+ is the realistic floor for a useful hierarchy dump; older images may still accept input events.

Development

npm test      # mocked adb
npm run build
npm start     # stdio MCP

License: MIT.

Available Tools

12 tools
phone_appsList launchable appsA

List installed launcher activities (package + activity) on the selected device.

Inputs: no named parameters.

phone_backBackA

Press BACK (convenience wrapper around phone_key).

Inputs: observe, settleMs, includeScreenshot.

phone_connectConnect Android deviceA

List ADB devices (emulator or USB), select one, and return a compact current-screen summary. Call this first. Pass device as an ADB serial, or set ANDROID_SERIAL.

Inputs: device.

phone_devicesList ADB devicesA

List connected ADB devices without changing the current selection or dumping the UI.

Inputs: no named parameters.

phone_homeHomeB

Press HOME (convenience wrapper around phone_key).

Inputs: observe, settleMs, includeScreenshot.

phone_keySend key eventB

Send an Android keyevent such as HOME, BACK, ENTER, TAB, DELETE, APP_SWITCH, POWER, VOLUME_UP, VOLUME_DOWN, DPAD_UP/DOWN/LEFT/RIGHT, PASTE. Returns the resulting screen.

Inputs: key (required), observe, settleMs, includeScreenshot.

phone_launchLaunch appB

Launch an app by package (com.android.settings), component (pkg/.Activity), or known alias (settings, chrome, camera, photos, gmail, play, files, clock, calculator, phone, messages).

Inputs: app (required), observe, settleMs, includeScreenshot.

phone_observeObserve screen UIA

Capture the current UI hierarchy via uiautomator dump (accessibility-style tree) and return a numbered element list for tapping. Set includeScreenshot when the tree is not enough (games, canvas, Chrome content).

Inputs: includeScreenshot.

phone_screenshotScreenshotB

Capture a PNG screenshot of the current display.

Inputs: no named parameters.

phone_swipeSwipeC

Swipe from (x1,y1) to (x2,y2), or by finger direction up/down/left/right across the screen. Returns the resulting screen.

Inputs: x1, x2, y1, y2, +6 more.

phone_tapTap screenA

Tap by pixel coordinates (x,y) or by an element from the last phone_observe (index, text, resourceId, contentDesc). Optional durationMs performs a long-press. Returns the resulting screen.

Inputs: x, y, text, index, +9 more.

phone_typeType textA

Type into the focused field. Optionally tap a selector first. ASCII uses adb input text; other characters use clipboard paste. Returns the resulting screen.

Inputs: text (required), clear, index, observe, +6 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 12 tools

    Disambiguation4/5

    Each tool has a distinct purpose: connect/select, list-only, observe tree, screenshot, apps, tap, swipe, type, key, launch. The only overlap is phone_back and phone_home being explicit convenience wrappers around phone_key, and connect vs devices both listing ADB devices, but descriptions clarify these boundaries well.

    Naming Consistency5/5

    All 12 tools use a uniform phone_ prefix followed by a clear action or resource noun (connect, devices, observe, screenshot, tap, swipe, type, key, launch). The pattern is predictable and fully consistent throughout.

    Tool Count5/5

    12 tools is well within the ideal range and each earns its place by covering a distinct step in the phone-interaction loop (discover, observe, act, launch). Nothing feels padded or redundant at the set level.

    Completeness4/5

    The core lifecycle of connect, observe, interact (tap/swipe/type/key), launch, and capture is fully covered with no dead ends. Minor gaps exist for out-of-band operations like installing/uninstalling apps or retrieving device state, but agents can accomplish the primary automation workflows.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      Enables AI assistants to interact with Android devices and emulators via ADB, providing tools for screenshots, UI inspection, touch and text input, app management, and device control.
      42
      143 npm
      23
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Enables 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.
      12
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Enables AI assistants to read and control a connected Android device over adb or a local root shell, with tools for screen inspection, tapping, typing, swiping, launching apps, and system commands.
      18
      2
      MIT