Android MCP Server
Provides tools for controlling Android devices via ADB, including screenshot capture, UI analysis, app management, file transfer, and debugging.
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 take a screenshot of the current screen"
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
🤖 An MCP (Model Context Protocol) server designed for Android development, enabling AI assistants to directly control Android devices for screenshots, UI analysis, app management, and more.
Table of Contents
Related MCP server: scrcpy-mcp
Introduction
This project is built on the FastMCP framework and communicates with Android devices via ADB (Android Debug Bridge). It exposes 19 practical tools to AI assistants (such as Claude, CodeBuddy, etc.), covering the complete Android development and debugging workflow:
Screenshot → UI Analysis → Interaction → Logcat → App Management → File TransferPrerequisites
Python >= 3.11
uv package manager
ADB installed and added to PATH (
adb --versionworks)Android device connected or emulator running (
adb devicesrecognizes it)USB Debugging enabled on the Android device
Installation
# Clone the project
git clone https://github.com/huarangmeng/AndroidMcpServer
cd AndroidMcpServer
# Install dependencies
uv syncDependencies
Package | Version | Purpose |
| >= 1.2.0 | MCP framework |
| >= 10.3.0 | Screenshot processing |
Configuration
CodeBuddy
Add the following to ~/.codebuddy/mcp.json:
{
"mcpServers": {
"android_mcp": {
"command": "/Users/<your-username>/.local/bin/uv",
"args": [
"run",
"--project", "/path/to/AndroidMcpServer",
"python",
"/path/to/AndroidMcpServer/main.py",
"--mode", "stdio",
"--temp-dir", "/tmp/android_mcp"
],
"transportType": "stdio"
}
}
}Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"android_mcp": {
"command": "uv",
"args": [
"run",
"--project", "/path/to/AndroidMcpServer",
"python",
"/path/to/AndroidMcpServer/main.py",
"--mode", "stdio",
"--temp-dir", "/tmp/android_mcp"
]
}
}
}HTTP Mode
# Start HTTP server
uv run main.py --mode streamable-http --temp-dir /tmp/android_mcp --port 3001
# Service URL: http://localhost:3001/mcpTools
A total of 19 tools in 5 categories:
📸 Screenshot & UI Analysis
Tool | Description |
| Capture device screenshot (auto-scaled to 50%) |
| Get XML UI hierarchy with attribute filtering |
🖱️ Interaction
Tool | Parameters | Description |
|
| Tap at coordinates |
|
| Swipe gesture |
|
| Long press |
|
| Send text to focused input (English only) |
|
| System keys: BACK / HOME / RECENT_APPS |
📱 App Management
Tool | Parameters | Description |
|
| Launch app |
|
| Force stop app |
|
| Clear app data |
|
| Install APK |
|
| List installed apps |
|
| Grant runtime permission |
🔍 Debugging & Diagnostics
Tool | Parameters | Description |
|
| Get last 100 logcat lines |
| — | Get device model, OS version, etc. |
| — | Get current foreground Activity |
|
| View app memory usage |
📂 File Operations
Tool | Parameters | Description |
|
| Pull file from device |
|
| Push file to device |
Debugging
Use MCP Inspector for local debugging:
# Install MCP Inspector
npm install -g @modelcontextprotocol/inspector
# Start with config file
npx @modelcontextprotocol/inspector --config mcp-inspector-config.json --server android-stdioOr start manually:
# stdio mode
uv run main.py --mode stdio --temp-dir /tmp/android_mcp
# HTTP mode
uv run main.py --mode streamable-http --temp-dir /tmp/android_mcp --port 3001References
Available Tools
19 toolsclear_app_dataA
清除指定应用的所有数据和缓存(相当于「清除数据」操作)。
Inputs: package_name (required). Returns: result
force_stop_appB
强制停止指定包名的 Android 应用。
Inputs: package_name (required). Returns: result
get_app_listB
列出设备上已安装的应用包名列表。
Inputs: include_system_apps. Returns: result
get_current_activityA
获取当前前台运行的 Activity 名称,用于定位当前所在页面。
Inputs: no named parameters. Returns: result
get_device_infoA
获取已连接 Android 设备的基本信息,包括型号、系统版本、分辨率、序列号等。返回 JSON 格式字符串。
Inputs: no named parameters. Returns: result
get_logcat_outputB
从已连接的 Android 设备获取最近 100 行日志。
Inputs: app_package (required), log_level. Returns: result
get_memory_infoB
获取指定应用的内存占用信息(PSS、RSS 等)。
Inputs: package_name (required). Returns: result
get_screenshotA
获取已连接 Android 设备的屏幕截图。 用于检查界面视觉效果;若需识别元素,优先使用 get_ui_dump。
Inputs: no named parameters.
get_ui_dumpA
获取 XML 格式的 UI 视图层级,用于理解屏幕结构和定位元素。
Inputs: returned_attributes (required). Returns: result
grant_permissionC
为指定应用授予运行时权限。
Inputs: permission (required), package_name (required). Returns: result
install_apkB
将本地 APK 文件安装到已连接的 Android 设备。
Inputs: apk_path (required), replace_existing. Returns: result
launch_appB
启动指定包名的 Android 应用(使用 monkey 命令)。
Inputs: package_name (required). Returns: result
long_pressB
在屏幕指定坐标执行长按操作(通过零距离滑动模拟)。
Inputs: x (required), y (required), duration_ms. Returns: result
perform_system_actionB
执行系统级操作,如返回、回到主页或打开最近任务列表。
Inputs: action (required). Returns: result
pull_fileC
从 Android 设备拉取文件到本地。
Inputs: local_path (required), device_path (required). Returns: result
push_fileC
将本地文件推送到 Android 设备。
Inputs: local_path (required), device_path (required). Returns: result
send_textA
模拟键盘向当前焦点输入框发送文本。注意:不支持中文,中文请使用其他输入法方案。
Inputs: text_to_send (required). Returns: result
swipe_screenC
在屏幕上执行滑动操作,从起点滑动到终点。
Inputs: x1 (required), x2 (required), y1 (required), y2 (required), +1 more. Returns: result
tap_screenA
在屏幕指定坐标执行点击操作。坐标应从 get_ui_dump 的 bounds 属性动态获取。
Inputs: x (required), y (required). Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 19 tools
Each tool targets a distinct device operation with clear boundaries: gestures (tap/long_press/swipe), file transfer (push/pull), app lifecycle (launch/force_stop/clear_data/install), and info gathering (device/memory/logcat/activity) do not overlap. The descriptions even disambiguate similar tools like get_ui_dump vs get_screenshot, directing agents to the right one.
All names are snake_case and verb-first, following a predictable verb_noun pattern (get_device_info, push_file, launch_app, clear_app_data). Minor variation like long_press/tap_screen still fits the scheme cleanly.
19 tools is slightly above the ideal 3-15 band but each earns its place in a device-automation surface. The set is cohesive rather than padded, so it's a minor overage rather than a scope mismatch.
Strong coverage of input, app lifecycle, file transfer, permissions, and introspection for Android automation. Minor gaps exist (no uninstall/revoke_permission, no element-text convenience, no waiting/rotation), but core workflows are fully supported.
Maintenance
Related MCP Connectors
MCP server that lets your AI assistant build and deploy apps, hosting each one at a live URL.
MCP server for building and testing AI agents with multi-model experimentation and insights.
Give your AI agent a real cloud Android phone: push APKs, drive it, get screenshots and logs.
Melaya is a remote MCP server. It gives an assistant hands on your own Android phone and browser: it reads the screen through the accessibility tree, then taps, types and navigates inside the apps and sites you allow-list, with no per-app API. It also builds, schedules and runs agent pipelines across 6k+ connected tools. OAuth 2.1, nothing to install.
Related MCP Servers
- FlicenseAqualityCmaintenanceA MCP server that enables AI assistants to control Android devices via ADB, supporting device info, screen control, input simulation, app management, shell execution, file transfer, and UI parsing.20-
- AlicenseAqualityCmaintenanceMCP 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.38392 npm136MIT
- AlicenseNot gradedqualityBmaintenanceAn MCP server that provides tools for controlling Android devices using uiautomator2, enabling AI to automate tasks like tapping, swiping, and managing apps.186 PyPI55Apache 2.0
- AlicenseBqualityDmaintenanceAn MCP server that allows AI agents to drive real Android devices via adb, capturing screenshots, reading the live UI tree, and performing actions like tap, swipe, and type.135 npm1Apache 2.0