Mobile Automator MCP Server
Provides tools for building, installing, uninstalling, and running unit tests on Android apps, enabling automated mobile app testing and deployment on Android emulators/devices.
Supports building Android apps via Gradle wrapper (gradlew) and running unit tests, integrating with the Android build system.
Provides tools for building, installing, uninstalling, and running unit tests on iOS apps, enabling automated mobile app testing and deployment on iOS simulators.
Enables compiling iOS apps using xcodebuild and managing simulators via simctl, integrating with the iOS development workflow.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Mobile Automator MCP Server Start a new recording session for login flow on iOS"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Mobile Automator MCP Server
An MCP server that gives AI agents the power to record, replay, and mock mobile app interactions — combining Maestro UI automation with Proxyman network capture to generate complete, self-contained test scripts.
Architecture

The system orchestrates two async data streams — UI interactions (via Maestro) and HTTP traffic (via Proxyman) — then correlates them by timestamp to produce Maestro YAML + WireMock stubs for full experience replay.
Related MCP server: Hunt-Droid Mobile MCP
Capabilities
Capability | Description |
UI Recording | Dispatch taps, types, scrolls, swipes on iOS/Android simulators via Maestro |
Network Capture | Intercept HTTP/HTTPS traffic through Proxyman with scoped, session-aware exports |
Correlation | Automatically match UI actions to the network requests they trigger (sliding time window) |
YAML Synthesis | Generate Maestro test scripts with inline network context comments |
WireMock Stubs | Produce WireMock-compatible |
Selective Mocking | Mock all, some, or all-except-some APIs — unmocked routes proxy to the real server |
SDUI Validation | Deep-compare server-driven UI payloads against expected JSON shapes |
Named Flows | Invoke hand-authored Maestro flows by name ( |
Build & Deploy | Compile, install, uninstall, and boot simulators via |
Visual Verification | Capture PNG screenshots via |
Unit Tests | Run XCTest / Gradle unit tests via |
Tools
Tool | Purpose |
| Begin recording — snapshots Proxyman baseline, initializes session state |
| Dispatch a UI action and log it to the session |
| Capture the current accessibility tree from the simulator |
| Fetch intercepted HTTP traffic (with domain/path filtering) |
| Validate a network response against expected fields |
| Finalize session → export scoped HAR → correlate → generate YAML + WireMock stubs |
| Discover named Maestro flows under |
| Execute a named flow by name, merging manifest defaults with caller-supplied params |
| Compile an iOS app ( |
| Install a built |
| Remove an installed app from a device to guarantee clean-state launches |
| Boot an iOS simulator by UDID and wait for it to be ready (Android emulator: start manually) |
| Capture a PNG of the current simulator/emulator screen; returns an absolute path Claude can read back |
| Run the unit-test target and return structured results ( |
| Async entry point for |
| Read current status, duration, and recent streamed output for a task (read-only, never throws) |
| Read the final structured result for a completed task (idempotent, does not consume) |
| Abort a running task — SIGTERMs children, runs cleanups, marks cancelled |
| Inventory of in-process tasks filtered by |
Quick Start
Prerequisites
Node.js v20+
Maestro CLI 2.5.0+ —
curl -Ls "https://get.maestro.mobile.dev" | bash(older versions log a warning at startup; 2.3.x in particular exhibits XCTest driver flakiness on iOS port 22087)Proxyman macOS 5.20+ with CLI — see Proxyman Setup
A booted iOS Simulator or Android Emulator
Install
git clone <repository>
cd mobile-automator-mcp
npm install
npm run buildOption A — HTTP Bridge (use this if the MCP client is blocked at your org)
npm run dev:httpVerify it's running:
curl http://localhost:3000/health
# {"ok":true,"tools":34}Then call any tool via JSON-RPC:
curl -X POST http://localhost:3000/message \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"list_devices","arguments":{"platform":"ios"}}}'For a full tool reference, session lifecycle patterns, and common workflows see .github/skills/generate_mcp_curls/SKILL.md.
To regenerate boilerplate curl commands for all 34 tools: npx tsx .github/skills/generate_mcp_curls/generate.ts
Phase-1 admin tools
When something looks stuck, five admin tools provide visibility and recovery without restarting the server:
audit_state— single-shot snapshot of sessions, drivers, pollers, and Proxyman rules with an orphans reportlist_active_sessions— read-only inventory with driver/poller liveness and mock countslist_active_mocks— Proxyman rules taggedmca:plus drift between Proxyman and the local ledgerforce_cleanup_session— destructive: stop poller/driver, delete tagged Proxyman rules, mark session aborted (never throws)force_cleanup_mocks— destructive bulk delete ofmca:-tagged Proxyman rules by scope (all,session,standalone)
Option B — Register with an MCP Client (once org-approved)
Add to your MCP client config (e.g., Claude Desktop, Gemini Code Assist):
{
"mcpServers": {
"mobile-automator": {
"command": "node",
"args": ["/absolute/path/to/mobile-automator-mcp/dist/index.js"]
}
}
}Selective Mocking
The stop_and_compile_test tool accepts a mockingConfig to control which APIs are mocked vs. proxied to a real backend:
full → Mock all captured APIs (default, no real server needed)
include → Mock only listed routes, proxy everything else
exclude → Mock everything EXCEPT listed routesExample — mock only login, proxy everything else:
{
"mockingConfig": {
"mode": "include",
"routes": ["/api/login"],
"proxyBaseUrl": "http://localhost:3030"
}
}Output Structure
session-<id>/
├── wiremock/
│ ├── mappings/ ← WireMock stub JSON files
│ │ ├── post_api_login.json
│ │ ├── get_api_lore_doom.json
│ │ └── _proxy_fallback.json ← (include/exclude modes only)
│ └── __files/ ← Response body fixtures
│ ├── post_api_login_response.json
│ └── get_api_lore_doom_response.json
└── manifest.json ← Session metadata + route manifestProject Structure
src/
├── index.ts ← MCP server entry point
├── handlers.ts ← Tool handler implementations
├── schemas.ts ← Zod schemas (single source of truth for I/O)
├── types.ts ← Domain models
├── session/ ← Session lifecycle + SQLite persistence
├── maestro/ ← Maestro CLI wrapper + hierarchy parser
├── proxyman/ ← Proxyman CLI wrapper + payload validator
├── flows/ ← Named, hand-authored flow registry
├── build/ ← iOS (xcodebuild/simctl) + Android (gradlew/adb) build & deploy
├── screenshot/ ← PNG capture for visual self-verification
├── testing/ ← XCTest / JUnit unit-test runner + result parsers
└── synthesis/ ← Correlator + YAML generator + WireMock stub writerNamed Flows
Hand-authored Maestro flows let an agent navigate to a specific app screen before verifying an incremental change. Flows live as .yaml files in a flows directory (default: ./flows/) and are invoked by name.
flows/
├── _manifest.json ← optional: descriptions, tags, param specs
├── login.yaml ← flow name is "login"
└── navigate-to-checkout.yaml ← flow name is "navigate-to-checkout"An optional _manifest.json declares parameters and metadata:
{
"flows": {
"login": {
"description": "Launch the app and reach the logged-in home screen",
"tags": ["auth", "setup"],
"params": {
"USERNAME": { "default": "admin", "description": "Login username" },
"PASSWORD": { "default": "admin" }
}
}
}
}Params are forwarded to Maestro as -e KEY=VALUE and referenced inside the YAML as ${KEY}. Call list_flows to discover flows, then run_flow with { name, params? } to execute one.
Build & Deploy Loop
Closes the edit → rebuild → reinstall → navigate cycle so an agent can verify changes against a fresh build.
build_app → compile with xcodebuild / ./gradlew, return built .app or .apk path
uninstall_app → wipe the prior install + its data from the target device
install_app → push the new binary to the simulator / emulator
boot_simulator→ boot an iOS simulator (idempotent; alreadyBooted=true if already running)iOS — shells xcodebuild build -scheme <scheme> -destination 'generic/platform=iOS Simulator' -derivedDataPath <path> and locates the .app under <derivedDataPath>/Build/Products/<Configuration>-iphonesimulator/. Bundle id is extracted via plutil from the built Info.plist.
Android — shells ./gradlew :<module>:assemble<Variant> from the project root and locates the APK at <project>/<module>/build/outputs/apk/<variant>/. Booting the emulator is not yet automated — start it manually (e.g., emulator -avd <name>) before calling install/run tools.
Build output is truncated (head + tail) to keep MCP responses small while preserving both the lead-up and the final error context.
Visual Verification & Unit Tests
take_screenshot writes a PNG to disk and returns its path — Claude reads the image back directly, which catches visual regressions (wrong color, clipped text, broken image) that structural hierarchy checks miss. Pair it with get_ui_hierarchy for structural assertions.
run_unit_tests runs the normal unit-test target for the project:
iOS —
xcodebuild test -resultBundlePath <path>with optional-only-testing:<Target>/<Class>[/<Method>]filters. The stdout is parsed for per-test pass/fail so totals stay accurate across Xcode versions.Android —
./gradlew :<module>:test<Variant>UnitTestwith an optional--tests <filter>. JUnit XML under<module>/build/test-results/<task>/is parsed for failure details.
Both return structured results: { passed, totalTests, passedTests, failedTests, skippedTests, failures[] }. failures[] carries the failing test name and (where available) the first-line error message plus source file/line — enough for the agent to jump straight to the offending code without grepping the full log.
The full agent workflow (build → install → navigate → screenshot → unit test → iterate) is documented in .agents/skills/agent-loop.md.
Development
npm test # Run tests
npm run test:watch # Watch mode
npm run build # Compile TypeScript
npm start # Start server (stdio)
npm run lint # ESLintLicense
MIT
Available Tools
33 toolsboot_simulatorBoot SimulatorAIdempotent
Boot an iOS simulator by UDID and wait for it to be fully ready. Idempotent — returns alreadyBooted=true if already running. Opens Simulator.app by default. Android emulator booting is not yet supported (start it manually).
Inputs: platform (required), deviceUdid (required), timeoutMs, openSimulatorApp. Returns: state, output, passed, platform, +3 more
cancel_taskCancel TaskADestructiveIdempotent
Aborts a running task: sends SIGTERM to children, runs registered cleanups in reverse order, marks the task cancelled. Idempotent and never throws.
Inputs: taskId (required), reason. Returns: taskId, notFound, cancelled, finalStatus, +2 more
clear_mock_responsesClear Mock ResponsesADestructiveIdempotent
Remove mocks installed by set_mock_response. Pass mockId to remove one; omit to clear all mocks for the session. stop_and_compile_test runs this implicitly on session end.
Inputs: no named parameters. Returns: scope, removed, remaining
execute_ui_actionExecute UI ActionA
Dispatch a UI action (tap, type, scroll, etc.) on a target element. Logs the interaction to session memory for later test synthesis. Selector priority: id > accessibilityLabel > text. Scroll/swipe are not supported during a live recording session — use start_flow for complex sequences.
Inputs: action (required), sessionId (required), element, textInput. Returns: message, success
get_network_logsGet Network LogsARead-onlyIdempotent
Retrieve intercepted HTTP/HTTPS network transactions for the session from Proxyman. Filter by URL path to isolate SDUI or analytics endpoints. Used to correlate network state with UI state.
Inputs: sessionId (required), limit, filterPath, filterDomains. Returns: total, events
get_session_timelineGet Session TimelineARead-onlyIdempotent
Get a lightweight mid-session health check showing polling stats, interaction counts, and gap analysis. Use during an active recording to verify the poller is keeping up and interactions are being captured. Only available while session status is "recording".
Inputs: sessionId (required). Returns: gaps, status, elapsedMs, sessionId, +3 more
get_task_resultGet Task ResultARead-onlyIdempotent
Returns the final structured result for a completed task. Returns error/notFound for not-yet-done or unknown tasks. Idempotent — does not consume the task.
Inputs: taskId (required). Returns: error, result, status, taskId, +2 more
get_ui_hierarchyGet UI HierarchyARead-onlyIdempotent
Capture the current UI element tree from a booted simulator. Works standalone (auto-targets the sole booted device) or within a recording session via sessionId. Returns a normalized accessibility tree with pixel bounds for point-based taps when selectors don't match. Use interactiveOnly to filter to tappable elements.
Inputs: compact, sessionId, artifactPath, interactiveOnly, +1 more. Returns: hierarchy, nodeCount, rawOutput, diagnostics, +1 more
install_appInstall AppAIdempotent
Install a built app onto a booted simulator/emulator. iOS uses xcrun simctl install; Android uses adb install -r. Returns the resolved bundle id (iOS) when available.
Inputs: appPath (required), platform (required), deviceUdid (required). Returns: output, passed, bundleId, platform, +2 more
list_devicesList DevicesARead-onlyIdempotent
List available iOS simulators and Android emulators. Filter by platform, state (Booted/Shutdown), or OS version. Use this to discover device UDIDs before calling get_ui_hierarchy.
Inputs: state, platform, osVersionContains. Returns: total, devices
list_flowsList FlowsARead-onlyIdempotent
Discover named Maestro flows in a flows directory (default: ./flows). Each flow is a .yaml file; an optional _manifest.json adds descriptions, tags, and parameter specs. Use start_flow to execute one by name.
Inputs: flowsDir. Returns: flows, total, flowsDir
list_tasksList TasksARead-onlyIdempotent
Lists tasks in the registry, optionally filtered by kind/status. Useful for orphan recovery alongside list_active_sessions.
Inputs: kind, since, status. Returns: tasks, totalTasks
poll_task_statusPoll Task StatusARead-onlyIdempotent
Returns current status, duration, and the recent tail of streamed output for a task. Cheap; safe to call frequently. Returns notFound:true for unknown or pruned task IDs (never throws).
Inputs: taskId (required), tailLines. Returns: kind, error, status, taskId, +7 more
register_segmentRegister SegmentAIdempotent
Register a recorded session as a named, reusable flow segment. Computes a fingerprint from the correlated steps and saves it to the segment registry for future deduplication.
Inputs: name (required), sessionId (required), registryPath. Returns: name, message, fingerprint, registryPath
run_feature_testRun Feature TestA
Execute a declarative feature test in ONE tool call: setup flows → start recording → UI actions → network assertions → stop & compile → teardown. Replaces 8–15 AI-orchestrated tool calls per run with a single deterministic lifecycle. Accepts an inline FeatureTestSpec or a path to a .yaml/.json spec file.
Inputs: spec (required), env, flowsDir, platform, +5 more. Returns: name, error, mocks, setup, +5 more
run_unit_testsRun Unit TestsAIdempotent
Run the unit-test target for the project. Returns structured results: pass/fail counts, failing test names, first-line failure messages. Long-running — default timeout 30 minutes.
Inputs: platform (required), module, scheme, variant, +9 more. Returns: output, passed, failures, platform, +7 more
set_mock_responseSet Mock ResponseA
Install a live response-mocking rule via Proxyman. Two modes: staticResponse (return a verbatim payload — feature flags, fixtures) and responseTransform.jsonPatch (proxy to the real backend then mutate the response body in flight — e.g. the loginStatus override pattern). Session-scoped mocks auto-clean on stop_and_compile_test; standalone mocks persist until explicitly cleared. Requires Proxyman running with MCP enabled.
Inputs: mock (required), sessionId. Returns: scope, mockId, ruleName, proxymanRuleId, +2 more
start_buildStart Build (Async)A
Compile an iOS or Android app from source (xcodebuild or gradlew). Returns a taskId immediately; poll via poll_task_status, get final .app/.apk path + bundleId via get_task_result. Default timeout 15 min.
Inputs: platform (required), module, scheme, variant, +6 more. Returns: kind, status, taskId, startedAt
start_flowStart Flow (Async)A
Execute a named Maestro flow (resolves /.yaml and merges manifest param defaults with caller params). Use to navigate to the area of an incremental change before verifying it. Returns a taskId; poll_task_status streams output, get_task_result returns final pass/fail. With MCA_FLOW_PAUSE_RESUME=on, pauses any active recording for the run and auto-resumes; otherwise errors if a session is active. cancel_task interrupts mid-flow.
Inputs: name (required), params, flowsDir, platform, +4 more. Returns: kind, status, taskId, startedAt
start_recording_sessionStart Recording SessionA
Begin recording a mobile interaction session. Initializes session memory, monitors the UI hierarchy, and starts capturing network events. Returns a session ID to use with subsequent tool calls. During the session, drive the app via execute_ui_action (single steps) or start_flow (stored Maestro yaml). Both update the recording timeline.
Inputs: platform (required), appBundleId (required), timeouts, captureMode, +5 more. Returns: message, readiness, sessionId
start_testStart Test (Async)A
Run a Maestro YAML test file with optional WireMock stub replay. Replays a static script against a booted simulator — does NOT record new network traffic. Returns a taskId; poll_task_status streams live output, get_task_result returns final pass/fail. With MCA_FLOW_PAUSE_RESUME=on, pauses any active recording for the run and auto-resumes; otherwise errors if a session is active. cancel_task interrupts mid-flow.
Inputs: yamlPath (required), env, platform, stubsDir, +4 more. Returns: kind, status, taskId, startedAt
stop_and_compile_testStop and Compile TestAIdempotent
Stop the active recording session and synthesize a Maestro YAML test script. Correlates captured UI interactions with network payloads and embeds JavaScript assertions for analytics events.
Inputs: sessionId (required), conditions, outputPath, mockingConfig. Returns: yaml, stubsDir, yamlPath, sessionId, +7 more
take_screenshotTake ScreenshotARead-only
Capture a PNG of the current simulator/emulator screen; returns an absolute path the agent can read back. Auto-retries on transient failures; returns passed:false on terminal failure instead of throwing.
Inputs: platform (required), deviceUdid (required), timeoutMs, outputPath. Returns: output, passed, platform, imagePath, +3 more
uninstall_appUninstall AppADestructiveIdempotent
Remove an installed app from a booted simulator/emulator, wiping its storage. Use before install_app to guarantee a clean-state launch. iOS: xcrun simctl uninstall; Android: adb uninstall.
Inputs: bundleId (required), platform (required), deviceUdid (required). Returns: output, passed, bundleId, platform, +2 more
verify_network_absentVerify Network AbsentARead-onlyIdempotent
Assert that a list of forbidden network calls do NOT fire within withinMs of a referenced UI action. Use to verify cache hits or absence of unnecessary prefetching.
Inputs: sessionId (required), afterAction (required), forbiddenCalls (required), withinMs, +1 more. Returns: passed, verdict, violations, anchorTimestamp
verify_network_deduplicationVerify Network DeduplicationBRead-onlyIdempotent
Assert that requests are not duplicated beyond a threshold. Groups by URL or extracted GraphQL operationName; flags groups exceeding maxDuplicates.
Inputs: sessionId (required), groupBy, matcher, withinMs, +3 more. Returns: passed, verdict, duplicates
verify_network_error_handlingVerify Network Error HandlingARead-onlyIdempotent
Assert that specific error responses appear in the session. Pair with WireMock stubs to verify the app behaves correctly under injected failures.
Inputs: sessionId (required), expectedErrors (required), withinMs, afterAction, +1 more. Returns: passed, verdict, errorsFound, missingErrors
verify_network_on_screenVerify Network On ScreenARead-onlyIdempotent
Assert that a list of expected network calls all fire within withinMs of a referenced UI action. Use to verify that navigating to a screen triggers the right API calls.
Inputs: sessionId (required), afterAction (required), expectedCalls (required), withinMs, +1 more. Returns: extras, passed, matched, missing, +2 more
verify_network_parallelismVerify Network ParallelismARead-onlyIdempotent
Assert that a set of matching network requests all start within a given time window (e.g., SDUI queries firing in parallel). Fails if fewer than minExpectedCount match or the total span exceeds maxWindowMs.
Inputs: matcher (required), sessionId (required), maxWindowMs (required), minExpectedCount (required), +1 more. Returns: count, events, passed, verdict, +2 more
verify_network_payloadVerify Network PayloadARead-onlyIdempotent
Assert JSON response fields via dot/bracket paths: equals, contains, exists, type, minLength. More flexible than verify_sdui_payload, which only supports exact field matching.
Inputs: sessionId (required), responseAssertions (required), url, matcher, +1 more. Returns: event, passed, verdict, mismatches
verify_network_performanceVerify Network PerformanceARead-onlyIdempotent
Assert latency budgets: max per-request durationMs and/or max total first-start→last-end across a matcher. Reports p50/p95 stats and excludes events with unknown durations from percentiles.
Inputs: matcher (required), sessionId (required), withinMs, maxTotalMs, +3 more. Returns: p50, p95, count, passed, +6 more
verify_network_sequenceVerify Network SequenceARead-onlyIdempotent
Assert that a set of network calls happened in a specific chronological order. Strict mode fails if any unmatched event appears between ordered matches.
Inputs: sessionId (required), expectedOrder (required), strict, matcher, +3 more. Returns: passed, missing, verdict, actualOrder, +1 more
verify_sdui_payloadVerify SDUI PayloadARead-onlyIdempotent
Validate that a specific SDUI network response matches expected fields. Returns matched status and a list of any mismatches. Used to assert correct server-driven content is rendered by the UI.
Inputs: url (required), sessionId (required), filterDomains, expectedFields. Returns: actual, matched, mismatches
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 33 tools
Most tools have clearly distinct purposes, but the many verify_network_* variants (absent, deduplication, error_handling, on_screen, parallelism, payload, performance, sequence) could cause confusion for an agent if descriptions are not read carefully. Also, start_flow and start_test are similar but serve different functions. Overall, well-disambiguated with minor overlap.
Naming is inconsistent: some tools use snake_case (boot_simulator, cancel_task), while others use camelCase (execute_ui_action, get_ui_hierarchy, get_network_logs). Additionally, verbs are not uniformly placed (e.g., list_devices vs. get_ui_hierarchy). This lack of pattern makes the set harder to navigate.
With 33 tools, the set is too large for easy comprehension. The server covers a broad domain (device management, UI interaction, network mocking, verification), but the number exceeds the recommended range (3-15) and violates the 'too many' threshold (25+). Some tools like the many verify_network_* variants could be consolidated.
The tool set is comprehensive for mobile automation: device management (boot, list, install, uninstall), UI inspection and interaction (get_ui_hierarchy, execute_ui_action), recording and playback (start_recording_session, stop_and_compile_test, start_flow, start_test), network mocking and verification (set_mock_response, all verify_network_* tools), and task management. No obvious gaps for the stated purpose.
Maintenance
Related MCP Connectors
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
MCP server for building and testing AI agents with multi-model experimentation and insights.
MCP server that lets your AI assistant build and deploy apps, hosting each one at a live URL.
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceAn MCP server that lets AI agents control iOS and Android devices (tap, scroll, type, take screenshots, read UI trees, and run code). Works with multiple devices at the same time.94 npm54MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that enables AI agents to drive real Android apps, capture API traffic, and test mobile-native attack surfaces, similar to Playwright for mobile.MIT
- AlicenseBqualityDmaintenanceAn MCP server that lets AI agents see, tap, type, scroll, and assert inside live Flutter apps — no pre-written tests required.2818 npmMIT
- FlicenseNot gradedqualityCmaintenanceAn MCP server that lets AI agents drive real mobile-app automation on connected devices, enabling natural-language test tasks, test case generation, and app/build management for Android and iOS.-