MA

mobai-app/mobai-mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

256 stars 22 forks 质量 88 趋势 20Apache-2.0

mobai-app/mobai-mcp 是从 https://github.com/mobai-app/mobai-mcp. 导入的 MCP 服务器候选。

概览

mobai-app/mobai-mcp 是从 https://github.com/mobai-app/mobai-mcp. 导入的 MCP 服务器候选。

概述(AI 翻译)

MobAI 的 MCP(模型上下文协议)服务器——AI 驱动的移动设备自动化。让 AI 助手(Claude Code、Cursor、Windsurf、Cline 及其他兼容 MCP 的工具)通过单一 DSL 优先接口控制 Android 和 iOS 设备、模拟器和模拟器。

它是如何运作的

所有设备交互都通过一个主要工具批处理:execute_dsl。服务器不再暴露数十个细粒度工具(点击、滑动、输入等),而是接受一个 JSON 脚本,描述带有谓词、断言、等待和条件分支的一系列动作。这样可以保持低往返次数,并在服务器端编码重试/失败策略。

还有一小部分配套工具处理设备发现、截图、应用管理和运行.mob测试文件。

先修条件

  • Node.js 18+
  • 本地运行的 MobAI 桌面应用(HTTP API 在 127.0.0.1:8686)
  • 连接的安卓或iOS设备、模拟器或模拟器

安装

克劳德·科德

光标

加到.cursor/mcp.json:

克劳德桌面

添加到 ~/Library/Application Support/Claude/claude_desktop_config.json(macOS):

风帆冲浪 / 克莱恩 / 其他MCP客户

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

MobAI MCP Server

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

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

Cursor

Add to .cursor/mcp.json:

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

Claude Desktop

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

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

Windsurf / Cline / other MCP clients

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

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

Tools

Device management

Tool Description
list_devices List all connected Android and iOS devices
get_device Get details about a specific device
start_bridge Start the automation bridge on a device (required before interaction)
stop_bridge Stop the automation bridge
claim_device Claim exclusive use of a device for this session (usually optional: acting on an unclaimed device auto-claims it)
release_device Release one or all device leases held by this session

Screenshots

Tool Description
get_screenshot Fast, low-quality screenshot for LLM visual analysis (may be downscaled; response includes scale factor)
save_screenshot Full-quality PNG to disk for reporting, debugging, or sharing

Apps

Tool Description
list_apps List installed apps on the device
install_app Install an .apk or .ipa from a local file path
uninstall_app Uninstall an app by bundle ID / package name
debug_app Launch an app in debug mode and write stdout/stderr to a log file

Automation

在 GitHub 查看完整 README

安装

npx -y mobai-mcp
新手?先看 mcpskill.org 教程 →

配置

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