SM

srmorete/mobile-device-mcp

Developer tools

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

53 stars 2 forks 品質 78 トレンド 17MIT

IOSとAndroidで使用できるMCPサーバー。 ネイティブ画面とWebViewsをシームレスにマップします。 複数の並列デバイスがサポートされています.

概要

AIエージェントがiOSとAndroidデバイス(タップ、スクロール、タイプ、スクリーンショットの取得、UIツリーの読み込み、コードの実行)を制御できるMCPサーバー。 同時に複数のデバイスで動作します。 1。 - アクセシビリティツリーを公開し、インタラクションコマンドを受け入れる、各モバイルデバイス(Android上でUIAutomator、iOS上でXCUITest)で実行される軽量なHTTPサーバー。 2。 — 両方のプラットフォームから統一されたフラット要素リストに未加工UIツリーを正規化します。 3. —外的なインターフェイス。 デバイス検出、ブートストラップ、ポート割り当て、およびデバイスサーバーへのプロキシ要求を処理します。 デバイスは、最初の使用時に起動します。サーバーは、ドライバアプリをインストールし、ポートを割り当て、オンデバイスサーバーを起動し、それが健康になるまでポーリングします。 その後、すべてのツールコールは、per-deviceベアトークンauthでlocalhost HTTP上でプロキシされます。 エージェントは UIAutomator や XCUITest のように見えるコードを渡すことができます。どちらも フードの下に JavaScript です.

概要(AI 翻訳)

AIエージェントがiOSとAndroidデバイス(タップ、スクロール、タイプ、スクリーンショットの取得、UIツリーの読み込み、コードの実行)を制御できるMCPサーバー。 同時に複数のデバイスで動作します。

使い方

3層アーキテクチャ:

1。オンデバイスサーバー - 各モバイルデバイス(Android上でUIAutomator、iOS上でXCUITest)で動作する軽量のHTTPサーバーは、アクセシビリティツリーを調べ、インタラクションコマンドを受け入れる。 2.UIツリーフィルタ — 両方のプラットフォームから統一されたフラット要素リストに未加工UIツリーを正規化します。 3。MCPサーバー - 外部インタフェース。 デバイス検出、ブートストラップ、ポート割り当て、およびデバイスサーバーへのプロキシ要求を処理します。

デバイスは、最初の使用時に起動します。サーバーは、ドライバアプリをインストールし、ポートを割り当て、オンデバイスサーバーを起動し、それが健康になるまでポーリングします。 その後、すべてのツールコールは、per-deviceベアトークンauthでlocalhost HTTP上でプロキシされます。

ツール

| ツール | 概要 | お問い合わせ | 【[[T0]】 | iOS・Android対応端末一覧 | | [screenshot | デバイス画面(JPEG)のキャプチャ | | [uitree | UI要素ツリーをフラットリストとして取得し、オプション検索と制限を行います.

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。

README

以下は原文 README の抜粋です。原文を見る。

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:

  1. 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.
  2. UI tree filter — Normalizes raw UI trees from both platforms into a unified flat element list.
  3. 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 adb on PATH
  • iOS Simulator: Xcode with xcrun, simctl
GitHub で README 全文を見る

インストール

npx -y @srmorete/mobile-device-mcp@latest
MCP 初心者?mcpskill.org のガイドから始めましょう →

設定

{ "mcpServers": { "mobile-device-mcp": { "command": "npx", "args": ["-y", "@srmorete/mobile-device-mcp@latest"], "env": { "MDMS_PORT_ANDROID": "18000", # optional "MDMS_PORT_IOS": "19000" # optional } } } }