mobai-mcp

v1.2.1
io.github.MobAI-App/mobai-mcp Checked 3 days ago Published 10 months ago

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

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

list_devices

List all connected Android and iOS devices, emulators, and simulators

get_device

Get information about a specific device

ParameterTypeDescription
device_id *stringDevice ID (serial for Android, UDID for iOS)

start_bridge

Start the on-device bridge (accessibility service on Android, WebDriverAgent on iOS). Required before automation.

ParameterTypeDescription
device_id *stringDevice ID

stop_bridge

Stop the on-device bridge

ParameterTypeDescription
device_id *stringDevice ID

get_screenshot

Capture a screenshot from the device. Returns the file path to the saved PNG.

ParameterTypeDescription
device_id *stringDevice ID

get_ui_tree

Get the UI accessibility tree showing all visible elements with indices for tapping

ParameterTypeDescription
device_id *stringDevice ID
include_keyboardbooleanInclude keyboard elements in the tree (default: false). Useful for interacting with on-screen keyboards.
only_visiblebooleanFilter to only visible elements (default: true)
verbosebooleanInclude detailed elements array with bounds (default: false)

tap

Tap an element by index (from UI tree) or coordinates

ParameterTypeDescription
device_id *stringDevice ID
indexnumberElement index from UI tree (preferred)
xnumberX coordinate (use with y instead of index)
ynumberY coordinate (use with x instead of index)

type_text

Type text on the device (tap input field first to focus)

ParameterTypeDescription
device_id *stringDevice ID
text *stringText to type

swipe

Perform a swipe gesture

ParameterTypeDescription
device_id *stringDevice ID
from_x *numberStarting X coordinate
from_y *numberStarting Y coordinate
to_x *numberEnding X coordinate
to_y *numberEnding Y coordinate
duration_msnumberDuration in milliseconds (default: 300)

go_home

Navigate to device home screen

ParameterTypeDescription
device_id *stringDevice ID

launch_app

Launch an application by bundle ID

ParameterTypeDescription
bundle_id *stringApp bundle ID (e.g., com.apple.Preferences, com.android.settings)
device_id *stringDevice ID

list_apps

List installed applications on the device

ParameterTypeDescription
device_id *stringDevice ID

get_ocr

Perform OCR text recognition on the current screen (iOS only). Returns detected text with screen coordinates for tapping (already adjusted for tapping).

ParameterTypeDescription
device_id *stringDevice ID

execute_dsl

Execute a batch of automation steps using the DSL (Domain Specific Language). This is the PREFERRED method for complex automation as it's more reliable than sequential API calls. DSL supports: observe, tap, type, toggle, swipe, scroll, open_app, navigate, wait_for, assert_*, if_exists, delay, execute_js (web) Example DSL script: { "version": "0.2", "steps": [ {"action": "observe", "context": "native", "include": ["ui_tree"]}, {"action": "tap", "predicate": {"text_contains": "Settings"}}, {"action": "delay", "duration_ms": 500}, {"action": "observe", "context": "native", "…

ParameterTypeDescription
device_id *stringDevice ID
script *objectDSL script object with version, steps, and optional on_fail

run_agent

Run an AI agent to perform a task autonomously. The agent will observe the screen, make decisions, and execute actions to complete the task.

ParameterTypeDescription
device_id *stringDevice ID
task *stringTask description (e.g., 'Open Settings and enable WiFi')
agent_typestringAgent type (default: toolagent)
use_visionbooleanEnable vision/screenshots (default: from app settings)

web_list_pages

List available web pages (browser tabs and WebViews) for web automation

ParameterTypeDescription
device_id *stringDevice ID

web_navigate

Navigate to a URL in the browser

ParameterTypeDescription
device_id *stringDevice ID
url *stringURL to navigate to

web_get_dom

Get the DOM tree of the current web page

ParameterTypeDescription
device_id *stringDevice ID

web_click

Click an element in the web page using CSS selector

ParameterTypeDescription
device_id *stringDevice ID
selector *stringCSS selector (e.g., 'button.submit', '#login-btn')

web_type

Type text into a web element using CSS selector

ParameterTypeDescription
device_id *stringDevice ID
selector *stringCSS selector for the input element
text *stringText to type

web_execute_js

Execute JavaScript in the web page context

ParameterTypeDescription
device_id *stringDevice ID
script *stringJavaScript code to execute (use 'return' for results)

http_request

Make a raw HTTP request to the MobAI API. Use this for advanced operations not covered by other tools. Base URL: http://127.0.0.1:8686/api/v1 Common endpoints: - GET /devices - List devices - GET /devices/{id}/screenshot - Take screenshot - GET /devices/{id}/ui-tree - Get UI tree - POST /devices/{id}/dsl/execute - Execute DSL script - POST /devices/{id}/agent/run - Run AI agent

ParameterTypeDescription
method *stringHTTP method
url *stringFull URL or endpoint path (e.g., /devices)
bodystringRequest body as JSON string
timeout_msnumberTimeout in milliseconds (default: 600000)