Mobai Mcp

io.github.MobAI-App由 GitHub 账号 MobAI-App 发布v1.2.1更新于 Oct 24, 2026

AI-powered mobile device automation for Android and iOS devices, emulators, and simulators

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

概览

AI 生成的概览

让 AI 助手通过批量 DSL 脚本操控 Android 与 iOS 设备、模拟器和仿真器,并提供截图、应用管理和测试运行能力的 MCP 服务器。

可以做什么
  • 发现、占用和释放设备,启动或停止自动化桥接
  • 获取供模型视觉分析的快速低清截图,或把全质量 PNG 保存到磁盘
  • 列出、安装、卸载应用,并以调试模式启动应用并写日志
  • 执行批量 DSL 脚本,涵盖点击、输入、滑动、等待、断言、网页自动化、指标采集和录屏
  • 列出测试项目并在指定设备上运行 .mob 测试用例
适用场景
适合需要助手亲手操作真实或模拟移动应用的场景,例如探索流程、复现缺陷、检查界面状态或运行已有的 .mob 测试用例。主要面向已连接设备的本地桌面环境。
运行要求
需要 Node.js 18 及以上、在本机运行的 MobAI 桌面应用(HTTP API 位于 127.0.0.1:8686),以及已连接的 Android 或 iOS 设备、模拟器或仿真器。通过 npx mobai-mcp 以 stdio 方式安装,未声明任何 API 密钥或环境变量。
安装前请注意
助手会实际操作设备:安装和卸载应用、点击输入、运行测试,都会改变设备状态。设备租约按会话持有,对未占用设备执行操作会自动占用。截图和调试日志会写入本地磁盘,服务器还会访问本机 8686 端口的桌面应用。

安装

在 SourceWeft 中

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

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

其他 MCP 客户端

参照 仓库 中的启动说明。

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
claim_deviceClaim exclusive use of a device for this session (usually optional: acting on an unclaimed device auto-claims it)
release_deviceRelease one or all device leases held by this session

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" / "Could not reach the MobAI desktop app" — Make sure the MobAI desktop app is installed and running, and the API is reachable at http://127.0.0.1:8686. If you don't have it yet, download and install it from https://mobai.run/download.

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

Screenshots not visible — get_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.gitcd mobai-mcpnpm installnpm run buildnode dist/index.js

License

Apache 2.0 — see LICENSE.

来源:README.md,提交 75348bb

工具

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

版本历史

1
  1. v1.2.1最新Sep 16, 2026

评分

已满足适用检查项的 50%

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

  • 近 30 天内可连通25 分

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

  • 已声明认证方式10 分

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

  • 已列出工具15 分

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

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