Mobile Device MCP
Allows controlling Android devices through UIAutomator, enabling actions like tap, scroll, type text, press hardware buttons, launch/terminate apps, and run sandboxed JavaScript code on the device.
Allows controlling iOS devices through XCUITest, enabling actions like tap, scroll, type text, press hardware buttons, launch/terminate apps, and run sandboxed JavaScript code on the device.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Mobile Device MCP
An 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.
How It Works
Three-layer architecture:
On-device servers — Lightweight HTTP servers running on each mobile device (UIAutomator on Android, XCUITest on iOS) that expose the accessibility tree and accept interaction commands.
UI tree filter — Normalizes raw UI trees from both platforms into a unified flat element list.
MCP server — The external interface. Handles device discovery, bootstrapping, port allocation, and proxies requests to on-device servers.
Devices are bootstrapped on first use — the server installs the driver app, allocates a port, starts the on-device server, and polls until it's healthy. After that, all tool calls are proxied over localhost HTTP with per-device bearer token auth.
Related MCP server: androir-mcp
Tools
Tool | Description |
| List available iOS and Android devices |
| Capture the device screen (JPEG) |
| Get the UI element tree as a flat list, with optional search and limit. Off-screen elements are excluded unless |
| Tap at screen coordinates |
| Double-tap at screen coordinates |
| Long-press at screen coordinates (configurable duration) |
| Swipe from start to end coordinates |
| Type text into the focused element |
| Press a hardware/navigation button (home, back, enter, volumeUp/Down, dpadUp/Down/Left/Right/Center) |
| Launch an app by bundle ID / package name |
| Force-stop an app |
| List installed apps |
| Install an app from a host-local file ( |
| Execute sandboxed JavaScript on-device (see run_code below) |
run_code
Agents can pass code that looks like UIAutomator or XCUITest, both being Javascript under the hood. The sandbox restricts (Android) potentially dangerous Java operations and only allows (iOS) some XCUITest-ish commands
Android: Rhino engine with UIAutomator bindings —
uiDevice(click, swipe, find elements, press keys, read display info),By(selectors),Until(wait conditions),console.log()iOS: JavaScriptCore with XCUITest bindings —
app(query elements, tap, type, swipe),springboard,device,openApp(bundleId),sleep(ms),console.log()
Both platforms automatically kill runaway scripts (infinite loops) and create a fresh sandbox per call.
Prerequisites
Node.js 18+ (for running via
npx)Android: Android SDK with
adbon PATHiOS Simulator: Xcode with
xcrun,simctliOS Real Device: Xcode with
xcodebuild,devicectl, andiproxy(from libimobiledevice)Building from source: Bun runtime, Gradle (Android), Xcode (iOS)
Installation
Claude Code
claude mcp add mobile-device-mcp -- npx -y @srmorete/mobile-device-mcp@latestOr with custom ports:
claude mcp add mobile-device-mcp -e MDMS_PORT_ANDROID=20000 -e MDMS_PORT_IOS=21000 -- npx -y @srmorete/mobile-device-mcp@latestModifying .mcp.json (Cursor, Claude Desktop, etc)
{
"mcpServers": {
"mobile-device-mcp": {
"command": "npx",
"args": ["-y", "@srmorete/mobile-device-mcp@latest"],
"env": {
"MDMS_PORT_ANDROID": "18000", # optional
"MDMS_PORT_IOS": "19000" # optional
}
}
}
}Building from Source
git clone <repo-url>
cd mobile-device-mcp
bun install
# Build drivers for both platforms and pack tarball
./scripts/build.shThe build script compiles the on-device drivers (Android APKs via Gradle, iOS test bundle via xcodebuild), copies them to drivers/, and creates an npm tarball.
To run locally during development:
bun run start # Start the MCP server
bun test # Run the test suiteConfiguration
Environment Variable | Default | Description |
| 18000 | Base port for Android on-device servers |
| 19000 | Base port for iOS on-device servers |
Ports are assigned sequentially — first Android device gets 18000, second gets 18001, and so on. Same for iOS starting at 19000.
Acknowledgements
Mobile Device MCP server stands on the shoulders of giants such as mobile-mcp and Maestro. Used as inspiration but reframed the current approach to be multi-device and with seamless Native/WebView support (especially on Android).
License
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
Make games with AI: one MCP server that connects your agent to Unity, Unreal and Godot editors.
Official MCP server for Agentwork — delegate tasks to AI agents with human-in-the-loop
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.
Related MCP Servers
- AlicenseAqualityBmaintenanceMCP server that gives AI agents full vision and control over Android devices via ADB and scrcpy. Supports screenshots, input, apps, UI automation, shell, files, and clipboard.38374 npm131MIT
- AlicenseBqualityDmaintenanceAn MCP server that allows AI agents to drive real Android devices via adb, capturing screenshots, reading the live UI tree, and performing actions like tap, swipe, and type.135 npm1Apache 2.0
- AlicenseAqualityDmaintenanceAn MCP server that gives AI agents full control of Android devices and emulators through plain ADB — no companion APK, no extra daemon, no telemetry.2612 npm12MIT
- AlicenseNot gradedqualityAmaintenanceAn MCP server that enables AI agents to control Android and iOS devices via natural language, using platform tools like adb and simctl.3,040 npm55Apache 2.0