Mcp Android

io.github.dockndevai由 GitHub 账号 dockndevai 发布v0.1.0更新于 Nov 4, 2026

Control Android devices over ADB from AI agents — safe-by-default, read-only by default, audited.

已验证STDIO仅桌面效率与工作流开发者工具

概览

AI 生成的概览

本地 MCP 服务器,让助手通过 ADB 控制 USB 或无线连接的安卓手机:查看屏幕、点击输入、启动应用、读取通知。

可以做什么
  • 查看设备:列出已连接设备、读取设备信息、截图、导出 UI 层级、查看当前应用。
  • 读取应用与通知:列出已安装应用、读取待处理通知。
  • 操作界面:点击、滑动、输入文字、按键、启动应用、打开网址。
  • 在手机上设置闹钟和计时器。
  • 启用后的管理操作:安装 APK、卸载应用、清除应用数据、执行原始 adb shell 命令。
适用场景
适合希望助手在桌面上操作或查看真实安卓手机的场景,例如查看屏幕内容、自动化重复的点击输入流程、设置闹钟与计时器,或查看通知。
运行要求
通过 npm 包以 npx 在桌面本地运行,需要 Node.js 和 adb 可执行文件(ANDROID_ADB_PATH,默认使用 PATH 中的 adb)。手机需开启 USB 或无线调试并授权本机。通过 ANDROID_MODE、ANDROID_SERIAL 及各项允许开关等环境变量配置;无需账号或 API 密钥。
安装前请注意
它会操作真实设备。默认只读,但读写模式允许点击、输入、启动应用、设置闹钟与计时器;管理模式下配合 ANDROID_ALLOW_INSTALL 或 ANDROID_ALLOW_SHELL 可安装、卸载、清除数据及执行任意 shell 命令。除非必要请保持 ANDROID_MODE 为只读,使用 ANDROID_PACKAGE_ALLOWLIST 与 ANDROID_PROTECTED_PACKAGES,并注意仅当客户端支持 MCP elicitation 时破坏性工具才会暂停等待人工确认;ANDROID_DRY_RUN 可预览写操作而不执行。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Mcp Android,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

mcp-android

[CI] [License: MIT] [npm]

A Model Context Protocol server to control an Android phone over ADB — the phone equivalent of the Mac-control servers. Claude can see the screen (screenshots + UI hierarchy) and tap, type, press keys, launch apps, set alarms/timers, and read notifications. Safe-by-default, with the suite's access-mode + flag model.

Runs on your computer and drives a phone connected by USB or wireless debugging (great for the Z Fold 7). It is not installed on the phone and does not need root.

iOS? A stock iPhone can't be controlled this way — Apple's sandbox forbids cross-app/system automation. See the separate mcp-ios repo for the realistic (Appium/WebDriverAgent over USB from a Mac) approach.

Quickstart

bash
brew install android-platform-tools        # provides adb# On the phone: Settings → Developer options → enable USB (or Wireless) debugging, then authorize this computeradb devices                                 # confirm your device shows "device"

Run it straight from npm — no clone or build needed:

bash
npx -y @dockndevai/mcp-android

Or add it to Claude Code in one line (start read-only):

bash
claude mcp add android -e ANDROID_MODE="read-only" -- npx -y @dockndevai/mcp-android

See docs/CLIENTS.md for Claude Desktop, Cursor, Codex, Windsurf, and VS Code configs.

Setup from source

bash
brew install android-platform-tools        # provides adbadb devices                                 # confirm your device shows "device"npm install && npm run build

Tools

Read (read-only+): list_devices, device_info, screenshot, ui_dump, current_app, list_apps, get_notifications

Write (read-write+): tap, swipe, input_text, press_key, launch_app, open_url, set_alarm, set_timer

Admin (admin): install_apk, uninstall_app, clear_app_data (need ANDROID_ALLOW_INSTALL), run_shell (needs ANDROID_ALLOW_SHELL; not registered otherwise)

The typical loop for driving the UI: screenshot → ui_dump (find bounds) → tap/input_text.

Security model

ConcernFlagDefault
What it can doANDROID_MODEread-only
Which packages in scopeANDROID_PACKAGE_ALLOWLIST(all)
Protected packages (never uninstall/clear)ANDROID_PROTECTED_PACKAGESsettings, systemui, gms
Allow install/uninstall/clearANDROID_ALLOW_INSTALLfalse
Allow raw adb shellANDROID_ALLOW_SHELLfalse
Interactive confirmation (destructive ops)MCP elicitation (client-driven)(on when the client supports it)
Preview without touching deviceANDROID_DRY_RUNfalse
Audit log (stderr)ANDROID_AUDIT_LOGtrue

When the connected client supports MCP elicitation, destructive tools (uninstall_app, clear_app_data, install_apk, run_shell) pause and ask the human to approve the exact action before it runs — the model can't approve on your behalf. When the client can't elicit, the access-mode + flag gates above are the control.

Run with Claude Desktop / Claude Code

json
{  "mcpServers": {    "android": {      "command": "node",      "args": ["/absolute/path/to/mcp-android/dist/index.js"],      "env": { "ANDROID_MODE": "read-write" }    }  }}

Example prompts

  • "Take a screenshot of my phone and tell me what's on screen."
  • "Set an alarm for 6:30am labeled Gym."
  • "Open the Clock app and start a 10-minute timer."
  • "What notifications do I have piling up?"

Develop

bash
npm run devnpm test          # security policynpm run typecheck

License

MIT

来源:README.md,提交 a3a3fd6

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.1.0最新Oct 14, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分