MCP Android Agent
MCP Android 代理
该项目提供了一个**MCP(模型上下文协议)**服务器,用于使用uiautomator2实现 Android 设备的自动化。它旨在轻松接入 GitHub Copilot Chat、Claude 或 Open Interpreter 等 AI 代理,从而通过自然语言控制 Android 设备。
快速演示


Related MCP server: Android ADB MCP Server
要求
Python 3.13 或更高版本
Android 调试桥 (adb) 已安装并位于 PATH 中
已连接 Android 设备并启用 USB 调试
uiautomator2兼容的 Android 设备
特征
通过软件包名称启动、停止和管理应用程序
检索已安装的应用程序和当前前台应用程序
点击、滑动、滚动、拖动并执行 UI 交互
获取设备信息、屏幕分辨率、电池状态等
捕获屏幕截图或最后的提示消息
以编程方式解锁、唤醒或使屏幕进入睡眠状态
清除应用程序数据并等待活动
包括健康检查和
adb诊断工具
用例
适合:
需要与真实设备交互的AI代理
远程设备控制设置
自动化质量保证工具
Android 机器人框架
UI 测试和自动化
设备管理和监控
安装
1. 克隆仓库
git clone https://github.com/nim444/mcp-android.git
cd mcp-android2.创建并激活虚拟环境
# Using uv (https://github.com/astral-sh/uv)
uv venv
source .venv/bin/activate # On Windows: .venv\\Scripts\\activate3.安装依赖项
uv pip install运行服务器
选项 1:使用 uvicorn(推荐)
uvicorn server:app --factory --host 0.0.0.0 --port 8000选项 2:使用 MCP stdio(用于 AI 代理集成)
python server.py用法
使用此服务器需要 MCP 客户端。Claude Desktop 应用就是一个 MCP 客户端的示例。要将此服务器与 Claude Desktop 配合使用,请执行以下操作:
找到你的 Claude Desktop 配置文件
Windows:
%APPDATA%\Claude\claude_desktop_config.jsonmacOS:
~/Library/Application Support/Claude/claude_desktop_config.json
将 Android MCP 服务器配置添加到 mcpServers 部分
{
"mcpServers": {
"mcp-android": {
"type": "stdio",
"command": "bash",
"args": [
"-c",
"cd /path/to/mcp-adb && source .venv/bin/activate && python -m server"
]
}
}
}将/path/to/mcp-adb替换为您克隆此代码库的绝对路径。例如: /Users/username/Projects/mcp-adb
与 VS Code 一起使用
您还可以将此 MCP 服务器与 VS Code 的代理模式一起使用(需要 VS Code 1.99 或更高版本)。设置方法如下:
在您的工作区中创建一个
.vscode/mcp.json文件:
{
"servers": {
"mcp-android": {
"type": "stdio",
"command": "bash",
"args": [
"-c",
"cd /path/to/mcp-adb && source .venv/bin/activate && python -m server"
]
}
}
}将/path/to/mcp-adb替换为您克隆此存储库的绝对路径。
添加配置后,您可以使用以下方式管理服务器:
命令面板 →
MCP: List Servers以查看和管理已配置的服务器命令面板 →
MCP: Start Server启动服务器服务器的工具将在 VS Code 的代理模式聊天中可用

UI 检查器
该项目包括对 uiauto.dev 的支持,这是一个强大的 UI 检查工具,用于查看和分析设备的界面结构。
安装 UI 检查器:
uv pip install uiautodev启动检查器:
uiauto.dev打开浏览器并导航至https://uiauto.dev

可用的 MCP 工具
工具名称 | 描述 |
| 检查MCP服务器是否正常运行 |
| 连接到 Android 设备并获取基本信息 |
| 列出所有已安装的应用程序及其版本和软件包信息 |
| 获取当前前台应用的信息 |
| 通过包名称启动应用程序 |
| 通过软件包名称停止应用程序 |
| 停止所有当前正在运行的应用程序 |
| 打开屏幕 |
| 关闭屏幕 |
| 获取详细的设备信息:序列号、分辨率、电池等。 |
| 模拟硬件按键(例如 |
| 解锁屏幕(如有必要,请打开并滑动) |
| 检查 ADB 是否安装并列出连接的设备 |
| 异步等待,直到屏幕打开 |
| 通过 |
| 长按某个元素 |
| 在当前焦点字段中输入文本(可选择先清除) |
| 获取有关 UI 元素的信息(文本、边界、可点击等) |
| 从一个坐标滑动到另一个坐标 |
| 等待元素出现在屏幕上 |
| 从设备截取并保存屏幕截图 |
| 滚动直到给定元素变得可见 |
| 将元素拖到屏幕特定位置 |
| 获取屏幕上显示的最后一条 toast 消息 |
| 清除指定应用的用户数据/缓存 |
| 等待特定活动出现 |
| 将当前屏幕的 UI 层次结构转储为 XML |
执照
该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅LICENSE文件。
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityDmaintenanceA Model Context Protocol (MCP) server that enables AI assistants to control and interact with Android devices, allowing for device management, app debugging, system analysis, and UI automation through natural language commands.8427Apache 2.0
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that enables AI assistants to interact with Android devices through ADB, allowing for automated device management, app installation, file transfers, and screenshot capture.24438ISC
- AlicenseBqualityDmaintenanceA Model Context Protocol server that provides Android Debug Bridge functionality for automating Android devices, enabling remote device management, screen operations, app management, file operations, and shell command execution.2071MIT
- AlicenseNot gradedqualityAmaintenanceAn MCP server that provides tools for controlling Android devices using uiautomator2, enabling AI to automate tasks like tapping, swiping, and managing apps.36Apache 2.0
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
A Model Context Protocol server for Wix AI tools
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/nim444/mcp-android-server-python'
If you have feedback or need assistance with the MCP directory API, please join our Discord server