This MCP server provides programmatic control over Android devices through ADB (Android Debug Bridge), allowing MCP clients like Claude desktop and Code editors to interact with Android devices. The server exposes capabilities for screenshot capture, UI analysis, ADB command execution, and package management.
To install the Android MCP server:
git clone https://github.com/minhalvp/android-mcp-server.git
cd android-mcp-server
uv sync
The server uses a YAML configuration file to specify the target Android device.
touch config.yaml
device:
name: "google-pixel-7-pro:5555" # Your device identifier from 'adb devices'
An MCP client is required to use this server. Here's how to set it up with Claude Desktop:
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 to the mcpServers
section:
{
"mcpServers": {
"android": {
"command": "path/to/uv",
"args": ["--directory", "path/to/android-mcp-server", "run", "server.py"]
}
}
}
Make sure to replace:
path/to/uv
with the actual path to your uv executablepath/to/android-mcp-server
with the absolute path to where you cloned the repositoryThe server exposes the following tools that can be used through MCP clients:
def get_packages() -> str:
"""
Get all installed packages on the device.
Returns:
str: A list of all installed packages on the device as a string
"""
def execute_adb_command(command: str) -> str:
"""
Executes an ADB command and returns the output.
Args:
command (str): The ADB command to execute
Returns:
str: The output of the ADB command
"""
def get_uilayout() -> str:
"""
Retrieves information about clickable elements in the current UI.
Returns a formatted string containing details about each clickable element,
including their text, content description, bounds, and center coordinates.
Returns:
str: A formatted list of clickable elements with their properties
"""
def get_screenshot() -> Image:
"""
Takes a screenshot of the device and returns it.
Returns:
Image: the screenshot
"""
def get_package_action_intents(package_name: str) -> list[str]:
"""
Get all non-data actions from Activity Resolver Table for a package
Args:
package_name (str): The name of the package to get actions for
Returns:
list[str]: A list of all non-data actions from the Activity Resolver Table for the package
"""
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 > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
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 explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.