android-mcp-server
The android-mcp-server enables AI assistants to control, test, and debug Android devices/emulators via ADB — no app modifications required.
Device Management
List connected devices/emulators and available AVDs
Start emulators by name (waits up to 60s for boot)
Get device info (model, manufacturer, Android version, API level, screen size, DPI)
Screenshot & UI Analysis
Capture screenshots (with optional save to disk)
Retrieve full UI element hierarchy (bounds, text, resource IDs, state)
Touch & Input Interaction
Tap at coordinates or target elements by resource-id, text, or content-desc
Long press, double tap, multi-tap, and swipe gestures
tap_and_wait— tap, wait for UI to settle, and return the new UI tree in one steptap_sequence— execute multi-step action chainsScroll until a target element is visible; wait for elements with configurable timeout
Type text into focused fields; press hardware/software keys (back, home, enter, volume, power, D-pad, etc.)
App Management
Launch apps by package name/activity, install APKs, get current foreground activity
Pull files from device to local filesystem
Run arbitrary ADB shell commands
Diagnostics & Logging
Retrieve logcat output filtered by package, log level, line count, or timestamp
Clear the logcat buffer
Multi-device support — target specific devices by ID across all operations.
Provides tools for comprehensive Android device and emulator control via ADB, including screenshot capture, UI tree inspection, touch automation, logcat analysis, and app lifecycle management.
Integrates with Android SDK components to manage Android Virtual Devices (AVDs), enabling the listing and launching of emulators directly through the MCP server.
Android MCP Server
MCP server for controlling Android emulators and devices via ADB. Gives AI assistants the ability to see, interact with, and debug Android apps — taking screenshots, tapping elements, reading logs, and documenting bugs.
npm Package | GitHub | Issues
^ Sped up for better viewing. More demos and test cases.
Features
25 tools for complete Android device control
Screenshot capture with intelligent compression (Sharp-based, max 1280px)
UI tree inspection — read element hierarchy with bounds, text, resource IDs, and state
Touch automation — tap, swipe, scroll, type text, press hardware keys
Element targeting — find and tap elements by resource-id, text, or content-desc
App lifecycle — install APKs, launch apps, inspect current activity
Logcat integration — filter by package, log level, or timestamp
Device management — list devices, start emulators, get device info
Compound actions —
tap_and_waitcombines tap + settle + UI tree in one round tripPersistent ADB shell — reuses a single shell session for faster command execution
Device info caching — queries device properties once per session
Multi-device support — target specific devices by ID
Zero app modifications — works with any Android app via ADB, no SDK integration needed
Related MCP server: scrcpy-mcp
Prerequisites
Node.js 18+
Android SDK with platform-tools (ADB) and emulator
A running Android emulator or connected device
Finding your ANDROID_HOME
The server auto-discovers the SDK at ~/Library/Android/sdk (macOS) or via ANDROID_HOME. If your SDK is elsewhere, set ANDROID_HOME in the MCP config (see below).
To check:
# macOS
ls ~/Library/Android/sdk/platform-tools/adb
# Or find it via Android Studio: Settings > Languages & Frameworks > Android SDKSetup
claude mcp add --scope user android -- npx -y android-mcp-serverThis registers the server globally so it's available in all projects. Use --scope project instead to limit it to the current project.
If your SDK is not in the default location:
claude mcp add --scope user --env ANDROID_HOME=/path/to/sdk android -- npx -y android-mcp-serverAdd to your Claude Desktop config file:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"android": {
"command": "npx",
"args": ["-y", "android-mcp-server"],
"env": {
"ANDROID_HOME": "/path/to/android/sdk"
}
}
}
}Add to your VS Code settings (.vscode/settings.json):
{
"mcp": {
"servers": {
"android": {
"command": "npx",
"args": ["-y", "android-mcp-server"],
"env": {
"ANDROID_HOME": "/path/to/android/sdk"
}
}
}
}
}Add to your Cursor MCP config (~/.cursor/mcp.json):
{
"mcpServers": {
"android": {
"command": "npx",
"args": ["-y", "android-mcp-server"],
"env": {
"ANDROID_HOME": "/path/to/android/sdk"
}
}
}
}Add to your Windsurf MCP config (~/.codeium/windsurf/mcp_config.json):
{
"mcpServers": {
"android": {
"command": "npx",
"args": ["-y", "android-mcp-server"],
"env": {
"ANDROID_HOME": "/path/to/android/sdk"
}
}
}
}Add to your project's .mcp.json (checked into version control so your team gets it too):
{
"mcpServers": {
"android": {
"command": "npx",
"args": ["-y", "android-mcp-server"],
"env": {
"ANDROID_HOME": "/path/to/android/sdk"
}
}
}
}git clone https://github.com/martingeidobler/android-mcp-server.git
cd android-mcp-server
npm install
npm run build
claude mcp add --scope user android -- node /path/to/android-mcp-server/dist/index.jsAvailable Tools
Device Management
Tool | Description |
| List connected Android devices and emulators |
| List available Android Virtual Devices |
| Start an AVD by name (waits up to 60s) |
Screenshot & UI Analysis
Tool | Description |
| Take screenshot for visual analysis. Optional |
| Get UI element hierarchy with bounds, text, resource IDs, and state |
Interaction
Tool | Description |
| Tap at screen coordinates |
| Tap element by resource-id, text, or content-desc |
| Tap element, wait for UI to settle, return new UI tree — single round trip |
| Long press at coordinates (context menus, drag handles) |
| Double tap at coordinates |
| Tap the same coordinates N times with a fixed interval (spam tapping) |
| Multi-step action chain: taps, waits, text input, key presses, swipes in any order |
| Type text into focused input |
| Press key (back, home, enter, tab, delete, menu, etc.) |
| Swipe gesture between coordinates |
| Scroll until element is visible |
| Wait for element to appear (with timeout) |
Diagnostics
Tool | Description |
| Get logcat output, filterable by package, log level, and time |
| Clear logcat buffer (call before reproducing a bug for clean output) |
| Get model, Android version, API level, screen size, DPI |
App Management
Tool | Description |
| Launch app by package name |
| Install APK file |
| Get foreground app and activity |
| Pull a file from the device to local filesystem |
| Run arbitrary ADB shell command |
Example Workflows
Bug documentation
"Clear the logs, open the settings screen, tap the save button, then show me the logs and a screenshot"
Claude will: clear_logs → launch_app → tap_element → get_logs(package_name="com.example.app", level="E") → screenshot(save_path="./bugs/settings-crash.png")
UI testing
"Navigate through the login flow and verify each screen matches the designs"
Claude will use screenshot + get_ui_tree to see and understand each screen, tap_element/type_text to interact, and its vision capabilities to compare against mockups or descriptions.
Smoke testing
"Install the APK, launch the app, and tap through the main screens to check nothing crashes"
Claude will: install_apk → launch_app → navigate with tap_element → get_logs(level="E") to check for errors after each screen.
Element interaction
"Open Settings, search for 'display', tap the first result, then go back"
Claude will: launch_app(package_name="com.android.settings") → tap_and_wait(by="text", value="Search settings") → type_text("display") → tap_and_wait(by="text", value="Display") → press_key(key="back")
Demos & Prompting Guide
DEMOS.md — copy-paste prompt scenarios you can try right now
PROMPTING.md — best practices, performance tips, and common pitfalls
How It Works
The server communicates over stdio using the Model Context Protocol. All device interaction goes through ADB — no modifications to your app are required. Screenshots are captured in memory, compressed, and returned as base64 images that the AI can see and analyze visually.
Contributing
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
License
MIT - see LICENSE.
Available Tools
21 toolsadb_shellC
Run an arbitrary ADB shell command
Inputs: command (required), device_id.
clear_logsA
Clear the logcat buffer. Call this before reproducing a bug to get clean logs.
Inputs: device_id.
get_current_activityC
Get the currently displayed app and activity
Inputs: device_id.
get_device_infoB
Get device details: model, manufacturer, Android version, API level, screen size, and DPI.
Inputs: device_id.
get_logsA
Get device logcat output. Use to find crashes, exceptions, and errors after reproducing a bug.
Inputs: package_name, level, lines, since, +1 more.
get_ui_treeA
Get the UI element hierarchy of the current screen. Returns interactive elements with their bounds, text, resource IDs, and state. Use this to find elements before tapping.
Inputs: device_id.
install_apkC
Install an APK file on the device
Inputs: apk_path (required), device_id.
launch_appC
Launch an Android app by package name
Inputs: package_name (required), activity, device_id.
list_avdsB
List available Android Virtual Devices
Inputs: no named parameters.
list_devicesA
List connected Android devices and emulators
Inputs: no named parameters.
press_keyC
Press a hardware/software key
Inputs: key (required), device_id.
pull_fileC
Pull a file from the Android device to the local filesystem.
Inputs: remote_path (required), local_path (required), device_id.
screenshotA
Take a screenshot of the Android device. Returns the image for visual analysis. Optionally saves to a file path.
Inputs: device_id, save_path.
scroll_to_elementA
Scroll down repeatedly until an element matching the given criteria is visible
Inputs: by (required), value (required), max_scrolls, device_id.
start_emulatorA
Start an Android emulator. Waits up to 60s for it to come online.
Inputs: avd_name (required).
swipeC
Perform a swipe gesture on the screen
Inputs: start_x (required), start_y (required), end_x (required), end_y (required), +2 more.
tapC
Tap at specific screen coordinates
Inputs: x (required), y (required), device_id.
tap_and_waitA
Tap element then wait for UI to settle and return the new UI tree. Combines tap + wait + get_ui_tree into a single fast operation.
Inputs: by (required), value (required), wait_ms, device_id.
tap_elementA
Tap a UI element by its resource-id, text, or content-desc. Finds the element in the UI tree and taps its center.
Inputs: by (required), value (required), device_id.
type_textB
Type text into the currently focused input field
Inputs: text (required), device_id.
wait_for_elementB
Wait for a UI element to appear on screen. Polls every 500ms.
Inputs: by (required), value (required), timeout_ms, device_id.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 21 tools
Most tools have distinct purposes, but there is some overlap between tap, tap_element, and tap_and_wait, which could cause confusion about when to use each. The descriptions help clarify differences, but the boundaries are not entirely clear.
Tools follow a consistent verb_noun or verb_pattern naming style (e.g., get_device_info, list_devices, tap_element), with minor deviations like adb_shell (noun_verb) and scroll_to_element (verb_preposition_noun). Overall, the naming is readable and mostly predictable.
With 21 tools, the count is borderline high for an Android testing/automation server, potentially feeling heavy. However, it covers a broad range of operations, so it's not excessive, but could be streamlined for better focus.
The tool set provides comprehensive coverage for Android device interaction, including device management, UI automation, debugging, and file operations. There are no obvious gaps; it supports full workflows from setup to testing and analysis.
Maintenance
Related MCP Connectors
Let Claude, ChatGPT and other agents use your Android phone: see the screen, tap, type, open apps.
1Give your AI agent a real cloud Android phone: push APKs, drive it, get screenshots and logs.
Disposable cloud Android emulators for coding agents: run an APK or PR build, tap, type, screenshot.
Cloud Android phones for AI agents: create a phone, read the screen, tap, type, install APKs, park.
Related MCP Servers
- AlicenseAqualityCmaintenanceEnables AI agents to control, inspect, and automate Android devices, Waydroid containers, and AVD emulators over ADB. Provides tools for screenshots, UI-hierarchy text-based tapping, gestures, key presses, text input, app management, and raw shell commands.12MIT
- AlicenseNot gradedqualityAmaintenanceEnables AI agents to see and control Android devices over ADB and scrcpy, with image-returning screenshots, taps, swipes, typing, app and file management, UI element inspection, shell commands, and video/audio streaming or recording. It offers fast scrcpy-based input and screenshots with automatic ADB fallback so tools keep working when scrcpy isn't available.801 npmMIT
- AlicenseNot gradedqualityAmaintenanceGives AI agents vision and control over Android devices through ADB and scrcpy, enabling them to capture screenshots, tap, swipe, type, launch and manage apps, inspect UI elements, stream audio and video, transfer files, and run shell commands. Input and screenshots run over a fast binary control protocol when a session is active, with ADB fallback so interaction keeps working without scrcpy.801 npmMIT
- AlicenseBqualityBmaintenanceEnables AI agents to inspect and control Android devices through ADB, including shell commands, logcat, UI automation, app management, screenshots, and file transfer, even inside Termux/proot without a native adb binary.41MIT