modelscope·@HadyAhmed00/Android-MCP
暂无描述。
Android-MCP is a lightweight, open-source tool that bridges between AI agents and Android devices. Running as an MCP server, it lets LLM agents perform real-world tasks such as app navigation, UI interaction and automated QA testing without relying on traditional computer-vision pipelines or preprogrammed scripts.
Forked and customized by Hady Ahmed
uiautomator2 compatible Android device (Android 4.4+)git clone https://github.com/HadyAhmed00/Android-MCP.git
cd Android-MCP
pip install -e .
Or install manually:
pip install mcp uiautomator2 pillow ipykernel
For emulator:
python main.py --emulator
For physical device:
python main.py
The server will connect to your Android device via ADB and start listening for MCP client connections.
To use this with Claude Code or other MCP clients, add the following to your MCP configuration:
Example MCP Config:
{
"mcpServers": {
"android-mcp": {
"command": "python",
"args": [
"/path/to/Android-MCP/main.py",
"--emulator"
]
}
}
}
The MCP server exposes 9 tools for controlling Android devices:
Get the current state of the device including UI hierarchy and optional screenshot.
Parameters:
use_vision (bool, optional): Include annotated screenshot with labeled UI elementsExample:
Get device state with screenshot
Click on a specific coordinate on the screen.
Parameters:
x (int): X coordinatey (int): Y coordinateExample:
Click on coordinates 540, 800
Long press (hold) on a specific coordinate.
Parameters:
x (int): X coordinatey (int): Y coordinateExample:
Long click on 540, 800 for 2 seconds
Perform a swipe gesture from one point to another.
Parameters:
x1 (int): Starting X coordinatey1 (int): Starting Y coordinatex2 (int): Ending X coordinatey2 (int): Ending Y coordinateExample:
Swipe from top to bottom (refresh)
Type text at a specific coordinate (automatically focuses the field).
Parameters:
text (str): Text to typex (int): X coordinatey (int): Y coordinateclear (bool, optional): Clear existing text before typingExample:
Type "hello world" into the search field
Drag from one location and drop at another.
Parameters:
x1 (int): Starting X coordinatey1 (int): Starting Y coordinatex2 (int): Ending X coordinatey2 (int): Ending Y coordinateExample:
Drag and drop item from position to trash
Press device buttons (home, back, power, volume, etc.).
Parameters:
button (str): Button name (back, home, power, volume_up, volume_down)Example:
Press the back button
Open the notification bar to access notifications.
Parameters: None
Example:
Open notification bar
Wait for a specified duration (useful for allowing apps to load).
Parameters:
duration (int): Seconds to waitExample:
Wait for 2 seconds
Get device state with vision:
Get the current state of the device with a screenshot
This returns the UI hierarchy and an annotated screenshot showing numbered UI elements.
Click on an element:
Click on element 0 (the button that was labeled as 0)
Get updated state:
Get the device state again
1. Get device state with vision to see the form
2. Click on the name field (element 2)
3. Type "John Doe"
4. Click on the email field (element 3)
5. Type "john@example.com"
6. Scroll down to find the submit button
7. Click the submit button
8. Wait 2 seconds for the form to process
9. Get device state to confirm submission
1. Get device state to see current screen
2. Click the "Settings" button
3. Wait 1 second for settings to load
4. Get device state to see settings menu
5. Click on "About Phone"
6. Get state to view device information
The project is organized into three main modules:
main.py--emulator)src/mobile/src/tree/Check ADB:
adb devices
Your device should appear in the list.
For emulators:
ad…
一座通过串行通信将物理硬件设备与人工智能大语言模型连接起来的桥梁,允许用户使用自然语言命令控制硬件。
用于运行代码片段并显示结果的MCP服务器。
一个通过ADB实现对Android设备程序化控制的服务器,提供截图捕获、UI布局分析和包管理等功能,这些功能可以被像Claude Desktop这样的MCP客户端使用。
Claude Code作为模型上下文协议(MCP)服务器的一种实现,通过标准的MCP接口启用Claude的软件工程能力(代码生成、编辑、评审和文件操作)。
用于Cursor IDE的模型上下文协议(MCP)服务器,可简化其他MCP服务器的安装和配置。
一个MCP服务器,允许通过自然语言管理Docker容器,使用户能够在不自行运行命令的情况下组合、检查和调试容器。