io.github.MobAI-App/mobai-mcp

编码与调试

by mobai-app

由 AI 驱动的移动设备自动化工具,支持 Android、iOS 设备以及 emulators 和 simulators。

什么是 io.github.MobAI-App/mobai-mcp

由 AI 驱动的移动设备自动化工具,支持 Android、iOS 设备以及 emulators 和 simulators。

README

MobAI MCP Server

npm version License

MCP (Model Context Protocol) server for MobAI — AI-powered mobile device automation. Lets AI assistants (Claude Code, Cursor, Windsurf, Cline, and other MCP-compatible tools) control Android and iOS devices, emulators, and simulators via a single DSL-first interface.

How it works

All device interaction is batched through one primary tool: execute_dsl. Instead of exposing dozens of fine-grained tools (tap, swipe, type…), the server accepts a JSON script describing a sequence of actions with predicates, assertions, waits, and conditional branches. This keeps round-trips low and encodes retry/failure strategies server-side.

A small set of companion tools handles device discovery, screenshots, app management, and running .mob test files.

Prerequisites

  • Node.js 18+
  • MobAI desktop app running locally (HTTP API on 127.0.0.1:8686)
  • A connected Android or iOS device, emulator, or simulator

Installation

Claude Code

bash
claude mcp add mobai -- npx -y mobai-mcp

Cursor

Add to .cursor/mcp.json:

json
{
  "mcpServers": {
    "mobai": {
      "command": "npx",
      "args": ["-y", "mobai-mcp"]
    }
  }
}

Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS):

json
{
  "mcpServers": {
    "mobai": {
      "command": "npx",
      "args": ["-y", "mobai-mcp"]
    }
  }
}

Windsurf / Cline / other MCP clients

The server speaks stdio — use your client's generic MCP configuration:

json
{
  "command": "npx",
  "args": ["-y", "mobai-mcp"]
}

Tools

Device management

ToolDescription
list_devicesList all connected Android and iOS devices
get_deviceGet details about a specific device
start_bridgeStart the automation bridge on a device (required before interaction)
stop_bridgeStop the automation bridge

Screenshots

ToolDescription
get_screenshotFast, low-quality screenshot for LLM visual analysis (may be downscaled; response includes scale factor)
save_screenshotFull-quality PNG to disk for reporting, debugging, or sharing

Apps

ToolDescription
list_appsList installed apps on the device
install_appInstall an .apk or .ipa from a local file path
uninstall_appUninstall an app by bundle ID / package name
debug_appLaunch an app in debug mode and write stdout/stderr to a log file

Automation

ToolDescription
execute_dslPrimary tool. Execute a batch of DSL steps: tap, type, swipe, observe, assertions, web automation, metrics, screen recording, and more.

Test management

Tests are .mob files on disk inside project directories. You read, write, and edit them directly using your assistant's filesystem tools — MobAI watches for changes and updates the UI live. MCP is only needed to discover projects and run tests.

ToolDescription
test_get_activeGet the active test project directory and its .mob cases
test_list_projectsList all known test project directories with their .mob cases
test_runRun a .mob test case on a device (project_dir + case_path + device_id, optional params for ${name} substitution)

Resources

Read these before attempting any device interaction — they describe the DSL schema, action set, predicates, failure strategies, and .mob syntax.

URIPurpose
mobai://reference/device-automationHow to control devices — guide, all DSL actions, predicates, and failure strategies
mobai://reference/testingTesting workflow, rules, error fixes, and .mob script syntax

Example

Open the iOS Settings app, navigate to Wi-Fi, and verify the toggle exists:

json
{
  "version": "0.2",
  "steps": [
    {"action": "open_app", "bundle_id": "com.apple.Preferences"},
    {"action": "wait_for", "predicate": {"text": "Settings"}, "timeout_ms": 3000},
    {"action": "tap", "predicate": {"text_contains": "Wi-Fi"}},
    {"action": "wait_for", "predicate": {"type": "switch"}, "timeout_ms": 3000},
    {"action": "assert_exists", "predicate": {"type": "switch"}},
    {"action": "observe", "include": ["ui_tree"]}
  ]
}

Pass this as the commands argument (a JSON string) to execute_dsl along with a device_id from list_devices.

Troubleshooting

"Connection refused" — Make sure the MobAI desktop app is running and the API is reachable at http://127.0.0.1:8686.

"Bridge not running" — Call start_bridge first. The iOS bridge can take up to a minute to come up.

Screenshots not visibleget_screenshot saves to /tmp/mobai/screenshots/ by default and returns the file path. Use your assistant's file-reading capability to view them. DSL observe screenshots are extracted from the response and saved to the same directory.

Development

bash
git clone https://github.com/MobAI-App/mobai-mcp.git
cd mobai-mcp
npm install
npm run build
node dist/index.js

License

Apache 2.0 — see LICENSE.

常见问题

io.github.MobAI-App/mobai-mcp 是什么?

由 AI 驱动的移动设备自动化工具,支持 Android、iOS 设备以及 emulators 和 simulators。

相关 Skills

前端设计

by anthropics

Universal
热门

面向组件、页面、海报和 Web 应用开发,按鲜明视觉方向生成可直接落地的前端代码与高质感 UI,适合做 landing page、Dashboard 或美化现有界面,避开千篇一律的 AI 审美。

想把页面做得既能上线又有设计感,就用前端设计:组件到整站都能产出,难得的是能避开千篇一律的 AI 味。

编码与调试
未扫描148.2k

网页应用测试

by anthropics

Universal
热门

用 Playwright 为本地 Web 应用编写自动化测试,支持启动开发服务器、校验前端交互、排查 UI 异常、抓取截图与浏览器日志,适合调试动态页面和回归验证。

借助 Playwright 一站式验证本地 Web 应用前端功能,调 UI 时还能同步查看日志和截图,定位问题更快。

编码与调试
未扫描148.2k

网页构建器

by anthropics

Universal
热门

面向复杂 claude.ai HTML artifact 开发,快速初始化 React + Tailwind CSS + shadcn/ui 项目并打包为单文件 HTML,适合需要状态管理、路由或多组件交互的页面。

在 claude.ai 里做复杂网页 Artifact 很省心,多组件、状态和路由都能顺手搭起来,React、Tailwind 与 shadcn/ui 组合效率高、成品也更精致。

编码与调试
未扫描148.2k

相关 MCP Server

GitHub

编辑精选

by GitHub

热门

GitHub 是 MCP 官方参考服务器,让 Claude 直接读写你的代码仓库和 Issues。

这个参考服务器解决了开发者想让 AI 安全访问 GitHub 数据的问题,适合需要自动化代码审查或 Issue 管理的团队。但注意它只是参考实现,生产环境得自己加固安全。

编码与调试
86.6k

by Context7

热门

Context7 是实时拉取最新文档和代码示例的智能助手,让你告别过时资料。

它能解决开发者查找文档时信息滞后的问题,特别适合快速上手新库或跟进更新。不过,依赖外部源可能导致偶尔的数据延迟,建议结合官方文档使用。

编码与调试
57.0k

by tldraw

热门

tldraw 是让 AI 助手直接在无限画布上绘图和协作的 MCP 服务器。

这解决了 AI 只能输出文本、无法视觉化协作的痛点——想象让 Claude 帮你画流程图或白板讨论。最适合需要快速原型设计或头脑风暴的开发者。不过,目前它只是个基础连接器,你得自己搭建画布应用才能发挥全部潜力。

编码与调试
47.7k

评论