android-mcp-server: Programmatic Android Device Control via ADB

Summary
The android-mcp-server is a Python-based Model Context Protocol (MCP) server designed to offer programmatic control over Android devices using ADB. It enables advanced device management capabilities, including screenshot capture, UI layout analysis, and package management. This server integrates seamlessly with MCP clients like Claude Desktop, providing a powerful tool for developers and automation enthusiasts.
Repository Info
Tags
Click on any tag to explore related repositories
Introduction
The android-mcp-server project provides a robust Model Context Protocol (MCP) server that facilitates programmatic control over Android devices through the Android Debug Bridge (ADB). This server exposes a range of Android device management capabilities, making it an invaluable tool for automation, testing, and development workflows. It is designed to be accessed by MCP clients, such as Claude Desktop and various code editors.
Key features include:
- ADB Command Execution
- Device Screenshot Capture
- UI Layout Analysis
- Device Package Management
Installation
To get started with android-mcp-server, follow these steps:
1. Prerequisites:
- Python 3.x
- ADB (Android Debug Bridge) installed and configured on your system.
- An Android device or emulator.
2. Clone the repository:
git clone https://github.com/minhalvp/android-mcp-server.git
cd android-mcp-server
3. Install dependencies:
This project uses uv for project management. If you don't have uv, refer to its installation guide.
uv python install 3.11
uv sync
Examples
The android-mcp-server is designed to be used with an MCP client. Here's how to configure it with Claude Desktop and an overview of the available tools.
Configuration with Claude Desktop:
- Locate your Claude Desktop configuration file:
- Windows:
%APPDATA%\Claude\claude_desktop_config.json - macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
- Windows:
- Add the Android MCP server configuration to the
mcpServerssection:
{
"mcpServers": {
"android": {
"command": "path/to/uv",
"args": ["--directory", "path/to/android-mcp-server", "run", "server.py"]
}
}
}
Remember to replace path/to/uv with the actual path to your uv executable and path/to/android-mcp-server with the absolute path where you cloned the repository.
Available Tools:
The server exposes several powerful tools for interacting with Android devices:
get_packages(): Get all installed packages on the device.execute_adb_command(command: str): Executes any ADB command and returns its output.get_uilayout(): Retrieves information about clickable elements in the current UI.get_screenshot(): Takes a screenshot of the device and returns it.get_package_action_intents(package_name: str): Get all non-data actions from Activity Resolver Table for a package.
Why Use
The android-mcp-server offers a streamlined way to integrate Android device control into your development and automation workflows. By leveraging the Model Context Protocol, it allows AI agents and other clients to interact with Android devices programmatically, enabling tasks such as automated testing, UI analysis, and rapid prototyping. Its Python foundation and clear ADB integration make it accessible for developers looking to extend their control over Android environments.
Links
- GitHub Repository: minhalvp/android-mcp-server
- Model Context Protocol (MCP): Introduction
- uv Installation: Getting Started