Mobile Device MCP

io.github.srmorete由 GitHub 账号 srmorete 发布v0.1.10更新于 Oct 24, 2026

Control iOS and Android devices with multi-device and seamless Native/WebView support.

已验证STDIO仅桌面浏览器自动化开发者工具

概览

AI 生成的概览

让助手控制已连接的 iOS 和 Android 设备:点击、滚动、输入、截图、读取 UI 树并运行设备端代码。

可以做什么
提供列出设备、截取屏幕、读取扁平化 UI 元素树,以及发送点击、双击、长按、滑动和硬件按键等手势的工具。它可以输入文本、启动或终止应用、列出已安装应用,并从主机本地文件安装应用。run_code 工具在 Android 上以 UIAutomator 绑定、在 iOS 上以 XCUITest 绑定执行沙箱 JavaScript,且可同时处理多台设备。
适用场景
适合让助手操作真机或模拟器:UI 自动化、探索性测试、复现缺陷,或在多台设备上执行脚本化交互。适用于助手需要查看屏幕并对其操作,而不仅是生成代码的场景。
运行要求
通过 npx 以 stdio 在本地运行,需要 Node.js 18 或更高版本。Android 需要 Android SDK 且 adb 在 PATH 中;iOS 模拟器需要 Xcode 及 xcrun、simctl;iOS 真机需要 xcodebuild、devicectl 以及 libimobiledevice 的 iproxy。可选环境变量 MDMS_PORT_ANDROID 和 MDMS_PORT_IOS 用于设置设备端服务器的起始端口。
安装前请注意
首次使用时服务器会在每台设备上安装驱动应用并启动设备端 HTTP 服务器,通过 localhost 上的每设备 bearer token 认证。部分工具会改变设备状态:install_app 会替换已有安装,terminate_app 会强制停止应用,run_code 会在设备上执行 JavaScript,尽管沙箱会限制部分操作并终止失控脚本。只连接你愿意被控制的设备。

安装

在 SourceWeft 中

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

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

其他 MCP 客户端

参照 仓库 中的启动说明。

README

Mobile Device MCP

An MCP server that lets AI agents control iOS and Android devices (tap, scroll, type, take screenshots, read UI trees, and run code). Works with multiple devices at the same time.

How It Works

Three-layer architecture:

  1. On-device servers — Lightweight HTTP servers running on each mobile device (UIAutomator on Android, XCUITest on iOS) that expose the accessibility tree and accept interaction commands.
  2. UI tree filter — Normalizes raw UI trees from both platforms into a unified flat element list.
  3. MCP server — The external interface. Handles device discovery, bootstrapping, port allocation, and proxies requests to on-device servers.

Devices are bootstrapped on first use — the server installs the driver app, allocates a port, starts the on-device server, and polls until it's healthy. After that, all tool calls are proxied over localhost HTTP with per-device bearer token auth.

Tools

ToolDescription
list_devicesList available iOS and Android devices
screenshotCapture the device screen (JPEG)
uitreeGet the UI element tree as a flat list, with optional search and limit. Off-screen elements are excluded unless include_invisible: true
tapTap at screen coordinates
double_tapDouble-tap at screen coordinates
long_pressLong-press at screen coordinates (configurable duration)
scrollSwipe from start to end coordinates
type_textType text into the focused element
press_buttonPress a hardware/navigation button (home, back, enter, volumeUp/Down, dpadUp/Down/Left/Right/Center)
launch_appLaunch an app by bundle ID / package name
terminate_appForce-stop an app
list_appsList installed apps
install_appInstall an app from a host-local file (.apk for Android, .app for iOS simulator, .app/.ipa for iOS device). Replaces existing installs
run_codeExecute sandboxed JavaScript on-device (see run_code below)

run_code

Agents can pass code that looks like UIAutomator or XCUITest, both being Javascript under the hood. The sandbox restricts (Android) potentially dangerous Java operations and only allows (iOS) some XCUITest-ish commands

  • Android: Rhino engine with UIAutomator bindings — uiDevice (click, swipe, find elements, press keys, read display info), By (selectors), Until (wait conditions), console.log()
  • iOS: JavaScriptCore with XCUITest bindings — app (query elements, tap, type, swipe), springboard, device, openApp(bundleId), sleep(ms), console.log()

Both platforms automatically kill runaway scripts (infinite loops) and create a fresh sandbox per call.

Prerequisites

  • Node.js 18+ (for running via npx)
  • Android: Android SDK with adb on PATH
  • iOS Simulator: Xcode with xcrun, simctl
  • iOS Real Device: Xcode with xcodebuild, devicectl, and iproxy (from libimobiledevice)
  • Building from source: Bun runtime, Gradle (Android), Xcode (iOS)

Installation

Claude Code

bash
claude mcp add mobile-device-mcp -- npx -y @srmorete/mobile-device-mcp@latest

Or with custom ports:

bash
claude mcp add mobile-device-mcp -e MDMS_PORT_ANDROID=20000 -e MDMS_PORT_IOS=21000 -- npx -y @srmorete/mobile-device-mcp@latest

Modifying .mcp.json (Cursor, Claude Desktop, etc)

json
{  "mcpServers": {    "mobile-device-mcp": {      "command": "npx",      "args": ["-y", "@srmorete/mobile-device-mcp@latest"],      "env": {        "MDMS_PORT_ANDROID": "18000",           # optional        "MDMS_PORT_IOS": "19000"                # optional      }    }  }}

Building from Source

bash
git clone <repo-url>cd mobile-device-mcpbun install
# Build drivers for both platforms and pack tarball./scripts/build.sh

The build script compiles the on-device drivers (Android APKs via Gradle, iOS test bundle via xcodebuild), copies them to drivers/, and creates an npm tarball.

To run locally during development:

bash
bun run start           # Start the MCP serverbun test                # Run the test suite

Configuration

Environment VariableDefaultDescription
MDMS_PORT_ANDROID18000Base port for Android on-device servers
MDMS_PORT_IOS19000Base port for iOS on-device servers

Ports are assigned sequentially — first Android device gets 18000, second gets 18001, and so on. Same for iOS starting at 19000.

Acknowledgements

Mobile Device MCP server stands on the shoulders of giants such as mobile-mcp and Maestro. Used as inspiration but reframed the current approach to be multi-device and with seamless Native/WebView support (especially on Android).

License

MIT

来源:README.md,提交 ec853d4

工具

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

版本历史

1
  1. v0.1.10最新Sep 16, 2026

评分

已满足适用检查项的 50%

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

  • 近 30 天内可连通25 分

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

  • 已声明认证方式10 分

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

  • 已列出工具15 分

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

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