Labsco
MobAI-App logo

MobAI MCP

โ˜… 225

from MobAI-App

MCP (Model Context Protocol) server for MobAI (https://mobai.run) - AI-powered mobile device automation

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedFreeQuick setup

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.

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:

Copy & paste โ€” that's it
{
  "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.

Development

Copy & paste โ€” that's it
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.