Android MCP Server
Provides full control over Android devices via ADB, enabling an AI agent to manage apps, perform UI automation, capture and analyze screenshots, and interact with the device through touch and hardware key emulation.
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., "@Android MCP Server Open the Settings app and take a screenshot of the battery status"
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.
Android MCP Server
A production-grade MCP (Model Context Protocol) server that gives any AI agent full control over Android devices via ADB, UIAutomator, Accessibility, and Vision (screenshots).
Features
30+ MCP Tools — Device control, app management, UI automation, vision, testing
Multi-Device Support — Control multiple Android devices simultaneously
Smart Execution — UIAutomator → Accessibility → Vision → Coordinates fallback
Security — Input sanitization, rate limiting, device allowlisting, destructive op protection
Automation — Action recording/replay, test scenarios, state tracking
Observability — Structured JSON logs, per-tool metrics, action history
Related MCP server: android-mcp
Prerequisites
Node.js ≥ 18
ADB installed and on PATH (Android SDK Platform Tools)
An Android device or emulator connected via USB/WiFi
Verify ADB is working:
adb devicesSetup
# Install dependencies
npm install
# Build TypeScript
npm run build
# Run the server
npm startMCP Client Configuration
Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"android": {
"command": "node",
"args": ["repo_path/dist/mcp/server.js"],
"env": {
"ADB_PATH": "adb"
}
}
}
}Cursor
Add to your Cursor MCP settings:
{
"mcpServers": {
"android": {
"command": "node",
"args": ["repo_path/dist/mcp/server.js"]
}
}
}Generic MCP Client (stdio)
node dist/mcp/server.jsThe server communicates via stdin/stdout using the MCP JSON-RPC protocol.
Configuration
Create android-mcp.config.json in the project root (optional):
{
"adbPath": "adb",
"allowedDevices": [],
"maxActionsPerMinute": 120,
"commandTimeoutMs": 30000,
"maxRetries": 3,
"debug": false,
"screenshotDir": "./screenshots",
"recordingsDir": "./recordings",
"allowDestructiveOps": false
}Or use environment variables:
Variable | Description |
| Path to adb binary |
| Comma-separated device IDs |
| Rate limit per device |
| ADB command timeout |
| Auto-retry count |
| Enable debug logging |
| Allow uninstall etc. |
Available Tools
Device Management
Tool | Description |
| List connected Android devices |
| Get device model, OS, screen size |
| Get screen resolution |
Input Controls
Tool | Description |
| Tap at coordinates |
| Swipe between points |
| Long press at coordinates |
| Double tap at coordinates |
| Type text into focused field |
| Press hardware/software key |
App Management
Tool | Description |
| List installed applications |
| Launch an app by package name |
| Force-stop an app |
| Install an APK file |
| Uninstall an app (requires config) |
| Get foreground app package |
File System
Tool | Description |
| List files on device |
| Download file from device |
| Upload file to device |
UI Automation (UIAutomator)
Tool | Description |
| Capture UI hierarchy |
| Find element by selector |
| Find and click element |
| Wait for element to appear |
| Check if element exists |
Vision
Tool | Description |
| Capture device screenshot |
| Screenshot + UI tree analysis |
| Detect interactive elements |
| Detect screen changes |
Automation & Testing
Tool | Description |
| Multi-strategy element click |
| Execute test steps |
| Start recording actions |
| Stop and save recording |
| Replay recorded actions |
| List saved recordings |
| Get device state summary |
| Get performance metrics |
Architecture
src/
├── mcp/
│ └── server.ts # MCP server entry point
├── controllers/
│ ├── device-tools.ts # Device MCP tools
│ ├── input-tools.ts # Input MCP tools
│ ├── app-tools.ts # App management MCP tools
│ ├── file-tools.ts # File system MCP tools
│ ├── ui-tools.ts # UIAutomator MCP tools
│ ├── vision-tools.ts # Vision MCP tools
│ └── automation-tools.ts # Automation MCP tools
├── adb/
│ ├── adb-executor.ts # Safe ADB command execution
│ ├── device-manager.ts # Device discovery & sessions
│ ├── input-controller.ts # Touch/key input
│ ├── app-manager.ts # App lifecycle
│ └── file-manager.ts # File operations
├── uiautomator/
│ ├── ui-tree-parser.ts # XML → JSON conversion
│ ├── element-finder.ts # Element search & interaction
│ └── element-cache.ts # LRU element cache
├── vision/
│ ├── screenshot.ts # Screenshot capture
│ ├── screen-diff.ts # Screenshot comparison
│ └── visual-analyzer.ts # AI-ready screen analysis
├── accessibility/
│ ├── accessibility-bridge.ts # Accessibility fallback
│ └── smart-executor.ts # Multi-strategy executor
├── automation/
│ ├── action-recorder.ts # Action recording
│ ├── action-replayer.ts # Action replay
│ ├── test-runner.ts # Test scenarios
│ └── state-tracker.ts # Device state memory
├── security/
│ ├── validator.ts # Input sanitization
│ └── rate-limiter.ts # Rate limiting
└── utils/
├── logger.ts # Structured logging
├── config.ts # Configuration
├── errors.ts # Error hierarchy
├── retry.ts # Retry logic
└── metrics.ts # Performance trackingTesting
npm test
npm run test:coverageDevelopment
# Run in development mode (ts-node)
npm run dev
# Test with MCP Inspector
npx @modelcontextprotocol/inspector node dist/mcp/server.jsLicense
MIT
Available Tools
37 toolsanalyze_screenA
Capture a screenshot and analyze the screen content. Returns both the visual screenshot and a text summary of the UI tree for comprehensive screen understanding. Use this when you need to understand the full screen context.
Inputs: device_id.
assert_element_existsA
Check whether a UI element exists on the current screen. Returns true/false without throwing an error. Useful for test assertions and conditional logic.
Inputs: selector (required), device_id.
capture_screenshotA
Capture a screenshot of the current Android device screen. Returns a base64-encoded PNG image that can be displayed or analyzed visually. Use this to see what is currently on screen.
Inputs: save_to_disk, device_id.
click_elementA
Find a UI element matching the selector and tap its center. This is the preferred way to interact with UI elements rather than using raw coordinates.
Inputs: selector (required), device_id.
close_appB
Force-stop an Android application by its package name.
Inputs: package_name (required), device_id.
compare_screenshotsA
Compare the current screen with the previously captured screenshot to detect changes. Returns the percentage of pixels that changed and whether the screen has significantly changed. Useful for verifying that an action had an effect.
Inputs: threshold, device_id.
detect_elements_visuallyA
Detect interactive elements on the screen using a combination of screenshots and UI tree analysis. Returns a list of all clickable/focusable elements with their coordinates and descriptions. Use this when you need to find elements to interact with.
Inputs: device_id.
double_tapA
Double tap at specific coordinates on the Android screen. Useful for zooming or selecting text.
Inputs: x (required), y (required), device_id.
find_elementA
Find a UI element on the Android screen matching the given selector criteria. Returns the first matching element with its properties and bounds. Use this to locate buttons, text fields, or any UI component before interacting with it.
Inputs: selector (required), device_id.
get_current_appA
Get the package name of the currently focused/foreground Android application.
Inputs: device_id.
get_device_infoA
Get detailed information about a connected Android device including model, Android version, SDK version, screen size, brand, and manufacturer
Inputs: device_id.
get_device_stateA
Get the current tracked state of a device including current app, screen history, and recent actions. Useful for understanding context.
Inputs: device_id.
get_metricsA
Get performance metrics and action history for the MCP server. Shows per-tool latency, success/failure counts.
Inputs: no named parameters.
get_screen_sizeA
Get the screen resolution (width x height in pixels) of the connected Android device
Inputs: device_id.
get_ui_treeA
Capture the current UI hierarchy from the Android screen. Returns a structured representation of all visible UI elements with their properties, text, bounds, and states. This is the primary way to understand what is currently on screen.
Inputs: format, device_id.
health_checkA
Check the health status of the MCP server and ADB connectivity. Returns server uptime, ADB availability, connected device count, and configuration summary.
Inputs: no named parameters.
input_textA
Type text into the currently focused input field on the Android device. The field must already be focused (tapped).
Inputs: text (required), device_id.
install_apkC
Install an APK file onto the Android device from a local file path.
Inputs: local_path (required), device_id.
list_appsA
List installed applications on the Android device. By default shows third-party apps only.
Inputs: include_system, device_id.
list_devicesA
List all connected Android devices with their status and model information
Inputs: no named parameters.
list_filesA
List files and directories at a given path on the Android device. Returns file names, types, sizes, and permissions.
Inputs: path (required), device_id.
list_pluginsA
List all loaded MCP server plugins and their versions.
Inputs: no named parameters.
list_recordingsB
List all saved action recordings/macros.
Inputs: no named parameters.
long_pressA
Long press at specific coordinates on the Android screen. Useful for context menus, drag initiation, or selection.
Inputs: x (required), y (required), duration, device_id.
open_appA
Launch an Android application by its package name (e.g. com.google.android.youtube). The app must be installed.
Inputs: package_name (required), device_id.
press_keyA
Press a hardware/software key on the Android device. Common keycodes: HOME, BACK, MENU, ENTER, VOLUME_UP, VOLUME_DOWN, POWER, DEL, TAB, SPACE, APP_SWITCH, SEARCH, CAMERA.
Inputs: keycode (required), device_id.
pull_fileA
Download a file from the Android device to the local machine.
Inputs: remote_path (required), local_path (required), device_id.
push_fileB
Upload a file from the local machine to the Android device.
Inputs: local_path (required), remote_path (required), device_id.
replay_recordingC
Replay a previously recorded action sequence.
Inputs: recording_path (required), delay_between_actions, stop_on_error, device_id.
run_test_scenarioA
Execute an ordered test scenario with multiple steps and assertions. Each step performs an action and optionally verifies the result. Returns detailed pass/fail results per step.
Inputs: name (required), steps (required), stop_on_failure, device_id.
smart_clickA
Intelligently click an element using multiple strategies: UIAutomator → Accessibility → Vision → Coordinates fallback. This is the most reliable way to click elements.
Inputs: selector (required), fallback_x, fallback_y, device_id.
start_recordingA
Start recording actions to create a macro. All subsequent tool calls will be recorded. Use stop_recording to save.
Inputs: name (required), device_id.
stop_recordingA
Stop the active recording and save it to disk.
Inputs: recording_id (required).
swipeA
Swipe from one point to another on the Android screen. Useful for scrolling, swiping between pages, or drag gestures.
Inputs: x1 (required), y1 (required), x2 (required), y2 (required), +2 more.
tapA
Tap at specific coordinates on the Android screen. Coordinates can be absolute pixels or normalized (0-1 range, will be scaled to screen size).
Inputs: x (required), y (required), device_id.
uninstall_appA
Uninstall an application from the Android device. Requires allowDestructiveOps to be enabled in server configuration.
Inputs: package_name (required), device_id.
wait_for_elementA
Wait for a UI element to appear on screen within a timeout period. Useful after navigation, loading screens, or animations. Polls the UI tree at regular intervals until the element is found.
Inputs: selector (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 37 tools
Most tools have distinct purposes, but there is some overlap that could cause confusion. For example, 'analyze_screen', 'capture_screenshot', and 'get_ui_tree' all involve screen capture and analysis, with 'analyze_screen' combining both visual and UI tree aspects, potentially making it ambiguous when to use each. Similarly, 'click_element' and 'smart_click' both handle clicking, though 'smart_click' is described as more reliable with fallback strategies, which helps differentiate them. Overall, the tools are well-defined, but a few overlaps exist.
Tool names follow a highly consistent snake_case pattern with clear verb_noun structures throughout, such as 'analyze_screen', 'click_element', 'get_device_info', and 'list_apps'. There are no deviations in naming conventions, making it easy to predict and understand tool purposes based on their names.
With 37 tools, the count is borderline high for an Android automation server. While it covers a wide range of functionalities from UI interaction to file management and testing, it may feel heavy and overwhelming for agents to navigate efficiently. A more focused set of 15-25 tools might improve usability without sacrificing core capabilities.
The tool set provides comprehensive coverage for Android automation, including UI interaction (e.g., click, swipe, input), device management (e.g., install, uninstall, get info), file operations (e.g., push, pull, list), testing support (e.g., run_test_scenario, assert_element_exists), and recording features. There are no obvious gaps; it supports full lifecycle operations from app installation to UI testing and performance monitoring.
Maintenance
Related MCP Connectors
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.
Give your AI agent a real cloud Android phone: push APKs, drive it, get screenshots and logs.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables AI agents to control Android devices and emulators through direct UI interaction, allowing app navigation, automated testing, and real-world task execution via ADB without computer vision or scripts.182MIT
- AlicenseBqualityDmaintenanceEnables AI agents to control Android devices via ADB, supporting gestures, input, screenshots, UI analysis, and app management.1914 npm1ISC
- AlicenseCqualityCmaintenanceEnables an AI agent to see and control Android devices, including x86_64 emulators and redroid, through 68 tools covering gestures, typing, apps, notifications, files, browser control, and more.681MIT
- AlicenseNot gradedqualityAmaintenanceEnables AI agents to visually perceive and directly control Android devices via ADB and screen-control tooling, including screenshots, taps, swipes, typing, app management, UI inspection, file transfer, shell commands, and audio/video streaming.357 npmMIT