MCP Server for DroidRun
Project description
DroidRun MCP Server
A Model Context Protocol (MCP) server for DroidRun, enabling LLMs (like Claude and Gemini) to control Android devices directly.
Features
- Natural Language Control: "Open Settings and turn on Wi-Fi".
- Visual Understanding: Analyzes screenshots to navigate the UI.
- Trajectory Management: Automatically saves session history and screenshots.
- Safe Execution: Runs locally on your machine.
Prerequisites
- Python 3.10+
- ADB installed and running (
adb devicesshould show your device). - DroidRun core library (installed in the same environment).
Installation (Development)
Since this package is currently in development, you will run it from the source code.
-
Clone the repository:
git clone https://github.com/droidrun/droidrun-mcp.git cd droidrun-mcp
-
Install dependencies: Using
uv(recommended) orpip:# Install with uv (including google/anthropic support) uv pip install -e ".[google,anthropic]" # OR using pip pip install -e ".[google,anthropic]"
Note: Ensure
droidrunis also installed or accessible in your environment.
Usage
1. Run the Server
You can run the server directly using fastmcp:
fastmcp run droidrun-mcp/server.py
2. Configure Your Client
Add the server to your MCP client configuration (e.g., claude_desktop_config.json or Gemini CLI config).
Important: You must provide your API keys and (optionally) configuration paths via environment variables.
{
"mcpServers": {
"droidrun": {
"command": "/path/to/your/venv/bin/fastmcp",
"args": [
"run",
"/absolute/path/to/droidrun-mcp/droidrun-mcp/server.py"
],
"env": {
"GOOGLE_API_KEY": "your-key-here",
"OPENAI_API_KEY": "your-key-here",
"DROIDRUN_TRAJECTORY_PATH": "~/.droidrun-mcp/trajectories"
}
}
}
}
Environment Variables
| Variable | Description | Default |
|---|---|---|
DROIDRUN_TRAJECTORY_PATH |
Where to save logs/screenshots. | ~/.droidrun-mcp/trajectories |
DROIDRUN_CONFIG_PATH |
Path to a custom config.yaml. |
config.yaml (in package) |
GOOGLE_API_KEY |
Required for Gemini models. | - |
OPENAI_API_KEY |
Required for OpenAI models. | - |
Available Tools
execute_task(instruction): Executes a natural language command on the device.instruction: "Open YouTube and search for cats"apk_path: (Optional) Only for testing specific APKs.
get_trajectory(session_id): Retrieves the event log for a session.get_screenshots(session_id): Gets screenshots from a session.get_single_screenshot(session_id, step): Gets a specific screenshot.
Development
To verify the server without a client, you can run the test script:
python3 droidrun-mcp/test_client.py
Future Plans
-
PyPI Publishing: We plan to publish this package to PyPI soon. Once published, you will be able to run it directly with
uvx:uvx droidrun-mcpConfiguration will look like this:
{ "mcpServers": { "droidrun": { "command": "uvx", "args": ["droidrun-mcp"], "env": { "GOOGLE_API_KEY": "your-key-here", "OPENAI_API_KEY": "your-key-here", "DROIDRUN_TRAJECTORY_PATH": "~/.droidrun-mcp/trajectories", "DROIDRUN_CONFIG_PATH": "/path/to/your/config.yaml" } } } }
-
Docker Support: A Docker container will be provided for easier deployment.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file droidrun_mcp-0.1.2.tar.gz.
File metadata
- Download URL: droidrun_mcp-0.1.2.tar.gz
- Upload date:
- Size: 7.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
49f3da8dd96f51a1e377d7456b152ce4662476bce59f4089140d599e32ea79b5
|
|
| MD5 |
14b89f085729d966f9db07d3f3d0f0a4
|
|
| BLAKE2b-256 |
8fae1dfd0871473714cbb12f52835d84f42fe0071604b65612f595e35002117c
|
Provenance
The following attestation bundles were made for droidrun_mcp-0.1.2.tar.gz:
Publisher:
publish.yml on droidrun/droidrun-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
droidrun_mcp-0.1.2.tar.gz -
Subject digest:
49f3da8dd96f51a1e377d7456b152ce4662476bce59f4089140d599e32ea79b5 - Sigstore transparency entry: 757794170
- Sigstore integration time:
-
Permalink:
droidrun/droidrun-mcp@e85f6119c4df22b0cd45a9f154cb5990d495d4b6 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/droidrun
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e85f6119c4df22b0cd45a9f154cb5990d495d4b6 -
Trigger Event:
push
-
Statement type:
File details
Details for the file droidrun_mcp-0.1.2-py3-none-any.whl.
File metadata
- Download URL: droidrun_mcp-0.1.2-py3-none-any.whl
- Upload date:
- Size: 7.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1c3b15d29347f8d065007708ca80af0a0e7c788e59ec59e426fe35d425d9230c
|
|
| MD5 |
00512805fb8e27def94a14481c975cb9
|
|
| BLAKE2b-256 |
a1251f847c667ca468b477c6ba379b89c5607f3890e09311a28491d7f4396e64
|
Provenance
The following attestation bundles were made for droidrun_mcp-0.1.2-py3-none-any.whl:
Publisher:
publish.yml on droidrun/droidrun-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
droidrun_mcp-0.1.2-py3-none-any.whl -
Subject digest:
1c3b15d29347f8d065007708ca80af0a0e7c788e59ec59e426fe35d425d9230c - Sigstore transparency entry: 757794173
- Sigstore integration time:
-
Permalink:
droidrun/droidrun-mcp@e85f6119c4df22b0cd45a9f154cb5990d495d4b6 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/droidrun
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e85f6119c4df22b0cd45a9f154cb5990d495d4b6 -
Trigger Event:
push
-
Statement type: