ADB MCP Server
The ADB MCP Server is a tool that provides a bridge between AI models and Android devices via ADB using MCP. With this server, you can:
Device Management: List and interact with connected Android devices
App Installation: Deploy APK files to devices
Logging: Access and filter device logs through logcat
File Transfer: Push files to devices and pull files from devices, with base64 encoding options
UI Interaction: Capture screenshots and analyze UI hierarchy in XML format
Shell Command Execution: Run custom commands on devices
Configuration: Customize ADB paths and server settings for flexibility
Provides tools for interacting with Android devices via ADB, including device management, app installation, logging, file transfer, UI interaction, and shell command execution.
Serves as the runtime environment for the ADB MCP server, allowing communication between AI models and Android devices.
Enables execution of custom shell commands on Android devices for advanced device control and automation.
Used as the implementation language for the ADB MCP server, providing typed interfaces for Android device interactions.
Allows retrieval and analysis of Android UI hierarchy in XML format to understand and interact with device interfaces.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@ADB MCP Server take a screenshot of my connected device"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
ARCHIVED -- Use mobile-device-mcp
Quite surprised that this repo reached 50 stars (!) the ecosystem is quite generous sometimes, thank you for starring it!
I've been working on something that is faster, more scalable and also works with iOS, take a look at mobile-device-mcp.
And leave some ⭐ too :)
ADB MCP Server
An MCP (Model Context Protocol) server for interacting with Android devices through ADB. This TypeScript-based tool provides a bridge between AI models and Android device functionality.
Related MCP server: mcp-android-emulator
Features
📱 Device Management - List and interact with connected Android devices
📦 App Installation - Deploy APK files to connected devices
📋 Logging - Access device logs through logcat
🔄 File Transfer - Push and pull files between device and host
📸 UI Interaction - Capture screenshots and analyze UI hierarchy
🔧 Shell Command Execution - Run custom commands on the device
Prerequisites
Node.js (v16 or higher recommended, tested with Node.js v16, v18, and v20)
ADB (Android Debug Bridge) installed and in your PATH
An Android device or emulator connected via USB or network with USB debugging enabled
Permission to access the device (accepted debugging authorization on device)
Installation
Installing via Smithery
To install ADB Android Device Server for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @srmorete/adb-mcp --client claudeManual Installation
# Clone the repository
git clone https://github.com/srmorete/adb-mcp.git
cd adb-mcp
# Install dependencies
npm install
# Build the TypeScript code
npm run build
# Run the server
npx adb-mcpConfiguration
ADB Path Configuration
The server uses default ADB paths. For custom ADB location:
export ADB_PATH=/path/to/adb
npx adb-mcpMCP Configuration
Add the ADB MCP server configuration:
{
"mcpServers": {
"adb": {
"command": "npx",
"args": [
"adb-mcp"
]
}
}
}Usage
Starting the Server
IMPORTANT: The server must be running before using any ADB tools.
Start the server using:
npx adb-mcpYou should see:
[INFO] ADB MCP Server connected and readyKeep this terminal window open while using the ADB tools.
Available Tools
All tools are available with the following naming convention:
📱 Device Management
adb_devices- List connected devicesadb_shell- Execute shell commands on a device
📦 App Management
adb_install- Install an APK file using a local file pathadb_package_manager- Execute Package Manager (pm) commands - list packages, grant/revoke permissions, manage appsadb_activity_manager- Execute Activity Manager (am) commands - start activities, broadcast intents, control app behavior
📋 Logging
adb_logcat- View device logs with optional filtering
🔄 File Transfer
adb_pull- Pull files from a deviceadb_push- Push files to a device
🔍 UI Interaction
dump_image- Take a screenshot of the current screeninspect_ui- Get UI hierarchy in XML format (most useful for AI interaction)
Troubleshooting
If tools aren't working:
Server Issues:
Ensure the server is running (
npx adb-mcp)Check server output for error messages
Try detailed logs:
LOG_LEVEL=3 npx adb-mcpKill hanging processes:
ps aux | grep "adb-mcp" | grep -v grepthen
kill -9 [PID]
Device Connection:
Verify connection with
adb_devicesIf "unauthorized", accept debugging authorization on device
Check USB/network connections
Try restarting ADB:
adb kill-server && adb start-server
ADB Issues:
Verify ADB installation:
adb version
Device Setup:
Use an emulator (it was built using one), for real devices maybe try this:
Ensure USB debugging is enabled
For newer Android versions, enable "USB debugging (Security settings)"
Try different USB port or cable
or let me know in an issue
Compatibility
Android 8.0 and higher
MCP clients including Claude in Cursor IDE
Was built on macOS but should run on any POSIX compatible (Linux etc).
Did not try on Windows but maybe it works.
Contributing
Contributions are welcome! Submit a Pull Request.
For major changes, open an issue to discuss first.
You can, of course, also fork it
Note: this project was
vibe-codedso if you spot some weird stuff... well now you know 🙂
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
Built with Model Context Protocol (MCP)
Available Tools
10 toolsadb_activity_managerA
Executes Activity Manager (am) commands on a connected Android device. Supports starting activities, broadcasting intents, force-stopping packages, and other 'am' subcommands. Specify the subcommand (e.g. 'start', 'broadcast', 'force-stop') and arguments as you would in adb shell am. Example: amCommand='start', amArgs='-a android.intent.action.VIEW -d http://www.example.com'
Inputs: amCommand (required), amArgs, device.
adb_devicesA
Lists all connected Android devices and emulators with their status and details. Use this tool to identify available devices for interaction, verify device connections, and obtain device identifiers needed for other ADB commands. Returns a table of device IDs with connection states (device, offline, unauthorized, etc.). Useful before running any device-specific commands to ensure the target device is connected.
Inputs: random_string.
adb_installA
Installs an Android application (APK) on a connected device or emulator. Use this for deploying applications, testing new builds, or updating existing apps. Provide the local path to the APK file for installation. Automatically handles the installation process, including replacing existing versions. Specify a device ID when working with multiple connected devices.
Inputs: apkPath (required), device.
adb_logcatA
Retrieves Android system and application logs from a connected device. Ideal for debugging app behavior, monitoring system events, and identifying errors. Supports filtering by log tags or expressions to narrow down relevant information. Results can be limited to a specific number of lines, making it useful for both brief checks and detailed analysis. Use when troubleshooting crashes, unexpected behavior, or performance issues.
Inputs: filter, device, lines.
adb_package_managerB
Executes Package Manager (pm) commands on a connected Android device. Supports listing packages, installing/uninstalling apps, managing permissions, and other 'pm' subcommands. Common commands include: 'list packages', 'install', 'uninstall', 'grant', 'revoke', 'clear', 'enable', 'disable'. Example: pmCommand='list', pmArgs='packages -3' (lists third-party packages) or pmCommand='grant', pmArgs='com.example.app android.permission.CAMERA'
Inputs: pmCommand (required), pmArgs, device.
adb_pullA
Transfers a file from a connected Android device to the server. Use this to retrieve app data files, logs, configurations, or any accessible file from the device. The file content can be returned as base64-encoded data or as a success message. Requires the full path to the file on the device. Useful for data extraction, log collection, and backing up device files.
Inputs: remotePath (required), device, asBase64.
adb_pushA
Transfers a file from the server to a connected Android device. Useful for uploading test data, configuration files, media content, or any file needed on the device. The file must be provided as base64-encoded content. Requires specifying the full destination path on the device where the file should be placed. Use this when setting up test environments, restoring backups, or modifying device files.
Inputs: fileBase64 (required), remotePath (required), device.
adb_shellA
Executes a shell command on a connected Android device or emulator. Use this for running Android system commands, managing files and permissions, controlling device settings, or interacting with Android components. Supports all standard shell commands available on Android (ls, pm, am, settings, etc.). Specify a device ID to target a specific device when multiple devices are connected.
Inputs: command (required), device.
dump_imageA
Captures the current screen of a connected Android device. FOR HUMAN VIEWING ONLY: This tool provides a visual image that cannot be easily processed programmatically. The screenshot shows exactly what appears on the device screen at the moment of capture. The default behavior returns a success message. Use asBase64=true to get the image as base64-encoded data. No additional parameters required beyond an optional device ID. Use when you need to visually verify UI elements for human inspection only. NOTE: For programmatic analysis or to identify UI elements, use inspect-ui instead.
Inputs: device, asBase64.
inspect_uiA
Captures the complete UI hierarchy of the current screen as an XML document. This provides structured XML data that can be parsed to identify UI elements and their properties. Essential for UI automation, determining current app state, and identifying interactive elements. Returns the UI structure including all elements, their IDs, text values, bounds, and clickable states. This is significantly more useful than screenshots for AI processing and automation tasks.
Inputs: device, outputPath, asBase64.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 10 tools
Each tool targets a distinct ADB functionality, from device listing and file transfer to UI inspection and package management, with no overlapping purposes.
Most tools follow 'adb_' prefix, but 'dump_image' and 'inspect_ui' lack the prefix, creating a minor inconsistency in an otherwise predictable pattern.
With 10 tools, the collection covers essential ADB operations without being excessive or insufficient, well-scoped for typical device management tasks.
The set covers major ADB workflows including device management, app installation, logging, file transfer, and UI inspection, though a dedicated uninstall tool is absent.
Maintenance
Related MCP Connectors
Give your AI agent a real cloud Android phone: push APKs, drive it, get screenshots and logs.
Cloud Android phones for AI agents: create a phone, read the screen, tap, type, install APKs, park.
Let AI agents control Android and iOS devices on Mobilerun Cloud: screen, input, apps, workflows.
Drive real devices from your AI Coding tool. Embed a client SDK (Unity, Godot, Flutter, iOS/macOS, Android, React Native, Web) in your app, then capture screenshots, traverse the UI tree, inject taps and key events, and run automated test tasks on the physical device over a secure relay.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables LLMs to control and manage Android devices via ADB, including app installation, UI interaction, and device monitoring.3512GPL 3.0
- AlicenseBqualityDmaintenanceEnables AI assistants to interact with Android devices and emulators via ADB, providing tools for screenshots, UI inspection, touch and text input, app management, and device control.42200 npm22MIT
- AlicenseAqualityDmaintenanceEnables AI models to control Android devices via ADB through natural language commands, supporting screen analysis and automated actions.346 npmMIT
- AlicenseAqualityBmaintenanceSecure, read-only MCP server that lets AI assistants (Claude, OpenCode, VS Code) inspect Android devices via ADB — logcat, UI hierarchy, installed packages, and allowlisted shell commands. TypeScript/Node.js.523 npm1ISC