Android ADB MCP Server
Android ADB MCP Server lets AI assistants securely control Android devices over ADB, exposing five tools for logs, UI inspection, package listing, and allowlisted shell commands.
adb_get_logcat— dump the device logcat buffer (logcat -d, not a stream), optionally filtering by tag, minimum log level, and the last N lines.adb_clear_logcat— permanently clear the device logcat buffer so later dumps start fresh.adb_dump_hierarchy— return the current UI hierarchy as XML/text via uiautomator (may be empty if no window is focused).adb_list_packages— list installed packages (third-party only by default), with optional case-insensitive name filter and system-package inclusion.adb_execute_shell— run read-only shell commands restricted to allowlisted prefixes (getprop,dumpsys,pm list); chaining and injection metacharacters are rejected.
Provides tools for controlling Android devices over ADB, including reading logcat, clearing logs, inspecting the current UI hierarchy, listing installed packages, and running safe allowlisted shell commands.
Android ADB MCP Server
English
Description
Android ADB MCP Server is a Model Context Protocol (MCP) server that lets AI assistants — such as Claude and OpenCode, or VS Code through its Copilot/agent integration — control Android devices over ADB securely. It exposes tools to read logcat, inspect the current UI hierarchy, list installed packages, and run restricted shell commands, all gated by an allowlist that mitigates arbitrary command execution.
A note on terminology: Claude and OpenCode are AI assistants. VS Code is not an AI — it is a code editor that hosts AI assistants (GitHub Copilot, and MCP-capable extensions) and is itself an MCP client. The server works with any MCP-capable client.
Prerequisites
Node.js v18+ (tested up to Node.js 26).
ADB installed and reachable via the system
PATH(adb versionmust work), or located viaADB_PATH/ANDROID_HOME/ standard SDK paths.USB debugging enabled on the Android device (Developer options → USB debugging).
Installation & Usage
1. Clone & install dependencies
git clone https://github.com/Neem2004/android-mcp-server.git
cd android-mcp-server
npm install2. Build
npm run buildThis produces the compiled code in the dist/ folder.
⚠️ Important:
dist/is generated locally and is not committed to the repository. You must runnpm run buildbefore configuring your MCP client, or the server will fail to start.
💡 Quick start (published on npm): you can skip the clone and build entirely — the server is published as
@neem2004/android-mcp-serverand includes the compileddist/. Run it directly withnpx -y @neem2004/android-mcp-server, as shown in the configs below. The absolute path form targets a local clone (replaceYOUR_PATH_TOwith its location).
3. Configure your MCP client
Each MCP client keeps its servers in a different file, with a different format. Below are the three most common setups, each with the published-package form (npx) and the local-clone alternative.
OpenCode (AI assistant / CLI)
File: opencode.json at your project root, or ~/.config/opencode/opencode.json (global).
{
"mcp": {
"android": {
"type": "local",
"command": ["npx", "-y", "@neem2004/android-mcp-server"],
"enabled": true
}
}
}Local clone alternative — "command": ["node", "YOUR_PATH_TO/android-mcp-server/dist/index.js"].
Claude Desktop (AI assistant)
File: %APPDATA%\Claude\claude_desktop_config.json (Windows) or ~/Library/Application Support/Claude/claude_desktop_config.json (macOS).
{
"mcpServers": {
"android": {
"command": "npx",
"args": ["-y", "@neem2004/android-mcp-server"]
}
}
}Local clone alternative — "command": "node" with "args": ["YOUR_PATH_TO/android-mcp-server/dist/index.js"].
VS Code (editor with Copilot / MCP agent support)
File: .vscode/mcp.json in your workspace (or via the MCP: Open User Configuration command). VS Code uses servers as the top-level key (not mcpServers).
{
"servers": {
"android": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@neem2004/android-mcp-server"]
}
}
}Local clone alternative — "command": "node" with "args": ["YOUR_PATH_TO/android-mcp-server/dist/index.js"].
Development note: instead of the compiled build you can run TypeScript directly via
tsxby replacing the argument withsrc/index.tsand usingnpx tsxas the command. Prefer the compiled build for reliability.
4. Basic validation
npm test # runs the unit test suite
npm run build # compiles TypeScript to dist/
npm run dev # runs the server directly via tsx (development)Available Tools
Tool | Description | Arguments |
| Dumps the |
|
| Clears the device log buffer | — |
| Returns the current UI hierarchy (XML/text) | — |
| Lists installed packages |
|
| Runs a safe allowlisted shell command |
|
Security
This server prioritizes safety over arbitrary command execution:
Shell allowlist:
adb_execute_shellonly accepts commands whose prefix is authorized (getprop,dumpsys,pm list). Anything else is rejected with a descriptive error. Command chaining (&&,||,;,|) and injection metacharacters are also blocked.No root: no superuser privileges are requested; it works on standard ADB APIs.
Commands run via
execFile(no intermediate shell), avoiding metacharacter injection.
The logic lives in
src/adb/security.ts; review it before broadening permissions.
Skill for AI agents (free)
A ready-made SKILL.md that teaches an agent when and how to use this
server lives in skills/android-adb/. It is
compatible with any agent that reads the SKILL.md standard (Claude Code, Cursor,
Codex CLI, Copilot, OpenCode, and more).
It is also published as a free skill on the Agensi marketplace as Android ADB Control (category: Mobile Development).
The skill only provides instructions — the agent still needs this MCP server connected to access the
adb_*tools.
Setting Up ADB
If you do not have ADB yet:
Windows: download the official platform-tools and add its folder to your system
PATH.macOS / Linux: install via your package manager (e.g.
brew install android-platform-tools,apt install adb).
Verify with:
adb devicesYour device should appear as device (not unauthorized/offline). The server will use ADB_PATH, then ANDROID_HOME/ANDROID_SDK_ROOT, then standard SDK locations, before falling back to adb on the PATH.
Sponsorship
This project is 100% open source and independently maintained. If Android ADB MCP Server saves your team time or improves your automation workflows, please consider supporting its continued development.
🔗 GitHub Sponsors: Sponsor Neem2004
💼 Companies: corporate sponsorship funds new tools, security hardening, and priority support.
Every contribution, however small, helps keep the project active, documented, and secure. Thank you for your support!
License
ISC
Related MCP server: DroidAgentKit
Español
Descripción
Android ADB MCP Server es un servidor del Model Context Protocol (MCP) que permite a asistentes de IA —como Claude y OpenCode, o VS Code mediante su integración con Copilot/agente— controlar dispositivos Android vía ADB de forma segura. Expone herramientas para leer el logcat, inspeccionar la jerarquía de la UI, listar paquetes instalados y ejecutar comandos shell restringidos, todo a través de una lista blanca que mitiga los riesgos de ejecución arbitraria.
Nota sobre terminología: Claude y OpenCode son asistentes de IA. VS Code no es una IA — es un editor de código que aloja asistentes de IA (GitHub Copilot y extensiones con soporte MCP) y que además es un cliente MCP. El servidor funciona con cualquier cliente compatible con MCP.
Requisitos previos
Node.js v18+ (probado hasta Node.js 26).
ADB instalado y accesible en el
PATHdel sistema (adb versiondebe funcionar), o localizado víaADB_PATH/ANDROID_HOME/ rutas estándar del SDK.Depuración USB activada en el dispositivo Android (Opciones de desarrollador → Depuración USB).
Instalación y Uso
1. Clonar e instalar dependencias
git clone https://github.com/Neem2004/android-mcp-server.git
cd android-mcp-server
npm install2. Compilar
npm run buildEsto genera el código compilado en la carpeta dist/.
⚠️ Importante:
dist/se genera localmente y no se sube al repositorio. Debes ejecutarnpm run buildantes de configurar tu cliente MCP, o el servidor no arrancará.
💡 Inicio rápido (publicado en npm): puedes saltarte el clonado y la compilación — el servidor está publicado como
@neem2004/android-mcp-servere incluye eldist/compilado. Ejecútalo directamente connpx -y @neem2004/android-mcp-server, como muestran las configuraciones de abajo. La forma de ruta absoluta apunta a un clon local (reemplazaTU_RUTApor su ubicación).
3. Configurar tu cliente MCP
Cada cliente MCP guarda sus servidores en un archivo distinto, con un formato propio. A continuación están las tres configuraciones más comunes, cada una con la forma de paquete publicado (npx) y la alternativa de clon local.
OpenCode (asistente de IA / CLI)
Archivo: opencode.json en la raíz de tu proyecto, o ~/.config/opencode/opencode.json (global).
{
"mcp": {
"android": {
"type": "local",
"command": ["npx", "-y", "@neem2004/android-mcp-server"],
"enabled": true
}
}
}Alternativa de clon local — "command": ["node", "TU_RUTA/android-mcp-server/dist/index.js"].
Claude Desktop (asistente de IA)
Archivo: %APPDATA%\Claude\claude_desktop_config.json (Windows) o ~/Library/Application Support/Claude/claude_desktop_config.json (macOS).
{
"mcpServers": {
"android": {
"command": "npx",
"args": ["-y", "@neem2004/android-mcp-server"]
}
}
}Alternativa de clon local — "command": "node" con "args": ["TU_RUTA/android-mcp-server/dist/index.js"].
VS Code (editor con soporte de Copilot / agente MCP)
Archivo: .vscode/mcp.json en tu workspace (o mediante el comando MCP: Open User Configuration). VS Code usa servers como clave raíz (no mcpServers).
{
"servers": {
"android": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@neem2004/android-mcp-server"]
}
}
}Alternativa de clon local — "command": "node" con "args": ["TU_RUTA/android-mcp-server/dist/index.js"].
Nota de desarrollo: en lugar del build compilado puedes ejecutar TypeScript directamente con
tsxreemplazando el argumento porsrc/index.tsy usandonpx tsxcomo comando. Para máxima fiabilidad, prefiere el build compilado.
4. Validación básica
npm test # ejecuta la suite de tests unitarios
npm run build # compila TypeScript a dist/
npm run dev # ejecuta el servidor directamente con tsx (desarrollo)Tools disponibles
Tool | Descripción | Argumentos |
| Vuelca el buffer de |
|
| Limpia el buffer de logs del dispositivo | — |
| Devuelve la jerarquía de la UI actual (XML/texto) | — |
| Lista los paquetes instalados |
|
| Ejecuta un comando shell seguro (lista blanca) |
|
Seguridad
Este servidor prioriza la seguridad frente a la ejecución arbitraria de comandos:
Lista blanca de comandos shell:
adb_execute_shellsolo acepta comandos cuyo prefijo esté autorizado (getprop,dumpsys,pm list). Cualquier otra cosa se rechaza con un error descriptivo. También se bloquean encadenamientos (&&,||,;,|) y metacaracteres de inyección.Sin root: no se solicitan privilegios de superusuario; se trabaja sobre las APIs estándar de ADB.
Los comandos se ejecutan mediante
execFile(sin pasar por un shell intermedio), evitando la inyección de metacaracteres.
La lógica vive en
src/adb/security.ts; revísalo antes de ampliar los permisos.
Skill para agentes de IA (gratis)
Un SKILL.md listo para usar que le enseña al agente cuándo y cómo usar
este servidor está en skills/android-adb/. Es
compatible con cualquier agente que lea el estándar SKILL.md (Claude Code, Cursor,
Codex CLI, Copilot, OpenCode y más).
También está publicado como skill gratuito en el marketplace Agensi como Android ADB Control (categoría: Mobile Development).
El skill solo aporta instrucciones — el agente sigue necesitando este servidor MCP conectado para acceder a las tools
adb_*.
Configuración de ADB
Si aún no tienes ADB:
Windows: descarga los platform-tools oficiales y agrega su carpeta al
PATHdel sistema.macOS / Linux: instala con tu gestor de paquetes (p. ej.
brew install android-platform-tools,apt install adb).
Verifica con:
adb devicesTu dispositivo debe aparecer como device (no unauthorized/offline). El servidor usará ADB_PATH, luego ANDROID_HOME/ANDROID_SDK_ROOT, luego rutas estándar del SDK, antes de caer a adb en el PATH.
Patrocinio
Este proyecto es 100% open source y se mantiene de forma independiente. Si Android ADB MCP Server ahorra tiempo a tu equipo o mejora tus flujos de automatización, considera apoyar su desarrollo continuo.
🔗 GitHub Sponsors: Patrocina a Neem2004
💼 Empresas: el patrocinio corporativo financia nuevas herramientas, mejoras de seguridad y soporte prioritario.
Toda contribución, por pequeña que sea, ayuda a mantener el proyecto activo, documentado y seguro. ¡Gracias por tu apoyo!
Licencia
ISC
Available Tools
5 toolsadb_clear_logcatA
Permanently clears the device logcat buffer (logcat -c) and returns a confirmation message. All buffered log entries are lost; subsequent dumps start fresh. Run it before capturing a clean log stream. / Limpia permanentemente el buffer de logcat del dispositivo (logcat -c) y devuelve un mensaje de confirmación. Se pierden todas las entradas en buffer; los dumps posteriores empiezan desde cero. Ejecútalo antes de capturar un stream de logs limpio.
Inputs: no named parameters.
adb_dump_hierarchyA
Returns the current UI hierarchy of the Android device as XML/text via uiautomator. Tries /dev/tty first and falls back to /sdcard/window_dump.xml. May return empty when no window is focused. Useful to understand the visible layout. / Devuelve la jerarquía de la UI actual del dispositivo como texto/XML vía uiautomator. Prueba /dev/tty primero y cae a /sdcard/window_dump.xml como respaldo. Puede devolver vacío cuando no hay ventana enfocada. Útil para entender el layout visible.
Inputs: no named parameters.
adb_execute_shellA
Runs a read-only shell command on the Android device, restricted to an allowlist of safe prefixes: getprop (read system properties), dumpsys (dump services) and pm list (list packages). Anything else — including command chaining (&&, ||, ;, |) and injection metacharacters — is rejected with a descriptive error. / Ejecuta un comando shell de solo lectura en el dispositivo Android, restringido a la lista blanca de prefijos seguros: getprop (propiedades del sistema), dumpsys (volcado de servicios) y pm list (listado de paquetes). Cualquier otra cosa —incluidos encadenamientos (&&, ||, ;, |) y metacaracteres de inyección— se rechaza con un error descriptivo.
Inputs: command (required).
adb_get_logcatA
Dumps and exits the Android logcat buffer (logcat -d; not a stream), returning newline-separated lines with blank lines removed. Optionally filters by tag, minimum log level and the last N lines. Use filter_tag alone for 'tag:'; log_level only takes effect together with filter_tag. / Vuelca y cierra el buffer de logcat del dispositivo (logcat -d; no es un stream), devolviendo líneas separadas por saltos de línea y omitiendo las vacías. Filtra opcionalmente por tag, nivel mínimo de log y las últimas N líneas. filter_tag solo produce 'tag:'; log_level solo tiene efecto junto con filter_tag.
Inputs: lines, log_level, filter_tag.
adb_list_packagesA
Lists the packages installed on the Android device as one 'package:' line each (third-party only by default). Optionally filters by a case-insensitive name substring and includes system packages. / Lista los paquetes instalados del dispositivo con una línea 'package:' por cada uno (solo de terceros por defecto). Filtra opcionalmente por subcadena del nombre sin distinguir mayúsculas e incluye paquetes de sistema.
Inputs: filter, include_system.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Tools mostly target distinct actions/resources, but adb_execute_shell's allowlist includes 'pm list', which overlaps with adb_list_packages, creating a minor risk of misselection. The descriptions do clarify the specialized tools, so boundaries are largely clear.
All tools use the adb_ prefix followed by a verb_noun pattern (get_logcat, clear_logcat, dump_hierarchy, list_packages, execute_shell), showing consistent naming throughout.
Five tools is well-scoped for a read-only ADB diagnostic server; each tool has a clear purpose and no bloat.
The server covers logcat capture/clearing, UI hierarchy, package listing, and a restricted shell for getprop/dumpsys/pm list, but lacks operations like screenshot or direct UI interaction. For a read-only diagnostic scope, coverage is mostly complete with minor gaps.
Maintenance
Related MCP Connectors
Remote MCP server to control your Android phone from AI assistants with per-app permissions.
Let Claude, ChatGPT and other agents use your Android phone: see the screen, tap, type, open apps.
Cloud Android devices for AI agents: install an APK, read the screen, tap, type, read logcat.
Give your Grok Bot a phone: an MCP server to see and use your phone. Also works with Claude.
Related MCP Servers
- AlicenseAqualityDmaintenanceAn MCP server that gives AI agents full control of Android devices and emulators through plain ADB — no companion APK, no extra daemon, no telemetry.2614MIT
- FlicenseNot gradedqualityAmaintenanceMCP server that provides AI coding agents real Android development tools—Gradle, adb, logcat, lint, crash triage—through a local, permissioned interface. Enables agents to inspect projects, run safe Gradle tasks, capture logs/screenshots, and triage crashes.1-
- AlicenseNot gradedqualityBmaintenanceLocal-first MCP server that enables AI agents to safely control and observe Android mobile devices, supporting device diagnostics, app lifecycle management, async task execution, and performance monitoring through a policy-constrained interface with explicit confirmations.1Apache 2.0
- AlicenseBqualityBmaintenanceMCP server that lets an AI assistant see and control an Android phone over ADB: screenshots, UI dump, tap, swipe, type, keys, open apps. Safety guards: device allowlist, sensitive-app block, raw shell off by default, rate limit.1488 npm1MIT