home / mcp / droidrun mcp server
Provides an MCP server to control Android devices via the DroidRun library using the Android accessibility tree.
Configuration
View docs{
"mcpServers": {
"chukfinley-droidrun-mcp-server": {
"command": "python3",
"args": [
"/full/path/to/droidrun-mcp-server/server.py"
]
}
}
}You can control an Android device from an MCP client by running a local DroidRun MCP server that talks to the DroidRun library through the Android accessibility tree. This setup lets you navigate, tap, type, and launch apps on a connected device without relying on screenshots, offering fast, text-based automation you can integrate with Claude Code.
To control your Android device, first ensure your MCP server is running and reachable by your MCP client. You will interact with the device by issuing high-level actions such as opening apps, tapping on elements by index, typing text, swiping, and navigating back and home. The server exposes a set of actions you can call from your MCP client, and it uses the DroidRun library on your Android device to analyze the accessibility tree and perform the requested actions.
Prerequisites and initial setup are required before you can run the MCP server.
Install ADB on your computer to communicate with the Android device.
Install Python 3.10+ on your computer.
Install the DroidRun MCP server package and the MCP framework dependencies.
Clone the DroidRun MCP server repository and install dependencies.
Configure Claude Code to load the DroidRun MCP server as an MCP backend. You will specify a stdio configuration that starts the Python runtime and points to the server script on your machine.
Example configuration entry shows how Claude Code should spawn the local server process and provide an empty environment by default.
If the device is not detected, verify USB connectivity and ensure USB debugging is enabled on the device. Re-run ADB device checks to confirm the device appears in the list.
If the Portal/Accessibility service does not appear or enable, re-run the setup flow to prompt settings navigation and grant the necessary permissions.
Ensure the MCP server configuration is correctly referenced in Claude Code with an absolute path to the server script and a complete stdio command. Restart Claude Code after changes.
Once configured, you can issue commands to perform operations on the device. For example, you can open an app by package name, inspect the current UI structure, tap a specific UI element by its index, input text, navigate back, or return to the home screen. The server translates these calls into actions on the Android device using the DroidRun portal.
Keep the Android device connected only to trusted machines. Limit the exposure of the MCP server by running Claude Code in a secure environment and monitor any environment variables that your MCP config relies on.
Get device model, Android version, and serial.
Get current screen UI elements as an indexed list.
Tap an element by index number from the ui() output.
Tap at specific screen coordinates.
Swipe in a direction (up, down, left, right).
Input text into a focused element or after selecting a target element.
Simulate the Android back button press.
Simulate the Android home button press.
Simulate the Enter key press.
Open an app by its package name.
List installed non-system apps.