/ 目录 / 演练场 / Mobile MCP
● 社区 mobile-next ⚡ 即开即用

Mobile MCP

作者 mobile-next · mobile-next/mobile-mcp

One MCP interface to drive iOS and Android devices, simulators, and emulators — no separate XCUITest/Espresso knowledge.

Mobile MCP abstracts platform-specific mobile automation behind a single tool surface. Claude can tap, swipe, type, screenshot, and assert on iOS Simulators, Android Emulators, or real devices via USB/Wi-Fi. Useful for app QA, user-flow screenshotting, and debugging with natural-language steps.

为什么要用

核心特性

实时演示

实际使用效果

mobile-mcp.replay ▶ 就绪
0/0

安装

选择你的客户端

~/Library/Application Support/Claude/claude_desktop_config.json  · Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "mobile-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@mobilenext/mobile-mcp@latest"
      ]
    }
  }
}

打开 Claude Desktop → Settings → Developer → Edit Config。保存后重启应用。

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "mobile-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@mobilenext/mobile-mcp@latest"
      ]
    }
  }
}

Cursor 使用与 Claude Desktop 相同的 mcpServers 格式。项目级配置优先于全局。

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "mobile-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@mobilenext/mobile-mcp@latest"
      ]
    }
  }
}

点击 Cline 侧栏中的 MCP Servers 图标,然后选 "Edit Configuration"。

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "mobile-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@mobilenext/mobile-mcp@latest"
      ]
    }
  }
}

格式与 Claude Desktop 相同。重启 Windsurf 生效。

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "mobile-mcp",
      "command": "npx",
      "args": [
        "-y",
        "@mobilenext/mobile-mcp@latest"
      ]
    }
  ]
}

Continue 使用服务器对象数组,而非映射。

~/.config/zed/settings.json
{
  "context_servers": {
    "mobile-mcp": {
      "command": {
        "path": "npx",
        "args": [
          "-y",
          "@mobilenext/mobile-mcp@latest"
        ]
      }
    }
  }
}

加入 context_servers。Zed 保存后热重载。

claude mcp add mobile-mcp -- npx -y @mobilenext/mobile-mcp@latest

一行命令搞定。用 claude mcp list 验证,claude mcp remove 卸载。

使用场景

实战用法: Mobile MCP

Smoke-test your app on iOS + Android from one prompt

👤 Mobile QA, devs without a dedicated QA team ⏱ ~20 min intermediate

何时使用: You just cut a build and want to know if the sign-up flow still works on both platforms.

前置条件
  • Simulator bootedxcrun simctl boot "iPhone 16" and emulator -avd Pixel_7
  • App installed — Drag IPA/APK into the simulator or use install_app tool
步骤
  1. Start session
    Use mobile-mcp. List all available devices.✓ 已复制
    → iOS simulator + Android emulator listed
  2. Run the flow
    On both devices in parallel: open my app, tap "Sign Up", enter [email protected] / password123, tap Continue. Screenshot each step.✓ 已复制
    → Dual-device screenshot sequence
  3. Assert
    On each device, is the "Verify your email" screen visible? If not, report what you see.✓ 已复制
    → Per-platform pass/fail with evidence

结果: Pass/fail report with screenshots for both platforms in 2 minutes.

注意事项
  • Test account gets locked by anti-spam — Use per-build throwaway emails; rotate test accounts
搭配使用: filesystem

Generate App Store screenshots across 5 device sizes

👤 Indie devs submitting to the App Store ⏱ ~25 min intermediate

何时使用: You need 6.5", 6.7", 5.5" screenshots and don't want to do it manually.

前置条件
  • Simulators for each required size — Create via xcrun simctl with appropriate device types
步骤
  1. Build matrix
    Boot iPhone 15 Pro Max, iPhone 15, iPhone SE simulators. Install my app on each.✓ 已复制
    → All three devices ready with app installed
  2. Capture flow
    On each device, navigate to the 5 key screens (onboarding, feed, detail, settings, upgrade). Screenshot each at full resolution.✓ 已复制
    → Screenshots saved per-device with naming convention

结果: App Store-ready screenshots in all required sizes, in one run.

注意事项
  • Screenshots include simulator status bar — Use --status-bar-style=overridden or post-process with crop
搭配使用: filesystem

组合

与其他 MCP 搭配,撬动十倍杠杆

mobile-mcp + filesystem

Save screenshots into versioned QA folders

Save every screenshot under /qa/$(date)/ with the test name.✓ 已复制
mobile-mcp + xcodebuild

Build, install, and test in one flow

Build the iOS app via xcodebuild, install it via mobile-mcp, run the smoke test.✓ 已复制

工具

此 MCP 暴露的能力

工具输入参数何时调用成本
list_devices none Always first — know what's available free
launch_app device_id, bundle_id Open your app on the device free
tap device_id, selector|coords Interact with a button/control free
type_text device_id, text: str Fill a text field (must be focused first) free
get_view_hierarchy device_id Figure out what's on screen free
screenshot device_id, path?: str Visual verification free

成本与限制

运行它的成本

API 配额
Local
每次调用 Token 数
View hierarchy can be 10k+ tokens; screenshots are base64
费用
Free
提示
Prefer selector-based tapping over full view-hierarchy dumps to save tokens

安全

权限、密钥、影响范围

最小权限: device access (physical USB requires trust dialog)
凭据存储: None
数据出站: None from MCP; screenshots flow to LLM provider if shared
切勿授予: production device access with PII

故障排查

常见错误与修复

No devices listed

Boot a simulator first: xcrun simctl boot / emulator -avd X

验证: `xcrun simctl list | grep Booted`
tap_at_coords misses

Run get_view_hierarchy and use selector-based tap — coords break across screen sizes

Real device not trusted

On iOS: Settings → General → Device Management → trust. On Android: enable USB debugging.

替代方案

Mobile MCP 对比其他方案

替代方案何时用它替代权衡
XcodeBuildMCPYou need iOS-only build + test, not cross-platform UI automationNo Android; heavier on build tooling
AppiumYou want a full CI-grade mobile testing frameworkWay more setup; not MCP-native

更多

资源

📖 阅读 GitHub 上的官方 README

🐙 查看未解决的 issue

🔍 浏览全部 400+ MCP 服务器和 Skills