mobile-mcp是基于MCP协议的移动端自动化工具,支持真机/模拟器/模拟器,通过截图坐标或无障碍快照与iOS/Android应用交互,兼容Claude Code、Copilot等主流AI编程工具。
这是一个 MCP Server,通过平台无关的接口实现可扩展的移动端自动化和开发,无需分别掌握 iOS 或 Android 知识。你可以在模拟器、仿真器和真机(iOS 和 Android)上运行它。
该服务器允许 Agent 和 LLM 通过结构化的无障碍快照或基于截图的坐标点击来与原生 iOS/Android 应用和设备交互。
兼容 Claude Code、Codex、Gemini、GitHub Copilot、Antigravity,以及任何支持 MCP 的客户端。
可以在本机上连接设备,也可以通过 Mobile Next Cloud 连接云端的真实 iOS 和 Android 设备——工具相同,无需本地配置。

我们如何帮助扩展移动端自动化:
📲 原生应用自动化(iOS 和 Android),适用于测试或数据录入场景。
📝 无需手动控制模拟器/仿真器或真机(iPhone、三星、Google Pixel 等)即可执行脚本化流程和表单交互。
🧭 自动化由 LLM 驱动的多步骤用户旅程。
👆 适用于基于 Agent 框架的通用移动端应用交互。
🤖 支持 Agent 间通信,用于移动端自动化用例和数据提取。
🚀 优先无障碍——快速且低成本:从原生无障碍树驱动应用(无需视觉模型、无需图像 token),仅在必要时回退到截图 + 坐标模式。
📱 一个 API,适配所有目标:同一套工具在 iOS 和 Android 上均可工作——模拟器、仿真器和真机均可。
🧠 无需平台专业知识:无需 XCUITest、无需 Espresso、无需各平台粘合代码——描述目标,Agent 来完成。
🧰 完全设备控制:点击、滑动和手势操作;应用安装/启动/终止;屏幕录制;硬件按钮;深度链接;屏幕方向。
📊 结构化、确定性输出:读取真实 UI 元素并提取结构化数据,减少仅依赖截图方案带来的歧义。
🔧 可用的 MCP 工具
设备管理
mobile_list_available_devices - 列出所有可用设备(模拟器、仿真器和真机)
mobile_get_screen_size - 获取移动设备的屏幕尺寸(像素)
mobile_get_orientation - 获取设备当前屏幕方向
mobile_set_orientation - 更改屏幕方向(竖屏/横屏)
mobile_set_location - 覆盖设备报告的 GPS 位置,或清除覆盖
mobile_clipboard - 读取或替换设备剪贴板
远程设备(Mobile Next Cloud)
mobile_login_to_cloud_provider - 通过浏览器设备代码登录将此机器与云设备提供商认证
mobile_list_remote_devices - 列出云设备集群中可预约的设备型号
mobile_allocate_remote_device - 预约一台物理云设备供独占使用
mobile_release_remote_device - 将预约的云设备释放回集群
应用管理
mobile_list_apps - 列出设备上安装的所有应用
mobile_get_foreground_app - 获取前台运行的应用
mobile_launch_app - 使用包名启动应用
mobile_terminate_app - 停止并终止运行中的应用
mobile_install_app - 从文件安装应用(.apk、.ipa、.app、.zip)
mobile_uninstall_app - 使用 bundle ID 或包名卸载应用
截图与屏幕
mobile_take_screenshot - 截图以了解屏幕内容
mobile_save_screenshot - 将截图保存到文件
mobile_list_elements_on_screen - 列出 UI 元素及其坐标和属性
点击与手势
mobile_click_on_screen_at_coordinates - 在指定 x,y 坐标处点击
mobile_double_tap_on_screen - 在指定坐标处双击
mobile_long_press_on_screen_at_coordinates - 在指定坐标处长按
mobile_swipe_on_screen - 任意方向滑动(上下左右)
屏幕录制
mobile_start_screen_recording - 开始录制设备屏幕为视频文件
mobile_stop_screen_recording - 停止正在进行的屏幕录制并保存视频
输入与按钮
mobile_type_keys - 向焦点元素输入文本,可选提交
mobile_press_button - 按设备按钮(HOME、BACK、VOLUME_UP/DOWN、ENTER 等)
链接与日志
mobile_open_url - 在设备浏览器中打开 URL
mobile_get_device_logs - 收集实时设备日志(Android 的 logcat、iOS 的统一日志),可选择保存到文件
mobile_list_crashes - 列出设备上可用的崩溃报告
mobile_get_crash - 通过 ID 获取崩溃报告的完整内容
批处理
mobile_batch_commands - 单次调用顺序运行多个工具(如点击、输入、点击),可选择在末尾列出屏幕元素
🏗️ Mobile MCP 架构

更多详细信息请参阅我们的 Wiki 页面,包含设置、配置和调试相关内容。
连接 MCP 与 Agent 和移动设备所需的前提条件:
安装与配置
大多数工具的标准配置如下:
{
"mcpServers": {
"mobile-mcp": {
"command": "npx",
"args": ["-y", "@mobilenext/mobile-mcp@latest"]
}
}
}
Amp(VS Code 扩展)
通过 Amp VS Code 扩展的设置界面添加,或更新 settings.json 文件:
"amp.mcpServers": {
"mobile-mcp": {
"command": "npx",
"args": [
"@mobilenext/mobile-mcp@latest"
]
}
}
命令行安装
在终端中运行以下命令:
amp mcp add mobile-mcp -- npx @mobilenext/mobile-mcp@latest
Antigravity
Antigravity 没有 CLI 命令来添加 MCP 服务器,需手动编辑 ~/.gemini/config/mcp_config.json 添加:
{
"mcpServers": {
"mobile-mcp": {
"command": "npx",
"args": ["-y", "@mobilenext/mobile-mcp@latest"]
}
}
}
Cline
将上述 JSON 添加到 MCP 设置文件即可。
Claude Code
使用 Claude Code CLI 添加 Mobile MCP 服务器:
claude mcp add mobile-mcp -- npx -y @mobilenext/mobile-mcp@latest
按照 MCP 安装指南操作,使用上述 JSON 配置。
Codex
使用 Codex CLI 添加 Mobile MCP 服务器:
codex mcp add mobile-mcp npx "@mobilenext/mobile-mcp@latest"
或者创建或编辑配置文件 ~/.codex/config.toml 添加:
[mcp_servers.mobile-mcp]
command = "npx"
args = ["@mobilenext/mobile-mcp@latest"]
更多信息参阅 Codex MCP 文档。
Copilot
使用 Copilot CLI 交互式添加 Mobile MCP 服务器:
/mcp add
可以编辑配置文件 ~/.copilot/mcp-config.json 添加:
{
"mcpServers": {
"mobile-mcp": {
"type": "local",
"command": "npx",
"tools": [
"*"
],
"args": [
"@mobilenext/mobile-mcp@latest"
]
}
}
}
更多信息参阅 Copilot CLI 文档。
转到 Cursor Settings -> MCP -> Add new MCP Server。名称自拟,使用 command 类型,命令填写 npx -y @mobilenext/mobile-mcp@latest。也可以点击 Edit 来验证配置或添加命令参数。
Gemini CLI
使用 Gemini CLI 添加 Mobile MCP 服务器:
gemini mcp add mobile-mcp npx -y @mobilenext/mobile-mcp@latest
转到 Advanced settings -> Extensions -> Add custom extension。名称自拟,类型选择 STDIO,命令设置为 npx -y @mobilenext/mobile-mcp@latest。点击"Add Extension"。
Kiro
按照 MCP Servers 文档操作,例如在 .kiro/settings/mcp.json 中:
{
"mcpServers": {
"mobile-mcp": {
"command": "npx",
"args": [
"@mobilenext/mobile-mcp@latest"
]
}
}
}
OpenCode
按照 MCP Servers 文档操作,例如在 ~/.config/opencode/opencode.json 中:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"mobile-mcp": {
"type": "local",
"command": [
"npx",
"@mobilenext/mobile-mcp@latest"
],
"enabled": true
}
}
}
Windsurf
打开 Windsurf 设置,导航到 MCP servers,使用以下命令添加新服务器:
npx @mobilenext/mobile-mcp@latest
或者按照上述方式在 settings 的 mcpServers 下添加标准配置。
在 Wiki 中阅读更多内容!🚀
服务器配置完成后,让你的 Agent 列出设备:
list available devices
你应该会看到正在运行的模拟器、仿真器和已连接的设备。如果有返回,说明 Mobile MCP 已正确连接。如果列表为空,请确保模拟器或仿真器正在运行(参见前提条件)——更多帮助信息请查阅 Wiki。
☁️ 扩展规模,使用云设备
想要扩展到数百台设备?想在 CI/CD 流水线中使用 Mobile MCP?
在 Agent 中输入:
log in to mobile next cloud and then show me which remote devices are available to me
Streamable HTTP 服务器模式
默认情况下,Mobile MCP 通过 stdio 运行。如需启动 Streamable HTTP 服务器,请使用 --listen 标志:
npx @mobilenext/mobile-mcp@latest --listen 3000
这将绑定到 localhost:3000。如需绑定到特定接口:
npx @mobilenext/mobile-mcp@latest --listen 0.0.0.0:3000
然后将 MCP 客户端配置为连接到 http://<host>:3000/mcp(TLS 后面则是 https://…/mcp)。该端点接受 Streamable HTTP(/mcp 上的 POST);远程模式是无状态的(无需会话亲和性),非常适合 Smithery 和其他水平扩展主机。
迁移说明:--listen 之前在 /mcp 上提供已弃用的 HTTP+SSE 传输。客户端必须使用 Streamable HTTP 连接到 http(s)://host:port/mcp。/mcp 上旧的纯 SSE 流程已不再可用。
绑定到 localhost 时,会自动启用 Host 头 DNS 重绑定保护。
如需在 HTTP 服务器上启用 Bearer token 认证,请设置 MOBILEMCP_AUTH 环境变量:
MOBILEMCP_AUTH=my-secret-token npx @mobilenext/mobile-mcp@latest --listen 3000
设置后,所有请求必须包含 header Authorization: Bearer my-secret-token。未设置时,服务器接受未认证连接并记录警告。
将 MCP 服务器添加到 IDE/客户端后,你可以指示 AI 助手使用可用的工具。例如,在 Cursor 的 Agent 模式下,你可以使用以下提示词来快速验证、测试和迭代 UI 交互,从屏幕读取信息,完成复杂工作流。描述要详细,直截了当。
你可以在单个提示词中指定详细工作流,验证业务逻辑,设置自动化。可以尽情发挥:
搜索视频、评论、点赞和分享
Find the video called " Beginner Recipe for Tonkotsu Ramen" by Way of
Ramen, click on like video, after liking write a comment " this was
delicious, will make it next Friday", share the video with the first
contact in your whatsapp list.
下载成功计步应用、注册、设置锻炼并给应用 5 星评价
Find and Download a free "Pomodoro" app that has more than 1k stars.
Launch the app, register with my email, after registration find how to
start a pomodoro timer. When the pomodoro timer started, go back to the
app store and rate the app 5 stars, and leave a comment how useful the
app is.
在 Substack 搜索、阅读、高亮、评论并保存文章
Open Substack website, search for "Latest trends in AI automation 2025",
open the first article, highlight the section titled "Emerging AI trends",
and save article to reading list for later review, comment a random
paragraph summary.
预约健身课程、设置计时器
Open ClassPass, search for yoga classes tomorrow morning within 2 miles,
book the highest-rated class at 7 AM, confirm reservation,
setup a timer for the booked slot in the phone
找本地活动、设置日历事件
Open Eventbrite, search for AI startup meetup events happening this
weekend in "Austin, TX", select the most popular one, register and RSVP
yes to the event, setup a calendar event as a reminder.
查看天气预报并发送 WhatsApp/Telegram/Slack 消息
Open Weather app, check tomorrow's weather forecast for "Berlin", and
send the summary via Whatsapp/Telegram/Slack to contact "Lauren Trown",
thumbs up their response.
在 Zoom 安排会议并通过邮件分享邀请
Open Zoom app, schedule a meeting titled "AI Hackathon" for tomorrow at
10AM with a duration of 1 hour, copy the invitation link, and send it via
Gmail to contacts "team@example.com".
运行与配置
环境变量
启动时,Mobile MCP 可以连接到:
运行 Mobile Next Mobile MCP 之前,请确保已正确安装和配置移动端平台 SDK(Xcode、Android SDK)。
Mobile MCP 通过 PostHog 和 Scarf 收集匿名使用遥测数据。如需禁用,请设置 MOBILEMCP_DISABLE_TELEMETRY 环境变量:
MOBILEMCP_DISABLE_TELEMETRY=1 npx @mobilenext/mobile-mcp@latest
JSON 配置方式:
{
"mcpServers": {
"mobile-mcp": {
"command": "npx",
"args": ["-y", "@mobilenext/mobile-mcp@latest"],
"env": {
"MOBILEMCP_DISABLE_TELEMETRY": "1"
}
}
}
}
在模拟器/仿真器上以"无头"模式运行
当没有真机连接到你的机器时,你可以在后台使用仿真器或模拟器运行 Mobile MCP。
例如,在 Android 上:
avdmanager 或 emulator 命令)在 iOS 上,你需要 Xcode 并在使用 Mobile MCP 连接该模拟器实例之前先运行模拟器:
xcrun simctl boot "iPhone 16"
🧩 Mobile Next 的一部分
Mobile MCP 是驱动真实移动设备的工具包之一:
mobilewright — "面向移动端的 Playwright。"当你准备好将 Agent 驱动的探索转化为可在 iOS 和 Android 上重复执行的确定性测试时,可以升级到 mobilewright。
mobilecli — 通用设备 CLI,Mobile MCP 构建于其之上:通过命令行或 JSON-RPC API 控制设备、模拟器和仿真器。
Mobile Next Cloud — 同一套技术栈,按需租用:随时可用的真实 iOS 和 Android 设备。只需提示你的 Agent:log in to mobile next cloud and then show me which remote devices are available to me 即可开始。
我们正在持续改进 Mobile MCP。在 ROADMAP.md 中查看我们的下一步计划——优先级很大程度上由社区反馈决定,所以告诉我们你希望看到什么。
欢迎贡献代码、文档、bug 报告和想法。
⭐ 给仓库加星——这是帮助他人发现 Mobile MCP 最简单的方式。
阅读 CONTRIBUTING.md 了解如何构建、测试和提交 Pull Request。
浏览 open issues 寻找可以参与的工作。
问题和想法也欢迎在我们的 Slack 社区中交流。
请同时阅读我们的行为准则。
感谢每一位帮助改进这个项目的人。
Mobile MCP 在本地运行,仅与你连接的设备通信。有关数据收集、使用、保留和联系信息,请参阅 Mobile Next 隐私政策:https://mobilenext.ai/privacy