Android MCP
Android MCP
あらゆるAIエージェントからAndroidを完全に制御 — Claude、OpenCode、Windsurf、Cursorなど 7つのカテゴリ別MCPツール · 90fpsライブビューア · WiFi ADB · インストール不要
クイックデモ
android_screen(action="screenshot") # PNG capture
android_screen(action="ocr") # visible text
android_interact(action="tap", params={"x": 540, "y": 960}) # tap
android_interact(action="find", params={"text": "Send"}) # find + tap
android_system(action="battery") # battery info
android_screen(action="viewer") # 90fps interactive window on PCRelated MCP server: phone-eye
アーキテクチャ
AI Agent (Claude / OpenCode / Windsurf / Cursor…)
↓ MCP Protocol (stdio)
server.py ← 7 categorical tools
↓
device_manager.py ← device selection, multi-device
↓
backends/
├── adb_backend.py ← PRIMARY : uiautomator2 + direct ADB
└── companion_backend.py ← FALLBACK : Flutter app WebSocket
↓
N Android phones / emulatorsADBバックエンド(メイン) — 開発者モードが有効なあらゆるデバイスで動作します。
スマホへのインストールは不要です。uiautomator2 + ADBコマンドを使用します。
コンパニオンバックエンド(フォールバック) — ネットワーク上でADBが利用できない場合のオプションのFlutterアプリです。
要件
Python 3.10+
ADB (PATHに追加済みであること:
winget install Google.PlatformTools)Android: 開発者モード + USBデバッグ(またはWiFiデバッグ)
インストール
git clone https://github.com/Steph-ux/android-mcp
cd android-mcp
pip install -r requirements.txt
# Initialize uiautomator2 (once per device)
python -m uiautomator2 initライブビューア 90fps (オプション)
winget install Genymobile.scrcpy
python viewer.pyMCP設定
# Generate the correct JSON for your AI client
python mcp_config.py --client claude # Claude Desktop
python mcp_config.py --client opencode # OpenCode
python mcp_config.py --client windsurf # Windsurf
python mcp_config.py --client cursor # Cursor
python mcp_config.py --write # write directly to config filesClaude Desktopの例 (claude_desktop_config.json):
{
"mcpServers": {
"android-mcp": {
"command": "C:/Python312/python.exe",
"args": ["D:/path/to/android-mcp/server.py"],
"type": "stdio"
}
}
}USBなしのWiFi接続 (Android 11以降)
# On the phone: Settings → Developer options → Wireless debugging → Pair device
adb pair 192.168.1.42:38765 # enter the code shown on the phone
adb connect 192.168.1.42:5555完全ガイド → WIFI_PAIRING.md
7つのMCPツール
呼び出し規約: android_xxx(action="...", params={...}, device_id="serial")
device_id は常にオプションです(現在選択されているデバイスを使用します)。
android_device — デバイス管理
アクション | パラメータ | 説明 |
| — | 接続されているすべてのデバイス (USB, WiFi, エミュレータ) |
|
| デフォルトデバイスの設定 |
|
| WiFi ADB接続 |
| — | 現在のWiFiデバイスを切断 |
| — | モデル、OS、解像度、密度 |
| — | デバイスが接続され準備完了か? |
| — | アニメーション、スリープ無効化、ATXエージェントの設定 |
android_screen — キャプチャ & ストリーム
アクション | パラメータ | 説明 |
| — | PNGキャプチャ (FLAG_SECUREをバイパス) → 画像 |
|
| 特定領域のキャプチャ → 画像 |
| — |
|
| — | 画面がオンか? |
| — | 画面をスリープ解除 |
| — | ADBストリーム開始 (~16fps) |
| — | ストリーム停止 |
| — | 最新のストリームフレーム → 画像 |
|
| 表示テキストの抽出 (Tesseract) |
|
| テンプレートマッチング (OpenCV) |
|
| PC上でscrcpy 90fpsウィンドウを起動 |
android_interact — タッチ、キーボード、UI
アクション | パラメータ | 説明 |
|
| タップ |
|
| ダブルタップ |
|
| 長押し |
|
| スワイプ |
|
| ドラッグ&ドロップ |
|
| ピンチズーム |
|
| マルチフィンガージェスチャー |
|
| テキスト入力 |
| — | アクティブフィールドのクリア |
|
| 入力 + Enter |
|
| システムキー (HOME, BACK, ENTER, VOLUME_UP…) |
|
| キーの組み合わせ (キーコード) |
| — | 完全なUI XMLツリー (uiautomator2) |
|
| 要素を見つけてタップ |
|
| 要素を待機 |
|
| 要素までスクロール |
|
| テキストが表示されているか確認 |
android_app — アプリケーション
アクション | パラメータ | 説明 |
|
| アプリの起動 |
|
| アプリの強制終了 |
|
| インストール済みアプリの一覧 |
|
| PCからAPKをインストール |
|
| アプリのアンインストール |
| — | フォアグラウンドアプリのパッケージ名 |
|
| URLを開く |
|
| Androidインテントの送信 |
|
| システム設定を開く ( |
android_files — ファイル
アクション | パラメータ | 説明 |
|
| PC → スマホ |
|
| Base64 → スマホ |
|
| スマホ → PC |
|
| スマホ → base64 |
|
| ディレクトリ内容の一覧 |
android_system — システム & ネットワーク
アクション | パラメータ | 説明 |
|
| ADBシェルコマンド |
|
| Logcat |
| — | バッテリー残量と充電状態 |
| — | クリップボードの読み取り |
|
| クリップボードへの書き込み |
|
| 音量設定 |
|
| 画面回転 (0-3) |
|
| WiFiのオン/オフ |
|
| Bluetoothのオン/オフ |
|
| モバイルデータのオン/オフ |
| — | アクティブな通知 |
|
| GPS位置情報の偽装 |
|
| 加速度、ジャイロ、照度など |
| — | 利用可能なWiFiネットワーク |
|
| WiFiに接続 |
|
| 連絡先の読み取り |
|
| SMS送信 (スマホ側での確認が必要) |
android_automation — バッチ & マクロ
アクション | パラメータ | 説明 |
|
| 1回の呼び出しでN個のアクションを実行 |
|
| マクロの記録開始 |
|
| マクロにアクションを追加 |
| — | マクロの保存 |
| — | 保存済みマクロの一覧 |
|
| マクロの再生 |
|
| マクロの削除 |
ライブビューア — scrcpy 90fps
python viewer.py # auto-detect device, 90fps, interactive
python viewer.py --fps 60 # 60fps
python viewer.py --record # record to .mp4
python viewer.py --record out.mp4 # named output file
python viewer.py --multi # one viewer per connected device
python viewer.py --no-control # read-only mode操作 | アクション |
左クリック | タップ |
ドラッグ | スワイプ |
右クリック | BACK |
スクロール | スクロール |
| HOME |
| スクリーンショット → PCクリップボード |
| フルスクリーン |
| 回転 |
テスト
# Unit tests (no device required)
pytest tests/test_server_unit.py -v # 94 tests
# Integration tests (ADB device required)
pytest tests/test_integration.py -vプロジェクト構造
android-mcp/
├── server.py # MCP server — 7 tools
├── viewer.py # scrcpy 90fps interactive viewer
├── mcp_config.py # JSON config generator
├── device_manager.py # Multi-device management
├── relay.py # ⚠️ LEGACY — companion fallback only
├── requirements.txt
├── pyproject.toml
├── WIFI_PAIRING.md
├── backends/
│ ├── adb_backend.py # Primary backend (uiautomator2 + ADB)
│ └── companion_backend.py # Fallback backend (Flutter app)
├── examples/
│ ├── agent_loop.py # Autonomous automation loop
│ └── whatsapp_auto.py # WhatsApp automation example
└── tests/
├── conftest.py
├── test_server_unit.py # 94 unit tests
└── test_integration.py # Real device tests例
# WhatsApp — send a message
await android_app("launch", {"package": "com.whatsapp"})
await android_interact("find", {"text": "Alice"})
await android_interact("type", {"text": "Hello!"})
await android_interact("key", {"key": "ENTER"})
# Batch in a single call
await android_automation("batch", {"actions": [
{"action": "key", "key": "HOME"},
{"action": "tap", "x": 540, "y": 200},
{"action": "type", "text": "search query"},
{"action": "key", "key": "ENTER"},
]})
# Macro: record + replay
await android_automation("macro_start", {"name": "login"})
await android_automation("macro_record", {"action": "tap", "x": 540, "y": 400})
await android_automation("macro_record", {"action": "type", "text": "password"})
await android_automation("macro_stop")
await android_automation("macro_replay", {"name": "login"})完全な使用例については examples/whatsapp_auto.py および examples/agent_loop.py を参照してください。
ライセンス
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Let Claude, ChatGPT and other agents use your Android phone: see the screen, tap, type, open apps.
Remote MCP server to control your Android phone from AI assistants with per-app permissions.
Let AI agents control Android and iOS devices on Mobilerun Cloud: screen, input, apps, workflows.
Cloud Android devices for AI agents: install an APK, read the screen, tap, type, read logcat.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to control Android phones via MCP and HTTP. Supports screen capture, taps, swipes, text input, and app management.7AGPL 3.0
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to see and operate a real Android phone over adb by fusing live screenshots with UI-tree data, supporting look, tap, swipe, type, and screenshot actions through any MCP client.4MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to remotely control a real Android phone over MCP with no ADB, root, or emulator, by connecting a broker server to a sideloaded APK. Exposes tools to list devices, capture screenshots, read the UI tree, open links and deep links, and perform taps, swipes, typing, and global navigation actions.1MIT
- AlicenseNot gradedqualityBmaintenanceEnables MCP-compatible AI agents to perceive and control an Android phone through tools for screenshots, visible text and coordinates, app/screen queries, taps, swipes, text input, key events, app launching, and interrupt/resume, closing the perception-action loop.6MIT