
一个通过adb控制安卓设备的MCP服务器
概览
一个MCP(模型上下文协议)服务器,通过ADB(Android调试桥)对Android设备进行程序控制。该服务器展示了多种Android设备管理功能,MCP客户端如Claude桌面和代码编辑器(如Cursor)可访问这些功能。 - 🔧 ADB命令执行 - 📸 设备截图捕捉 - 🎯 UI布局分析 - 📱 设备包管理 - Python 3.x - 已安装并配置的 ADB(Android 调试桥)- Android 设备或模拟器(未测试) 2. 安装依赖:本项目通过多种安装方式使用 uv 进行项目管理。 该服务器支持多种使用场景的灵活设备配置。 - 无需配置文件 - 自动连接到唯一连接的设备 - 非常适合单一测试设备开发 - 当你连接多个设备时使用 - 在配置文件中指定具体设备 配置文件(config.yaml)是 。
概述(AI 翻译)
一个MCP(模型上下文协议)服务器,提供对 通过 ADB(Android 调试桥)访问安卓设备。该服务器暴露 MCP 可访问的各种 Android 设备管理功能 客户端如 Claude 桌面版 以及代码编辑器 (例如光标)
特色
- 🔧 ADB命令执行
- 📸 设备截图捕捉
- 🎯 用户界面布局分析
- 📱 设备包管理
先修条件
- Python 3.x
- 安装并配置的 ADB(Android 调试桥)
- 安卓设备或模拟器(未测试)
安装
-
克隆仓库:
-
安装依赖: 本项目使用UV作为项目 通过各种管理方法 安装。
配置
该服务器支持多种使用场景的灵活设备配置。
设备选择模式
1.自动选择(推荐单设备使用)
- 无需配置文件
- 自动连接到唯一连接的设备
- 非常适合用单一测试设备开发
2.手动设备选择
- 连接多个设备时使用
- 在配置文件中指定具体设备
配置文件(可选)
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
android-pilot
Let an AI agent use an Android phone or emulator. android-pilot is an MCP server that drives your device over adb, so any MCP client (Claude Code, Codex, OpenCode, …) can read the screen and interact with it.
Why element refs
Most adb wrappers make the model read a screenshot or XML dump and guess pixel
coordinates. Here, snapshot returns compact text in which every actionable
element has a ref (e1, e2, …), and the interaction tools take that ref:
snapshot → e2 switch "Wi-Fi" [unchecked]
tap(ref="e2") → Tapped e2 switch "Wi-Fi" [unchecked]
The model never works out a coordinate, and the server refuses to act if the screen changed under it. Picking pixel positions is a well-known weak spot: in AppAgent (CHI 2025), GPT-4 completed 2.2% of Android tasks with raw coordinate actions and 48.9% with element-ID actions.
Requirements
- uv
- adb on your
PATH - An Android device with USB debugging enabled, or an emulator
Quick start
Add this to your MCP client’s config (most clients use this format; check your client’s docs for where the file lives):
{
"mcpServers": {
"android": {
"command": "uvx",
"args": ["android-pilot"]
}
}
}
Or, in Claude Code:
claude mcp add android -- uvx android-pilot
Then check that adb can see your device:
adb devices
List of devices attached
13b22d7f device
If it says unauthorized, unlock the phone and accept the “Allow USB
debugging” prompt. Restart your client and ask something like “Open Settings
and tell me which Wi-Fi network I’m connected to.”
Options
Add these after "android-pilot" in args:
| Option | Default | Purpose |
|---|---|---|
--device |
first device in adb devices |
Choose a device when several are connected: a serial (13b22d7f), emulator (emulator-5554) or wireless device (192.168.1.10:5555, after adb connect) |
--adb-path |
$ADB_PATH, then adb on PATH |
Pin the adb binary to use |
The server starts even if adb or the device isn’t ready yet, so you can plug
the phone in after starting your client. Until then, tools return an error
that says what’s missing, and the next call looks again. A wrong --adb-path
(or ADB_PATH) stops the server at startup instead. The device and adb binary
it picks are printed to stderr.
Tools
| Tool | Purpose |
|---|---|
snapshot(include_offscreen=False) |
The screen as compact text, with a ref for each actionable element |
安装
uvx android-pilot配置
{
"mcpServers": {
"android": {
"command": "uvx",
"args": ["android-pilot"]
}
}
}