Automate and control Android devices using the UIAutomator2 framework.
基于FastMCP框架实现的UIAutomator2 MCP服务器,提供Android设备自动化控制能力。
Android设备管理
UI自动化操作
应用管理
git clone https://github.com/yourusername/uiautomator2-mcp.git
cd uiautomator2-mcp
pip install -e .
在Claude Desktop的配置目录下创建或编辑mcp.json
文件(通常在~/.cursor/mcp.json
或%APPDATA%\Cursor\mcp.json
):
{
"mcpServers": {
"android": {
"command": "uv",
"args": [
"--directory",
"/path/to/uiautomator2-mcp", // 替换为你的项目路径
"run",
"src/server.py"
]
}
}
}
配置说明:
android
: MCP服务器的唯一标识符command
: 用于运行Python的命令(这里使用uv,也可以使用python)args
: 命令行参数
--directory
: 项目目录路径run
: uv的运行命令src/server.py
: 服务器入口文件路径你可以根据需要调整以下配置:
{
"mcpServers": {
"android": {
"command": "python",
"args": [
"/path/to/uiautomator2-mcp/src/server.py"
]
}
}
}
{
"mcpServers": {
"android": {
"command": "/path/to/venv/bin/python",
"args": [
"/path/to/uiautomator2-mcp/src/server.py"
]
}
}
}
{
"mcpServers": {
"android": {
"command": "python",
"args": [
"/path/to/uiautomator2-mcp/src/server.py"
],
"env": {
"PYTHONPATH": "/path/to/uiautomator2-mcp",
"ANDROID_HOME": "/path/to/android-sdk"
}
}
}
}
你可以在同一配置文件中定义多个MCP服务器:
{
"mcpServers": {
"android": {
"command": "uv",
"args": [
"--directory",
"/path/to/uiautomator2-mcp",
"run",
"src/server.py"
]
},
"android-debug": {
"command": "uv",
"args": [
"--directory",
"/path/to/uiautomator2-mcp",
"run",
"src/server.py",
"--debug"
]
}
}
}
配置完成后,你可以在Claude中直接使用所有可用的工具:
# 初始化UIAutomator2
await mcp.call_tool("mcp_android_init_uiautomator2", {})
# 启动应用
await mcp.call_tool("mcp_android_start_app", {
"package_name": "com.example.app"
})
# 点击元素
await mcp.call_tool("mcp_android_click_element", {
"text": "登录"
})
pip install -e ".[dev]"
pytest
欢迎提交Issue和Pull Request。
MIT License
A WordPress plugin that transforms a WordPress site into an MCP server, allowing direct access to its content.
An MCP server using stdio transport, offering file system access, a calculator, and a code review tool. Requires Node.js.
Access prompt templates managed in an MLflow Prompt Registry. Requires a running MLflow server configured via the MLFLOW_TRACKING_URI environment variable.
Analyzes Unreal Engine source code to provide context for AI assistants.
Enable AI agents to interact with the Atla API for state-of-the-art LLMJ evaluation.
Create and read feature flags, review experiments, generate flag types, search docs, and interact with GrowthBook's feature flagging and experimentation platform.
MCP server for text-to-graphql, integrates with Claude Desktop and Cursor.
A server for Zero-Vector's hybrid vector-graph persona and memory management system, featuring advanced LangGraph workflow capabilities.
Extracts text and performs OCR on various documents like IDs and invoices, with support for Markdown conversion.
Embeds intelligent guidance into AI workflows to organize development and ensure quality.