Android MCP
Android MCP
Control total de Android desde cualquier agente de IA — Claude, OpenCode, Windsurf, Cursor… 7 herramientas MCP categóricas · visor en vivo a 90fps · WiFi ADB · cero aplicaciones a instalar
Demo rápida
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
Arquitectura
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 / emulatorsBackend ADB (principal) — funciona en cualquier dispositivo con el modo desarrollador activado.
No hay nada que instalar en el teléfono. Utiliza uiautomator2 + comandos ADB.
Backend complementario (alternativo) — aplicación Flutter opcional cuando ADB no está disponible en la red.
Requisitos
Python 3.10+
ADB en PATH (
winget install Google.PlatformTools)Android: Modo desarrollador + depuración USB (o depuración WiFi)
Instalación
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 initVisor en vivo a 90fps (opcional)
winget install Genymobile.scrcpy
python viewer.pyConfiguración de 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 filesEjemplo para Claude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"android-mcp": {
"command": "C:/Python312/python.exe",
"args": ["D:/path/to/android-mcp/server.py"],
"type": "stdio"
}
}
}Conexión WiFi sin 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:5555Guía completa → WIFI_PAIRING.md
Las 7 herramientas MCP
Convención de llamada: android_xxx(action="...", params={...}, device_id="serial")
device_id es siempre opcional (utiliza el dispositivo seleccionado actualmente).
android_device — Gestión de dispositivos
Acción | Parámetros | Descripción |
| — | Todos los dispositivos conectados (USB, WiFi, emuladores) |
|
| Establecer dispositivo predeterminado |
|
| Conexión WiFi ADB |
| — | Desconectar dispositivo WiFi actual |
| — | Modelo, SO, resolución, densidad |
| — | ¿Está el dispositivo conectado y listo? |
| — | Configurar animaciones, mantener encendido, agente ATX |
android_screen — Captura y transmisión
Acción | Parámetros | Descripción |
| — | Captura PNG (evita FLAG_SECURE) → imagen |
|
| Capturar un área específica → imagen |
| — |
|
| — | ¿Está la pantalla encendida? |
| — | Encender la pantalla |
| — | Iniciar transmisión ADB (~16fps) |
| — | Detener transmisión |
| — | Último fotograma de la transmisión → imagen |
|
| Extraer texto visible (Tesseract) |
|
| Coincidencia de plantillas (OpenCV) |
|
| Iniciar ventana scrcpy a 90fps en PC |
android_interact — Táctil, teclado, UI
Acción | Parámetros | Descripción |
|
| Tocar |
|
| Doble toque |
|
| Pulsación larga |
|
| Deslizar |
|
| Arrastrar y soltar |
|
| Pellizcar para hacer zoom |
|
| Gestos con varios dedos |
|
| Escribir texto |
| — | Limpiar campo activo |
|
| Escribir + Enter |
|
| Tecla del sistema (HOME, BACK, ENTER, VOLUME_UP…) |
|
| Combinación de teclas (códigos de tecla) |
| — | Árbol XML completo de la UI (uiautomator2) |
|
| Buscar elemento y tocarlo |
|
| Esperar elemento |
|
| Desplazarse hasta el elemento |
|
| Verificar que el texto sea visible |
android_app — Aplicaciones
Acción | Parámetros | Descripción |
|
| Iniciar una aplicación |
|
| Forzar cierre de una aplicación |
|
| Listar aplicaciones instaladas |
|
| Instalar APK desde PC |
|
| Desinstalar aplicación |
| — | Paquete de la aplicación en primer plano |
|
| Abrir una URL |
|
| Enviar intent de Android |
|
| Abrir ajustes del sistema ( |
android_files — Archivos
Acción | Parámetros | Descripción |
|
| PC → teléfono |
|
| Base64 → teléfono |
|
| Teléfono → PC |
|
| Teléfono → base64 |
|
| Listar contenido del directorio |
android_system — Sistema y red
Acción | Parámetros | Descripción |
|
| Comando de shell ADB |
|
| Logcat |
| — | Nivel de batería y estado de carga |
| — | Leer portapapeles |
|
| Escribir en el portapapeles |
|
| Ajustar volumen |
|
| Rotación de pantalla (0-3) |
|
| WiFi encendido/apagado |
|
| Bluetooth encendido/apagado |
|
| Datos móviles encendido/apagado |
| — | Notificaciones activas |
|
| Simular ubicación GPS |
|
| Acelerómetro, giroscopio, luz… |
| — | Redes WiFi disponibles |
|
| Conectar a WiFi |
|
| Leer contactos |
|
| Enviar SMS (requiere confirmación en el teléfono) |
android_automation — Lotes y macros
Acción | Parámetros | Descripción |
|
| Ejecutar N acciones en una llamada |
|
| Iniciar grabación de una macro |
|
| Añadir acción a la macro |
| — | Guardar macro |
| — | Listar macros guardadas |
|
| Reproducir una macro |
|
| Eliminar una macro |
Visor en vivo — 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 modeControl | Acción |
Clic izquierdo | Tocar |
Arrastrar | Deslizar |
Clic derecho | ATRÁS |
Desplazamiento | Desplazarse |
| INICIO |
| Captura de pantalla → portapapeles del PC |
| Pantalla completa |
| Rotación |
Pruebas
# Unit tests (no device required)
pytest tests/test_server_unit.py -v # 94 tests
# Integration tests (ADB device required)
pytest tests/test_integration.py -vEstructura del proyecto
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 testsEjemplos
# 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"})Consulta examples/whatsapp_auto.py y examples/agent_loop.py para casos de uso completos.
Licencia
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