# Mobile Device MCP

Gives your agent hands on a phone: taps, scrolling, typing, screenshots and UI tree reads across several devices at once.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 52
- Author: srmorete
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/srmorete/mobile-device-mcp
- Updated: 2026-08-02
- HTML: https://affpapa.org/en/nevibecode/mcp/mobile-device-mcp

## What it does

The server runs a small HTTP driver on each device — UIAutomator on Android, XCUITest on iOS — and forwards tool calls to it. Raw UI trees from both platforms get normalised into one flat element list, so the agent never deals with platform differences. A device is prepared on first use: the driver app is installed, a port is picked, the on-device server starts and gets polled until healthy. From then on traffic stays on localhost, with a bearer token per device.

The tool set covers a normal session: `list_devices`, `screenshot`, `uitree`, `tap`, `double_tap`, `long_press`, `scroll`, `type_text`, `press_button`, `launch_app`, `terminate_app`, `list_apps`, `install_app` and `run_code`. That last one executes JavaScript in a sandbox — Rhino with UIAutomator bindings on Android, JavaScriptCore with XCUITest bindings on iOS. Runaway scripts get killed, and every call starts from a fresh sandbox.

Node.js 18+ is required. Android needs the Android SDK with `adb` on `PATH`; without it no device shows up. iOS simulators need Xcode with `xcrun` and `simctl`, real devices also `xcodebuild`, `devicectl` and `iproxy` from libimobiledevice. Default ports are 18000 for Android and 19000 for iOS, handed out in sequence — override them with `MDMS_PORT_ANDROID` and `MDMS_PORT_IOS` if those are taken.

## Requirements
- Needs: Node.js (commands run via npx)

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add mobile-device-mcp -- npx -y @srmorete/mobile-device-mcp
```

### Codex

**Platform CLI**
```bash
codex mcp add mobile-device-mcp -- npx -y @srmorete/mobile-device-mcp
```

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "mobile-device-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "@srmorete/mobile-device-mcp"
            ]
        }
    }
}
```

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "mobile-device-mcp": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "@srmorete/mobile-device-mcp"
            ]
        }
    }
}
```

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add mobile-device-mcp npx -y @srmorete/mobile-device-mcp
```

## When to use it
- walk an app through its screens on a real handset
- grab a screenshot plus the element list to debug layout
- type and press buttons without driving the emulator by hand
- install an `.apk` or `.app` and launch it from the agent
- check behaviour on several devices in one run

## Example prompts
- List the connected devices and take a screenshot of the first Android one
- Find the login button in `uitree` and tap it
- Launch the app by package name and type into the search field

## Similar
- [mobile-mcp](https://affpapa.org/en/nevibecode/mcp/mobile-mcp.md) — MCP server · ★ 9946
- [mobilerun](https://affpapa.org/en/nevibecode/mcp/mobilerun.md) — MCP server · ★ 9751
- [e2e](https://affpapa.org/en/nevibecode/mcp/e2e.md) — MCP server · ★ 11912
- [XcodeBuildMCP](https://affpapa.org/en/nevibecode/mcp/xcodebuildmcp.md) — MCP server · ★ 6505
- [ShipSwift](https://affpapa.org/en/nevibecode/mcp/shipswift.md) — MCP server · ★ 3244
- [agent-device](https://affpapa.org/en/nevibecode/mcp/agent-device.md) — MCP server · ★ 5149

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
