Skip to main content
Glama
Steph-ux

Android MCP

by Steph-ux

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 PC

Related MCP server: DeepADB

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 / emulators

Backend 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 init

Visor en vivo a 90fps (opcional)

winget install Genymobile.scrcpy
python viewer.py

Configuració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 files

Ejemplo 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:5555

Guí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

list

Todos los dispositivos conectados (USB, WiFi, emuladores)

select

serial

Establecer dispositivo predeterminado

connect

host, port

Conexión WiFi ADB

disconnect

Desconectar dispositivo WiFi actual

info

Modelo, SO, resolución, densidad

status

¿Está el dispositivo conectado y listo?

setup

Configurar animaciones, mantener encendido, agente ATX


android_screen — Captura y transmisión

Acción

Parámetros

Descripción

screenshot

Captura PNG (evita FLAG_SECURE) → imagen

region

x y width height

Capturar un área específica → imagen

size

{width, height}

is_on

¿Está la pantalla encendida?

wake

Encender la pantalla

start_stream

Iniciar transmisión ADB (~16fps)

stop_stream

Detener transmisión

live_frame

Último fotograma de la transmisión → imagen

ocr

lang

Extraer texto visible (Tesseract)

find_image

template_b64 threshold

Coincidencia de plantillas (OpenCV)

viewer

fps bitrate no_control

Iniciar ventana scrcpy a 90fps en PC


android_interact — Táctil, teclado, UI

Acción

Parámetros

Descripción

tap

x y

Tocar

double_tap

x y

Doble toque

long_press

x y duration_ms

Pulsación larga

swipe

x1 y1 x2 y2 duration_ms

Deslizar

drag

x1 y1 x2 y2 duration_ms

Arrastrar y soltar

pinch

x y scale duration_ms

Pellizcar para hacer zoom

multi_touch

points

Gestos con varios dedos

type

text

Escribir texto

clear

Limpiar campo activo

submit

text

Escribir + Enter

key

key

Tecla del sistema (HOME, BACK, ENTER, VOLUME_UP…)

combo

keys

Combinación de teclas (códigos de tecla)

hierarchy

Árbol XML completo de la UI (uiautomator2)

find

text partial_match

Buscar elemento y tocarlo

wait

text timeout partial_match

Esperar elemento

scroll

text direction max_swipes

Desplazarse hasta el elemento

assert

text partial_match

Verificar que el texto sea visible


android_app — Aplicaciones

Acción

Parámetros

Descripción

launch

package

Iniciar una aplicación

close

package

Forzar cierre de una aplicación

list

include_system

Listar aplicaciones instaladas

install

apk_path

Instalar APK desde PC

uninstall

package

Desinstalar aplicación

current

Paquete de la aplicación en primer plano

url

url

Abrir una URL

intent

action uri package extras

Enviar intent de Android

settings

section

Abrir ajustes del sistema (main wifi bluetooth display…)


android_files — Archivos

Acción

Parámetros

Descripción

push

local_path remote_path

PC → teléfono

push_b64

remote_path data

Base64 → teléfono

pull

remote_path local_path

Teléfono → PC

pull_b64

remote_path

Teléfono → base64

list

directory

Listar contenido del directorio


android_system — Sistema y red

Acción

Parámetros

Descripción

shell

command

Comando de shell ADB

logs

lines package

Logcat

battery

Nivel de batería y estado de carga

clipboard_get

Leer portapapeles

clipboard_set

text

Escribir en el portapapeles

volume

level stream

Ajustar volumen

rotation

rotation

Rotación de pantalla (0-3)

wifi

enabled

WiFi encendido/apagado

bluetooth

enabled

Bluetooth encendido/apagado

mobile_data

enabled

Datos móviles encendido/apagado

notifications

Notificaciones activas

gps

lat lng

Simular ubicación GPS

sensors

sensor

Acelerómetro, giroscopio, luz…

wifi_list

Redes WiFi disponibles

wifi_connect

ssid password

Conectar a WiFi

contacts

search limit

Leer contactos

sms

to message

Enviar SMS (requiere confirmación en el teléfono)


android_automation — Lotes y macros

Acción

Parámetros

Descripción

batch

actions stop_on_error

Ejecutar N acciones en una llamada

macro_start

name

Iniciar grabación de una macro

macro_record

action …params

Añadir acción a la macro

macro_stop

Guardar macro

macro_list

Listar macros guardadas

macro_replay

name delay_ms

Reproducir una macro

macro_delete

name

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 mode

Control

Acción

Clic izquierdo

Tocar

Arrastrar

Deslizar

Clic derecho

ATRÁS

Desplazamiento

Desplazarse

Alt+H

INICIO

Alt+S

Captura de pantalla → portapapeles del PC

Alt+F

Pantalla completa

Alt+R

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 -v

Estructura 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 tests

Ejemplos

# 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

A
license - permissive license
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
1Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    A
    quality
    D
    maintenance
    Enables AI agents to fully control Android devices through over 30 tools for app management, UI automation, and vision-based analysis via ADB. It supports multi-device management, action recording, and smart execution strategies ranging from UI hierarchy parsing to coordinate-based interaction.
    37
    137
    1
    MIT
  • A
    license
    B
    quality
    A
    maintenance
    A comprehensive MCP server that enables AI agents to interact with Android devices through Android Debug Bridge (ADB), offering 198 tools for device control, app management, diagnostics, and more.
    100
    72
    15
    Apache 2.0
  • A
    license
    A
    quality
    A
    maintenance
    MCP server that gives AI agents full vision and control over Android devices via ADB and scrcpy. Supports screenshots, input, apps, UI automation, shell, files, and clipboard.
    38
    259
    73
    MIT

View all related MCP servers

Related MCP Connectors

  • Free public MCP for AI agents — 193 tools, 44 workflows. No API key.

  • Hosted MCP with 91 agent tools: X, domains, SEO, Maps, Trends, Search, YouTube, TikTok, and more.

  • Phone, SMS & email for AI agents — one remote MCP endpoint, OAuth login, zero install.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Steph-ux/android-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server