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
Option 1: Using uvx (Recommended)
This is the easiest way to run the server without managing virtual environments manually.
uvx droidrun-mcp
Option 2: Using pip
You can also install it directly from PyPI:
pip install droidrun-mcp
Note: Ensure you have ADB installed and your Android device connected.
Option 3: Configure Your Client (Easiest setup)
Add the server to your MCP client configuration (e.g., claude_desktop_config.json or Gemini CLI config or Codex CLI config).
Important: You must provide your API keys and (optionally) configuration paths via environment variables.
{
"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": "~/.droidrun-mcp/config.yaml"
}
}
}
}
[!TIP] We recommend copying the default
config.yamlto~/.droidrun-mcp/config.yamlso you can customize it easily.
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 contribute to this project:
- Clone the repo:
git clone https://github.com/droidrun/droidrun-mcp.git
- Install dependencies:
uv sync --all-extras
- Run locally:
fastmcp run droidrun_mcp/server.py
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.3.tar.gz.
File metadata
- Download URL: droidrun_mcp-0.1.3.tar.gz
- Upload date:
- Size: 7.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
960636f06167a4ce83cb4703d04e8e3d26db223b05109b66dd8ad840068dd802
|
|
| MD5 |
0bd472aaa28fce51d25ca2bd1680345f
|
|
| BLAKE2b-256 |
371db88f6bdb01444a0aa760a52b9459c3ad75efdf8b309679f858bff0fbeddf
|
Provenance
The following attestation bundles were made for droidrun_mcp-0.1.3.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.3.tar.gz -
Subject digest:
960636f06167a4ce83cb4703d04e8e3d26db223b05109b66dd8ad840068dd802 - Sigstore transparency entry: 757802633
- Sigstore integration time:
-
Permalink:
droidrun/droidrun-mcp@438faf26419a125aaa0990e402739df72fc96783 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/droidrun
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@438faf26419a125aaa0990e402739df72fc96783 -
Trigger Event:
push
-
Statement type:
File details
Details for the file droidrun_mcp-0.1.3-py3-none-any.whl.
File metadata
- Download URL: droidrun_mcp-0.1.3-py3-none-any.whl
- Upload date:
- Size: 7.3 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 |
48ca275cf4c49bc152ead13ebbb40360ca529c61fa98e766eab4cb3939a65680
|
|
| MD5 |
a37eeb4caaff58883a31cfbbff801a1e
|
|
| BLAKE2b-256 |
85b157d5779789b32520547b494f57addac52528894f3a50b8090c020d5146ef
|
Provenance
The following attestation bundles were made for droidrun_mcp-0.1.3-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.3-py3-none-any.whl -
Subject digest:
48ca275cf4c49bc152ead13ebbb40360ca529c61fa98e766eab4cb3939a65680 - Sigstore transparency entry: 757802636
- Sigstore integration time:
-
Permalink:
droidrun/droidrun-mcp@438faf26419a125aaa0990e402739df72fc96783 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/droidrun
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@438faf26419a125aaa0990e402739df72fc96783 -
Trigger Event:
push
-
Statement type: