Mobile MCP Server for iOS and Android Automation
Automate iOS and Android testing with an MCP server for app scraping, development, and control of physical devices or simulators/emulators.
npx -y @mobile-next/mobile-mcpOverview
Mobile MCP Server is a lightweight server that exposes a consistent HTTP/WebSocket API for automating, scraping, and controlling iOS and Android devices — both physical hardware and simulators/emulators. It is designed as a central bridge between test frameworks or automation clients and platform-specific tooling (ADB, simctl, XCTest/WebDriverAgent), providing a unified, scriptable interface for device management, UI hierarchy inspection, input injection, screenshots, and app lifecycle actions.
This server is useful when you need to run cross-platform mobile tests, collect UI metadata at scale, orchestrate device fleets, or drive manual/automated interactions from remote clients. By centralizing device-facing operations behind a protocol-compatible server, teams can build reproducible automation pipelines, attach different frontends or AI agents, and integrate with CI/CD systems without dealing with platform differences directly.
Features
- Unified API for iOS and Android devices (physical and simulators/emulators)
- Device discovery and metadata (model, OS version, status)
- App management: install, uninstall, launch, terminate, and query installed packages
- UI inspection and scraping: hierarchical view dumps and element attributes
- Input injection: tap, swipe, text entry, key events
- Screenshots and screen recording endpoints
- Session and concurrency management for parallel testing
- File transfer to/from device (push/pull)
- Logging, telemetry, and basic access control (token authentication)
- Works with ADB, simctl, XCTest/WebDriverAgent (platform adapters)
Installation / Configuration
Clone the repository and run with Docker (recommended for quick start):
# Clone the repo
# Run the official Docker image
Run from source (example workflow — exact build steps depend on language/runtime):
# After cloning
# Install dependencies (node/python/go as applicable)
# for Node:
# Build / start
Important environment variables and configuration options:
- MCP_PORT (default: 8765) — HTTP port to listen on
- MCP_AUTH_TOKEN — simple bearer token for API access
- ANDROID_SDK_ROOT — path to Android SDK (required for ADB/emulator)
- XCODE_DEVELOPER_DIR — path to Xcode tools when interacting with iOS
- DEVICE_CONCURRENCY — max simultaneous sessions per server
- LOG_LEVEL — debug/info/warn/error
Platform prerequisites:
- Android: Android SDK, ADB on PATH; enable USB debugging on devices
- iOS: Xcode + command line tools; proper device provisioning for physical devices; simctl for simulators
Available Resources
The server exposes a set of HTTP and WebSocket endpoints for automation clients. Common resource endpoints include:
| Resource | Purpose |
|---|---|
| /devices | List connected devices / simulators and their statuses |
| /sessions | Create/inspect/terminate automation sessions |
| /apps | Install/uninstall/list packages on a device |
| /ui/hierarchy | Obtain UI tree / element attributes for scraping |
| /input | Inject taps, swipes, text input, key events |
| /screenshot | Capture a current screen image (PNG) |
| /files | Push and pull files to/from device storage |
| /logs | Fetch device or automation logs |
Client libraries or example scripts (in the repository) demonstrate how to call these endpoints from Node/Python/CLI. Use the GitHub repo for code samples and OpenAPI/JSON schema (if provided).
GitHub: https://github.com/mobile-next/mobile-mcp
Use Cases
End-to-end testing across platforms
- Start multiple sessions against different devices, run deterministic UI actions, and assert results. Example:
# create a session (pseudo-curl)App scraping for QA and accessibility
- Obtain a UI hierarchy dump to analyze element labels, accessibility ids, and properties for automated accessibility checks:
Visual regression and screenshots
- Capture screenshots from multiple device configurations and compare against gold images:
Device farm orchestration
- Combine MCP instances to manage a pool of devices. Use /devices to balance tests, install apps remotely, and collect logs for CI failure triage.
Remote debugging and replay
- Record interaction sequences from a client