MCP Android Server is a powerful automation tool that allows you to control Android devices through natural language using the Model Context Protocol (MCP). This server acts as a bridge between AI agents (like Claude, GitHub Copilot Chat, or Open Interpreter) and Android devices, enabling seamless automation through uiautomator2.
git clone https://github.com/nim444/mcp-android.git
cd mcp-android
Create and activate a virtual environment:
# Using uv (https://github.com/astral-sh/uv)
uv venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
Install dependencies:
uv pip install
You can run the server using one of two methods:
Using uvicorn (Recommended):
uvicorn server:app --factory --host 0.0.0.0 --port 8000
Using MCP stdio (For AI agent integration):
python server.py
Locate your Claude Desktop configuration file:
%APPDATA%\Claude\claude_desktop_config.json
~/Library/Application Support/Claude/claude_desktop_config.json
Add the Android MCP server configuration:
{
"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 your cloned repository.
.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"
]
}
}
}
MCP: List Servers
to view and manage serversMCP: Start Server
to start the serverA UI inspection tool is included to help you analyze device interface structure:
uv pip install uiautodev
uiauto.dev
connect_device
- Connect to an Android device and get basic infoget_device_info
- Get detailed device info: serial, resolution, battery, etc.check_adb
- Check if ADB is installed and list connected devicesmcp_health
- Check if the MCP server is running properlyget_installed_apps
- List all installed apps with version and package infoget_current_app
- Get info about the app currently in the foregroundstart_app
- Start an app by its package namestop_app
- Stop an app by its package namestop_all_apps
- Stop all currently running appsclear_app_data
- Clear user data/cache of a specified appwait_activity
- Wait until a specific activity appearsscreen_on
- Turn on the screenscreen_off
- Turn off the screenunlock_screen
- Unlock the screen (turn on and swipe if necessary)wait_for_screen_on
- Wait asynchronously until the screen is turned onscreenshot
- Take and save a screenshot from the deviceclick
- Tap on an element by text
, resourceId
, or description
long_click
- Perform a long click on an elementsend_text
- Input text into currently focused fieldpress_key
- Simulate hardware key press (e.g., home
, back
, menu
)swipe
- Swipe from one coordinate to anotherscroll_to
- Scroll until a given element becomes visibledrag
- Drag an element to a specific screen locationget_element_info
- Get info on UI elements (text, bounds, clickable, etc.)wait_for_element
- Wait for an element to appear on screenget_toast
- Get the last toast message shown on screendump_hierarchy
- Dump the UI hierarchy of the current screen as XMLTo add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "mcp-android" '{"type":"stdio","command":"bash","args":["-c","cd /path/to/mcp-adb && source .venv/bin/activate && python -m server"]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"mcp-android": {
"type": "stdio",
"command": "bash",
"args": [
"-c",
"cd /path/to/mcp-adb && source .venv/bin/activate && python -m server"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"mcp-android": {
"type": "stdio",
"command": "bash",
"args": [
"-c",
"cd /path/to/mcp-adb && source .venv/bin/activate && python -m server"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect