An Android Studio plugin that exposes the built-in Gemini agent tools as an MCP server β so any AI coding tool can use them.
Warning
This plugin uses undocumented internal APIs from Android Studio's Gemini plugin. These APIs can change or break at any time without notice. It is not affiliated with or endorsed by Google. Use at your own risk β best suited for experimentation and personal workflows, not production CI pipelines.
Note
Requires Android Studio 2025.3 β 2026.1 (build 253β261) with the Gemini plugin enabled (bundled by default) and Python 3.7+ for the bridge script.
1. Install the plugin
Download the ZIP from Releases and install via Settings β Plugins β Install Plugin from Disk in Android Studio.
2. Download the bridge script
Save android-studio-mcp.py somewhere on your machine.
3. Connect to your favourite tool (see below)
4. Open an Android project in Android Studio β the MCP server starts automatically.
Important
Always use absolute paths (e.g., /Users/you/android-studio-mcp.py), not ~. Most MCP clients don't expand the tilde.
claude mcp add android-studio -- python3 /absolute/path/to/android-studio-mcp.pyAdd to .vscode/mcp.json (or user-level settings.json under github.copilot.mcp):
{
"servers": {
"android-studio": {
"type": "stdio",
"command": "python3",
"args": ["/absolute/path/to/android-studio-mcp.py"]
}
}
}Add to ~/.config/kilo/kilo.jsonc:
{
"mcp": {
"android-studio": {
"type": "local",
"command": ["python3", "/absolute/path/to/android-studio-mcp.py"],
"enabled": true
}
}
}Add to ~/.config/opencode/opencode.json:
{
"mcp": {
"android-studio": {
"type": "local",
"command": ["python3", "/absolute/path/to/android-studio-mcp.py"],
"enabled": true
}
}
}Any MCP client that supports SSE transport can connect directly β no bridge script needed:
http://127.0.0.1:24601/sse
All tools are Android-specific. Generic file/code and agent-workflow tools are intentionally excluded. Tools are discovered dynamically from the Gemini plugin at runtime β when Android Studio updates with new tools, they appear automatically.
Tools that return images (screenshots, rendered previews) are delivered as MCP image content.
Device tools (5)
| Tool | Description |
|---|---|
read_logcat |
Read logcat output from a connected Android device |
take_screenshot |
Capture a screenshot from a connected device |
ui_state |
Dump the current UI hierarchy from a connected device |
adb_shell_input |
Send input events to a connected device via adb shell input |
adb_pull |
Pull a file off a connected device |
Build & Gradle tools (15)
| Tool | Description |
|---|---|
gradle_sync |
Trigger a Gradle sync in the open project |
gradle_build |
Build the project via Gradle |
gradle_assemble_all |
Assemble every artifact in the build |
deploy |
Build and deploy the app to a connected device |
run_test_with_coverage |
Run tests with coverage collection |
version_lookup |
Look up the latest stable and preview versions of a Maven artifact |
release_notes |
Fetch release notes for a dependency version |
get_top_level_sub_projects |
List top-level subprojects in the Gradle build |
get_build_file_location |
Get the build file path for a given artifact |
get_gradle_artifact_from_file |
Identify which Gradle artifact owns a source file |
get_assemble_task_for_artifact |
Get the assemble Gradle task for an artifact |
get_test_task_for_artifact |
Get the test Gradle task for an artifact |
get_artifact_consumers |
List artifacts that depend on a given artifact |
get_test_artifacts_for_sub_project |
List test artifacts for a subproject |
get_source_folders_for_artifact |
List source folders for a Gradle artifact |
Compose & UI tools (5)
| Tool | Description |
|---|---|
render_compose_preview |
Render a Compose preview and return the image |
compose_visual_comparison_judge |
Judge whether a rendered preview matches a target |
verify_batch_visual_parity |
Check visual parity across a batch of previews |
compare_images |
Compare two images and report the differences |
visual_lint_service_tool |
Report visual lint issues for the current layout |
Android resource tools (2)
| Tool | Description |
|---|---|
locate_android_resources |
Locate the resources referenced by a layout XML file |
resolve_resource |
Resolve an Android resource reference to its value |
Documentation & search tools (3)
| Tool | Description |
|---|---|
search_android_docs |
Search the Android developer documentation |
fetch_android_docs |
Fetch the content of an Android documentation page |
code_search |
Search code within the open project |
By default the server runs on port 24601. To change it:
- In Android Studio: Help β Edit Custom VM Options β add
-Dmcp.bridge.port=12345 - Pass
--port 12345to the bridge script
git clone https://github.com/amsavarthan/android-tools-mcp
cd android-tools-mcp
./gradlew buildPluginThe plugin ZIP is written to build/distributions/. The build compiles against your local Android Studio installation β set the path via local.properties (android.studio.path=...), env var ANDROID_STUDIO_PATH, or it defaults to /Applications/Android Studio.app.
Requires a JDK 21 toolchain (Android Studio's bundled JBR works: JAVA_HOME="<Android Studio>/Contents/jbr/Contents/Home").
| Problem | Fix |
|---|---|
| 0 tools discovered | Open an Android project and wait for Gradle sync to complete. Ensure the Gemini plugin is enabled. |
| Connection refused | The server only runs while a project is open. Verify with curl -sN http://127.0.0.1:24601/sse. |
| Device tools fail | Connect an Android device or emulator via ADB. |