Android MCP
Android MCP
Полное управление Android из любого ИИ-агента — Claude, OpenCode, Windsurf, Cursor… 7 категориальных инструментов MCP · Живой просмотр 90 кадров/с · 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.
Companion-бэкенд (резервный) — опциональное приложение Flutter, если ADB недоступен в сети.
Требования
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Живой просмотр 90 кадров/с (опционально)
winget install Genymobile.scrcpy
python viewer.pyКонфигурация MCP
# 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 filesПример для Claude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"android-mcp": {
"command": "C:/Python312/python.exe",
"args": ["D:/path/to/android-mcp/server.py"],
"type": "stdio"
}
}
}WiFi-подключение без USB (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-устройство |
| — | Модель, ОС, разрешение, плотность |
| — | Устройство подключено и готово? |
| — | Настройка анимаций, режима бодрствования, агента ATX |
android_screen — Захват и трансляция
Действие | Параметры | Описание |
| — | PNG-захват (обходит FLAG_SECURE) → изображение |
|
| Захват определенной области → изображение |
| — |
|
| — | Экран включен? |
| — | Разбудить экран |
| — | Запустить ADB-поток (~16 кадров/с) |
| — | Остановить поток |
| — | Последний кадр потока → изображение |
|
| Извлечь видимый текст (Tesseract) |
|
| Поиск по шаблону (OpenCV) |
|
| Запустить окно scrcpy 90 кадров/с на ПК |
android_interact — Касания, клавиатура, UI
Действие | Параметры | Описание |
|
| Нажатие |
|
| Двойное нажатие |
|
| Длительное нажатие |
|
| Свайп |
|
| Перетаскивание |
|
| Масштабирование щипком |
|
| Жесты несколькими пальцами |
|
| Ввод текста |
| — | Очистить активное поле |
|
| Ввод + Enter |
|
| Системная клавиша (HOME, BACK, ENTER, VOLUME_UP…) |
|
| Комбинация клавиш (коды клавиш) |
| — | Полное дерево UI XML (uiautomator2) |
|
| Найти элемент и нажать на него |
|
| Ожидание элемента |
|
| Прокрутка до элемента |
|
| Проверка видимости текста |
android_app — Приложения
Действие | Параметры | Описание |
|
| Запустить приложение |
|
| Принудительно остановить приложение |
|
| Список установленных приложений |
|
| Установить APK с ПК |
|
| Удалить приложение |
| — | Пакет приложения на переднем плане |
|
| Открыть URL |
|
| Отправить Android intent |
|
| Открыть системные настройки ( |
android_files — Файлы
Действие | Параметры | Описание |
|
| ПК → телефон |
|
| Base64 → телефон |
|
| Телефон → ПК |
|
| Телефон → base64 |
|
| Список содержимого директории |
android_system — Система и сеть
Действие | Параметры | Описание |
|
| Команда ADB shell |
|
| Logcat |
| — | Уровень заряда и состояние зарядки |
| — | Чтение буфера обмена |
|
| Запись в буфер обмена |
|
| Установка громкости |
|
| Поворот экрана (0-3) |
|
| WiFi вкл/выкл |
|
| Bluetooth вкл/выкл |
|
| Мобильные данные вкл/выкл |
| — | Активные уведомления |
|
| Подмена GPS-координат |
|
| Акселерометр, гироскоп, свет… |
| — | Доступные WiFi сети |
|
| Подключиться к WiFi |
|
| Чтение контактов |
|
| Отправить SMS (требует подтверждения на телефоне) |
android_automation — Пакетные операции и макросы
Действие | Параметры | Описание |
|
| Выполнить N действий за один вызов |
|
| Начать запись макроса |
|
| Добавить действие в макрос |
| — | Сохранить макрос |
| — | Список сохраненных макросов |
|
| Воспроизвести макрос |
|
| Удалить макрос |
Живой просмотр — scrcpy 90 кадров/с
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 |
| Скриншот → буфер обмена ПК |
| Полноэкранный режим |
| Поворот |
Тесты
# 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