Android Debug Bridge MCP server

Integrates with Android Debug Bridge (ADB) to enable remote control, testing, and analysis of Android devices, offering capabilities like package management, UI inspection, and screenshot capture.
Back to servers
Provider
Minhal Vp
Release date
Mar 01, 2025
Language
Python
Stats
380 stars

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.

Prerequisites

  • Python 3.x
  • ADB (Android Debug Bridge) installed and configured
  • Android device or emulator

Installation

To install the Android MCP server:

  1. Clone the repository:
git clone https://github.com/minhalvp/android-mcp-server.git
cd android-mcp-server
  1. Install dependencies using uv:
uv sync

Configuration

The server uses a YAML configuration file to specify the target Android device.

Customizing Configuration

  1. Create a new configuration file:
touch config.yaml
  1. Configure your device by adding the following content:
device:
  name: "google-pixel-7-pro:5555" # Your device identifier from 'adb devices'

Usage

An MCP client is required to use this server. Here's how to set it up with Claude Desktop:

  1. Locate your Claude Desktop configuration file:

    • Windows: %APPDATA%\Claude\claude_desktop_config.json
    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  2. 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 executable
  • path/to/android-mcp-server with the absolute path to where you cloned the repository

Available Tools

The server exposes the following tools that can be used through MCP clients:

Get Installed Packages

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
    """

Execute ADB Commands

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
    """

Analyze UI Layout

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
    """

Capture Screenshots

def get_screenshot() -> Image:
    """
    Takes a screenshot of the device and returns it.
    Returns:
        Image: the screenshot
    """

Get Package Action Intents

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
    """

How to add this MCP server to Cursor

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.

Adding an MCP server to Cursor globally

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"
            ]
        }
    }
}

Adding an MCP server to a project

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.

How to use the MCP server

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.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later