Automate Android devices using the uiautomator2 library, requiring adb and a connected device.
{{ message }}
nim444 / mcp-android-server-python Public
MCP Android agent - This project provides an *MCP (Model Context Protocol)* server for automating Android devices using uiautomator2. It's designed to be easily plugged into AI agents like GitHub Copilot Chat, Claude, or Open Interpreter to control Android devices through natural language.
MIT license
14 stars2 forksBranches Tags Activity
Star
Notifications
main
BranchesTags
Go to file
Code
Name | Name | Last commit message | Last commit date |
---|---|---|---|
26 Commits | |||
.docs | .docs | ||
.github | .github | ||
.prompts | .prompts | ||
tests | tests | ||
.gitignore | .gitignore | ||
LICENSE | LICENSE | ||
__init__.py | __init__.py | ||
pyproject.toml | pyproject.toml | ||
readme.md | readme.md | ||
server.py | server.py | ||
View all files |
This project provides an MCP (Model Context Protocol) server for automating Android devices using uiautomator2. It's designed to be easily plugged into AI agents like GitHub Copilot Chat, Claude, or Open Interpreter to control Android devices through natural language.
adb
diagnostic toolPerfect for:
git clone https://github.com/nim444/mcp-android.git cd mcp-android
uv venv source .venv/bin/activate # On Windows: .venv\Scripts\activate
uv pip install
uvicorn server:app --factory --host 0.0.0.0 --port 8000
python server.py
An MCP client is needed to use this server. The Claude Desktop app is an example of an MCP client. To use this server with Claude Desktop:
%APPDATA%\Claude\claude_desktop_config.json
~/Library/Application Support/Claude/claude_desktop_config.json
{ "mcpServers": { "mcp-android": { "type": "stdio", "command": "bash", "args": [ "-c", "cd /path/to/mcp-adb && source .venv/bin/activate && python -m server" ] } } }
Replace /path/to/mcp-adb
with the absolute path to where you cloned this repository. For example: /Users/username/Projects/mcp-adb
You can also use this MCP server with VS Code's agent mode (requires VS Code 1.99 or newer). To set up:
.vscode/mcp.json
file in your workspace:{ "servers": { "mcp-android": { "type": "stdio", "command": "bash", "args": [ "-c", "cd /path/to/mcp-adb && source .venv/bin/activate && python -m server" ] } } }
Replace /path/to/mcp-adb
with the absolute path to where you cloned this repository.
After adding the configuration, you can manage the server using:
MCP: List Servers
to view and manage configured serversMCP: Start Server
to start the serverThe project includes support for uiauto.dev, a powerful UI inspection tool for viewing and analyzing your device's interface structure.
uv pip install uiautodev
uiauto.dev
Tool Name | Description |
---|---|
mcp_health | Check if the MCP server is running properly |
connect_device | Connect to an Android device and get basic info |
get_installed_apps | List all installed apps with version and package info |
get_current_app | Get info about the app currently in the foreground |
start_app | Start an app by its package name |
stop_app | Stop an app by its package name |
stop_all_apps | Stop all currently running apps |
screen_on | Turn on the screen |
screen_off | Turn off the screen |
get_device_info | Get detailed device info: serial, resolution, battery, etc. |
press_key | Simulate hardware key press (e.g. home, back, menu, etc.) |
unlock_screen | Unlock the screen (turn on and swipe if necessary) |
check_adb | Check if ADB is installed and list connected devices |
wait_for_screen_on | Wait asynchronously until the screen is turned on |
click | Tap on an element by text, resourceId, or description |
long_click | Perform a long click on an element |
send_text | Input text into currently focused field (optionally clearing before) |
get_element_info | Get info on UI elements (text, bounds, clickable, etc.) |
swipe | Swipe from one coordinate to another |
wait_for_element | Wait for an element to appear on screen |
screenshot | Take and save a screenshot from the device |
scroll_to | Scroll until a given element becomes visible |
drag | Drag an element to a specific screen location |
get_toast | Get the last toast message shown on screen |
clear_app_data | Clear user data/cache of a specified app |
wait_activity | Wait until a specific activity appears |
dump_hierarchy | Dump the UI hierarchy of the current screen as XML |
This project is licensed under the MIT License - see the LICENSE file for details.
android automation ai vscode python3 copilot agentic-ai mcp-server
Readme
MIT license
Activity
14 stars
1 watching
2 forks
Report repository
Query the BuiltWith API to discover the technology stacks of websites. Requires a BuiltWith API key.
MCP Language Server gives MCP enabled clients access to semantic tools like get definition, references, rename, and diagnostics.
Execute terminal commands through a secure shell interface using an AI assistant.
Create, validate, and render diagrams from D2 (Declarative Diagramming) code into SVG and PNG formats.
An MCP server for the SourceSync.ai API to manage and synchronize source code context.
MCP server to provide golang packages and their information from pkg.go.dev
Generate images using Bytedance's SeedDream 3.0 model via the Replicate platform.
MCP Server for PGYER platform, supports uploading, querying apps, etc.
Create and read feature flags, review experiments, generate flag types, search docs, and interact with GrowthBook's feature flagging and experimentation platform.
APIMatic MCP Server is used to validate OpenAPI specifications using APIMatic. The server processes OpenAPI files and returns validation summaries by leveraging APIMatic’s API.