npm @srmorete/mobile-device-mcpstdioMITupdated 1mo ago
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.
Mobile Device MCP で何ができる?
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.
Tools
| Tool | Description |
|---|---|
list_devices |
List available iOS and Android devices |
screenshot |
Capture the device screen (JPEG) |
uitree |
Get the UI element tree as a flat list, with optional search and limit. Off-screen elements are excluded unless include_invisible: true |
tap |
Tap at screen coordinates |
double_tap |
Double-tap at screen coordinates |
long_press |
Long-press at screen coordinates (configurable duration) |
scroll |
Swipe from start to end coordinates |
type_text |
Type text into the focused element |
press_button |
Press a hardware/navigation button (home, back, enter, volumeUp/Down, dpadUp/Down/Left/Right/Center) |
launch_app |
Launch an app by bundle ID / package name |
terminate_app |
Force-stop an app |
list_apps |
List installed apps |
install_app |
Install an app from a host-local file (.apk for Android, .app for iOS simulator, .app/.ipa for iOS device). Replaces existing installs |
run_code |
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 PATH - iOS Simulator: Xcode with
xcrun,simctl - iOS 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@latest
Or 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@latest
Modifying .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.sh
The 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 suite
Configuration
| Environment Variable | Default | Description |
|---|---|---|
MDMS_PORT_ANDROID |
18000 | Base port for Android on-device servers |
MDMS_PORT_IOS |
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
インストール
Mobile Device MCP をクライアントに追加します。お使いのものを選んでください。
claude mcp add mobile-device-mcp -- npx -y @srmorete/mobile-device-mcpcodex mcp add mobile-device-mcp -- npx -y @srmorete/mobile-device-mcpamp mcp add mobile-device-mcp -- npx -y @srmorete/mobile-device-mcp{
"mcpServers": {
"mobile-device-mcp": {
"command": "npx",
"args": [
"-y",
"@srmorete/mobile-device-mcp"
]
}
}
}Add to `claude_desktop_config.json`, then restart Claude Desktop.
{
"mcpServers": {
"mobile-device-mcp": {
"command": "npx",
"args": [
"-y",
"@srmorete/mobile-device-mcp"
]
}
}
}Add to `~/.cursor/mcp.json`, or `.cursor/mcp.json` for a single project.
code --add-mcp '{"name":"mobile-device-mcp","command":"npx","args":["-y","@srmorete/mobile-device-mcp"]}'Or add the block manually to `.vscode/mcp.json` under `servers`.
{
"mcpServers": {
"mobile-device-mcp": {
"command": "npx",
"args": [
"-y",
"@srmorete/mobile-device-mcp"
]
}
}
}Add to `~/.codeium/windsurf/mcp_config.json`.
{
"mcpServers": {
"mobile-device-mcp": {
"command": "npx",
"args": [
"-y",
"@srmorete/mobile-device-mcp"
]
}
}
}Add to `cline_mcp_settings.json` via the MCP Servers panel.
{
"mcpServers": {
"mobile-device-mcp": {
"command": "npx",
"args": [
"-y",
"@srmorete/mobile-device-mcp"
]
}
}
}Add to `~/.gemini/settings.json`.
{
"mcpServers": {
"mobile-device-mcp": {
"type": "local",
"command": "npx",
"args": [
"-y",
"@srmorete/mobile-device-mcp"
],
"tools": [
"*"
]
}
}
}Add to `~/.copilot/mcp-config.json`, or run `/mcp add` inside the CLI.
{
"context_servers": {
"mobile-device-mcp": {
"command": {
"path": "npx",
"args": [
"-y",
"@srmorete/mobile-device-mcp"
]
}
}
}
}Add to your Zed `settings.json`.
npx -y @srmorete/mobile-device-mcpRun `goose configure`, choose **Add Extension → Command-line Extension**, and paste this command.
10 個のツール
Mobile Device MCP は接続したエージェントに 10 個のツールを提供します。
- list_devices
- List available iOS and Android devices
- double_tap
- Double-tap at screen coordinates
- long_press
- Long-press at screen coordinates (configurable duration)
- type_text
- Type text into the focused element
- press_button
- Press a hardware/navigation button (home, back, enter, volumeUp/Down, dpadUp/Down/Left/Right/Center)
- launch_app
- Launch an app by bundle ID / package name
- terminate_app
- Force-stop an app
- list_apps
- List installed apps
- install_app
- Install an app from a host-local file (`.apk` for Android, `.app` for iOS simulator, `.app`/`.ipa` for iOS device). Replaces existing installs
- run_code
- Execute sandboxed JavaScript on-device (see [run_code](#run_code) below)
スコア
83 / 100
優秀
- ドキュメント25/25
- メンテナンス25/25
- 信頼性13/20
- 機能8/15
- 導入のしやすさ12/15
- Documents what it does and how to connect
- Has a resolvable package or endpoint
- Exposes at least one tool, prompt or resource
- README has substantive content
- Includes a code example
- Documents its configuration
- Mentions credentials or security posture
- Last commit 30 days ago
- Has a release history
- Repository is not archived
- Licensed MIT
- Namespace verified in the official MCP registry
- Claimed by its owner
- Published under an organisation
- 10 tool(s) documented
- Provides prompt templates
- Provides resources
- 12 documented install method(s)
- Published to a package registry
- Offers a hosted endpoint — no local install
バージョン履歴
| バージョン | 公開日 |
|---|---|
| 0.1.10最新 | 2026年7月31日 |
| 0.1.9 | 2026年7月30日 |
| 0.1.8 | 2026年7月25日 |
| 0.1.7 | 2026年7月25日 |
| 0.1.6 | 2026年7月24日 |
| 0.1.5 | 2026年4月26日 |
| 0.1.4 | 2026年4月17日 |
| 0.1.3 | 2026年4月15日 |
| 0.1.2 | 2026年4月5日 |