Android Studio MCP
Provides tools for controlling Android devices and emulators through adb, including listing devices, installing and launching apps, reading logcat, running shell commands, transferring files, taking screenshots, dumping UI hierarchies, and injecting taps, swipes, text, and key events.
Integrates with Android Studio via a plugin to expose live IDE capabilities: reading unsaved editor buffers, listing open editors, viewing problems, opening and saving files, finding files, capturing the IDE window, Kotlin/Java-aware find-usages and rename refactoring, Gradle sync status and actions, and run configurations.
Provides Gradle build integration for building, testing, linting, running arbitrary Gradle tasks, parsing structured build diagnostics, and triggering/waiting for Gradle sync and run operations through the IDE bridge.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Android Studio MCP Run the app on the connected emulator and show me any build errors"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
android-studio-mcp
An MCP server that gives AI coding agents the Android Studio toolchain: Gradle builds, tests, and lint, plus device control through adb, the emulator, and opening files in Android Studio. It isn't tied to one IDE or one AI client. Any MCP client can use it: Claude Code, Claude Desktop, Cursor, Gemini CLI, Codex, VS Code/Copilot, and ChatGPT (through HTTP mode).
Tools
Area | Tools |
Setup |
|
Build |
|
Device |
|
UI |
|
Emulator |
|
Jobs |
|
Live IDE (needs the plugin) |
|
Refactoring (plugin) |
|
Sync & run (plugin) |
|
Long operations run as jobs. build, run_app, gradle_run and emulator_start wait up to waitSec (default 50s). If they haven't finished by then, they return {status: "running", id} and the agent polls job_status. This stays under the tool-call timeouts that Cursor, Codex and Gemini CLI enforce.
Build failures come back as structured diagnostics (file, line, column, message). They're parsed from Kotlin, javac, AAPT2, and Gradle's "What went wrong" block.
Related MCP server: DroidAgentKit
Install
npm install
npm run buildRequires Node 20+, an Android SDK (platform-tools; emulator for the AVD tools), and a JDK. The JDK is taken from JAVA_HOME, falling back to Android Studio's bundled JBR.
Configuration (env vars)
Var | Purpose |
| SDK location. Falls back to the project's |
| Android Studio install dir (for |
| Default project. Otherwise every project tool takes |
| HTTP mode only: auth token (random if unset) and port (default 3939). |
Replace the /path/to/... placeholders below with your paths. On Windows, use forward slashes (C:/Users/me/AppData/Local/Android/Sdk) or escaped backslashes in JSON and TOML. If your SDK and Studio are in their default locations, you can leave out ANDROID_SDK_ROOT and ANDROID_STUDIO_HOME.
Claude Code
claude mcp add android-studio --scope user \
-e ANDROID_SDK_ROOT="/path/to/Android/Sdk" \
-e ANDROID_STUDIO_HOME="/path/to/Android Studio" \
-- node "/path/to/android-studio-mcp/dist/index.js"Leave ANDROID_PROJECT_DIR unset. Claude Code starts the server in the folder you open, so it finds the project automatically.
Claude Desktop: %APPDATA%\Claude\claude_desktop_config.json
Cursor: ~/.cursor/mcp.json (global) or .cursor/mcp.json (per project)
{
"mcpServers": {
"android-studio": {
"command": "node",
"args": ["/path/to/android-studio-mcp/dist/index.js"],
"env": {
"ANDROID_SDK_ROOT": "/path/to/Android/Sdk",
"ANDROID_STUDIO_HOME": "/path/to/Android Studio",
"ANDROID_PROJECT_DIR": "/path/to/your/android-project"
}
}
}
}Gemini CLI: ~/.gemini/settings.json
Same mcpServers block as above. You can add "timeout": 120000 (ms) to give the job tools room.
Codex: ~/.codex/config.toml
[mcp_servers.android-studio]
command = "node"
args = ["/path/to/android-studio-mcp/dist/index.js"]
tool_timeout_sec = 120
[mcp_servers.android-studio.env]
ANDROID_SDK_ROOT = "/path/to/Android/Sdk"
ANDROID_STUDIO_HOME = "/path/to/Android Studio"
ANDROID_PROJECT_DIR = "/path/to/your/android-project"VS Code / GitHub Copilot: .vscode/mcp.json
{ "servers": { "android-studio": { "type": "stdio", "command": "node", "args": ["…/dist/index.js"], "env": { "ANDROID_SDK_ROOT": "…" } } } }Android Studio itself (Gemini in Android Studio)
Recent Android Studio versions let Gemini's agent mode use MCP servers. Find the MCP Servers page under the Gemini / AI settings (the exact location varies by version), enable MCP, and paste the same mcpServers JSON.
ChatGPT (HTTP mode)
ChatGPT only talks to remote MCP servers, so run the server in HTTP mode:
ASMCP_TOKEN=<long-random-secret> node dist/index.js --http 3939Then expose it over HTTPS, for example with cloudflared tunnel --url http://127.0.0.1:3939. In ChatGPT → Settings → Connectors → Developer mode, add https://<tunnel-host>/mcp/<token> with no authentication. The token in the path is the credential. Anyone with that URL can run shell commands on your devices and Gradle on your machine, so keep it secret and stop the tunnel when you're done. Clients that can send headers can use http://127.0.0.1:3939/mcp with Authorization: Bearer <token> instead.
Android Studio plugin (live IDE bridge)
studio-plugin/ is a small IntelliJ Platform plugin. On startup it serves a token-protected HTTP endpoint on 127.0.0.1 (random port) and records the port and token in ~/.android-studio-mcp/bridges/<pid>.json. The MCP server reads that file. When Studio is running, the ide_* tools work, and build / run_app save unsaved editors first. When it isn't running, everything else still works from the CLI.
cd studio-plugin
./gradlew buildPlugin # compiles against the Studio in ANDROID_STUDIO_HOME (or -PstudioHome=...)Install studio-plugin/build/distributions/android-studio-mcp-bridge-0.1.0.zip via Settings → Plugins → ⚙ → Install Plugin from Disk, then restart Studio.
Or do the whole cycle with one command: build, quit any running Studio through the bridge (no confirm dialog), install, and relaunch:
node scripts/install-plugin.mjs path/to/projectCalls that open a modal dialog in Studio (a rename conflict, the exit confirmation) wait for the dialog to close. After 20s they return a "UI thread busy" error, and you handle the dialog in Studio.
Development
npm run dev # tsc --watch
npm run smoke # spawn over stdio and call environment/project_info/devices_list/emulator_list
node scripts/smoke.mjs logcat '{"lines":20}' ui_dump '{}' # call arbitrary tools
node scripts/poll.mjs run_app '{"waitSec":30}' # start a job and poll it to completion
npm test # parser + HTTP transport tests
npm run inspect # MCP Inspector UIRoadmap
Plugin: more refactorings (move, extract, change signature), project-wide inspections with quick-fixes, Layout Inspector snapshots, and headless Compose preview rendering (
ide_screenshotcaptures previews shown in the IDE for now).Compose preview rendering, Logcat streaming via MCP notifications,
avdmanagercreate/delete, instrumented-test sharding, and baseline profile / Macrobenchmark helpers.
Available Tools
46 toolsadb_shellRun adb shell commandADestructive
Run an arbitrary shell command on the device (e.g. 'pm list packages -3', 'dumpsys battery'). Output is truncated to the tail.
Inputs: command (required), serial, timeoutSec.
app_installInstall APKA
Install (or reinstall, keeping data) an APK on a device. Use project_apks to find built APKs.
Inputs: apkPath (required), serial, allowDowngrade, grantPermissions.
app_launchLaunch appC
Start an app's launcher activity (or a given activity) and report launch time.
Inputs: package (required), serial, activity, stopFirst.
app_stopForce-stop appADestructive
Force-stop an app, optionally also clearing all of its data.
Inputs: package (required), serial, clearData.
app_uninstallUninstall appCDestructive
Uninstall an app package from a device.
Inputs: package (required), serial, keepData.
buildBuild appA
Assemble an APK for a module and variant (default: the app module, debug). Returns compiler errors and the APK path.
Inputs: module, variant, waitSec, projectDir.
device_infoDevice infoBRead-only
Model, Android version, API level, ABI, screen size and density of a device.
Inputs: serial.
devices_listList devicesARead-only
List connected Android devices and running emulators (adb devices -l).
Inputs: no named parameters.
emulator_listList AVDsARead-only
List Android Virtual Devices and which are currently running (with their serials).
Inputs: no named parameters.
emulator_startStart emulatorA
Boot an AVD in the background and wait for it to finish booting. Returns a job; if it isn't done within waitSec, poll it with job_status.
Inputs: avd (required), waitSec, coldBoot, headless, +1 more.
emulator_stopStop emulatorADestructive
Shut down a running emulator by serial (e.g. emulator-5554).
Inputs: serial (required).
environmentEnvironmentARead-only
Report the Android toolchain this server sees: SDK path and installed packages, Android Studio install, JAVA_HOME, and the resolved project. Call this first when something isn't found.
Inputs: projectDir.
file_transferPush / pull fileCDestructive
Copy a file between this machine and the device (adb push / adb pull).
Inputs: direction (required), localPath (required), devicePath (required), serial.
gradle_runRun Gradle tasksA
Run Gradle tasks through the project's wrapper (e.g. ['assembleDebug'], [':app:testDebugUnitTest'], ['clean','build']). Returns parsed compiler errors. Runs as a job; poll with job_status if still running.
Inputs: tasks (required), args, waitSec, projectDir.
gradle_tasksList Gradle tasksCRead-only
List the Gradle tasks available in the project (or one module).
Inputs: all, module, projectDir.
ide_actionRun IDE actionADestructive
Invoke an Android Studio action by id, as if chosen from the menu. Useful ids: Android.SyncProject (Gradle sync), ReformatCode, OptimizeImports, MakeGradleProject (Build › Make), CompileDirty, Android.RunAndroidLint. Editor actions apply to the active editor; use ide_open first.
Inputs: id (required), project.
ide_actionsSearch IDE actionsBRead-only
Search Android Studio's action ids by id or menu text (e.g. 'sync', 'reformat', 'rebuild').
Inputs: limit, query.
ide_editorsOpen editorsCRead-only
Files open in Android Studio, which have unsaved changes, and the active file with caret position and selection.
Inputs: project.
ide_find_filesFind filesARead-only
Find project files by name using the IDE index: exact name ('MainActivity.kt') or glob ('*ViewModel.kt').
Inputs: name (required), limit, project.
ide_find_usagesFind usagesARead-only
Find every reference to the symbol at path:line:column across the project using the IDE's semantic index (Kotlin and Java aware, not text search).
Inputs: line (required), path (required), limit, column, +1 more.
ide_gradle_syncGradle syncB
Run 'Sync Project with Gradle Files' in Android Studio and wait for the result (success, or the failure message).
Inputs: project, waitSec.
ide_openOpen in editorA
Open a file at a line/column in the running Android Studio and bring its window to the front.
Inputs: path (required), line, column, project.
ide_problemsIDE problemsARead-only
Errors and warnings from Android Studio's live analysis of a file (Kotlin/Java compiler checks, Android Lint, inspections), without running Gradle. Opens the file in the IDE if needed.
Inputs: path (required), project, waitSec, minSeverity.
ide_project_problemsProject problemsARead-only
Run Android Studio's analysis (compiler checks, inspections, on-the-fly lint) over the project or given files/folders without opening them or running Gradle. Errors only by default; faster than a build for checking an edit compiles.
Inputs: paths, project, maxFiles, minSeverity.
ide_read_fileRead editor bufferARead-only
Read a file as Android Studio currently has it, including unsaved edits. Prefer this over reading from disk when the user is editing in the IDE.
Inputs: path (required), endLine, startLine.
ide_renameRename symbolADestructive
Rename the symbol at path:line:column and update all references, like Shift+F6 (classes also rename their file). Saves all files afterwards. If the IDE detects conflicts it shows a dialog in Studio and this call times out; resolve it there.
Inputs: line (required), path (required), newName (required), column, +3 more.
ide_runRun configurationB
Run or debug a run configuration in Android Studio, like its toolbar buttons (deploys to the IDE's selected device). Defaults to the selected configuration.
Inputs: name, debug, project.
ide_run_configurationsRun configurationsARead-only
List the project's run/debug configurations and which one is selected.
Inputs: project.
ide_save_allSave allA
Save all unsaved editor buffers to disk (build and run_app do this automatically when Studio is running).
Inputs: no named parameters.
ide_screenshotIDE screenshotARead-only
Capture Android Studio's window (or just the active editor area) as an image: see Compose previews, the layout editor, tool windows and error balloons as the user does.
Inputs: target, project.
ide_statusAndroid Studio statusARead-only
Whether Android Studio (with the bridge plugin) is running, its version, and its open projects and indexing state.
Inputs: no named parameters.
ide_sync_statusGradle sync statusARead-only
State of the most recent Gradle sync in Android Studio (running / succeeded / failed with error).
Inputs: project.
inputSend inputA
Drive the device UI: tap or long-press at coordinates, swipe, type text, or press a key (BACK, HOME, ENTER, APP_SWITCH, DEL, or any KEYCODE_*). Get coordinates from ui_dump.
Inputs: action (required), x, y, x2, +5 more.
job_cancelCancel jobCDestructive
Cancel a running background job.
Inputs: id (required).
job_statusJob statusARead-only
Check a background job (build, run_app, emulator_start). Optionally wait for it to finish. Omit id to list all jobs.
Inputs: id, waitSec, logChars.
lint_resultsRead Android Lint resultsBRead-only
Parse the Android Lint XML report (run gradle_run with lintDebug or lint first).
Inputs: module, projectDir, minSeverity.
logcatRead logcatB
Read recent device logs. Filter by app package (uses its current PID), minimum priority, tag, or a regex. Use crashesOnly to get the crash buffer.
Inputs: tag, grep, clear, lines, +4 more.
packages_listList packagesBRead-only
List installed packages, third-party only by default.
Inputs: filter, serial, thirdPartyOnly.
project_apksBuilt APKsBRead-only
List APKs produced by previous builds, newest first.
Inputs: module, projectDir.
project_infoProject infoBRead-only
Summarize the Android project: modules, their type, namespace/applicationId, SDK levels, launcher activities, Gradle and AGP versions.
Inputs: projectDir.
run_appBuild, install and launchB
The Android Studio 'Run' button: assemble the variant, install it on the device, and launch the launcher activity. Runs as a job.
Inputs: module, serial, variant, waitSec, +1 more.
screenshotScreenshotBRead-only
Capture the device screen as a PNG image. Optionally also save it to a file on this machine.
Inputs: serial, savePath.
sdk_managerSDK managerA
List installed/available SDK packages or install packages (e.g. 'platforms;android-36', 'system-images;android-36;google_apis;x86_64'). Requires the SDK Command-line Tools package.
Inputs: action (required), packages.
studio_openOpen in Android StudioB
Open a project, or a file at a line, in Android Studio (reuses the running IDE window if one is open). Handy for handing off to the human.
Inputs: path (required), line, column.
test_resultsRead test resultsARead-only
Parse JUnit XML results from the last unit test (testUnitTest) or instrumented test (connectedAndroidTest) run. Run tests with gradle_run first.
Inputs: module, failedOnly, projectDir.
ui_dumpDump UI hierarchyARead-only
Dump the on-screen view hierarchy via uiautomator, as a compact list of nodes with text, resource-id, content-desc and tap-ready center coordinates.
Inputs: raw, serial, includeAll.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 46 tools
Most tools target distinct resources, but several overlap enough to cause misselection: studio_open vs ide_open (both open files in Studio), run_app vs ide_run (both deploy and launch a variant), and ide_problems vs ide_project_problems vs lint_results (three ways to surface errors). The detailed descriptions mitigate but don't fully resolve the boundaries.
There is a general prefix-based convention (ide_*, app_*, emulator_*, device_*, project_*), but ordering is inconsistent (app_launch is noun_verb while ide_read_file is prefix_verb_noun) and several tools are bare unprefixed names (build, input, screenshot, logcat, environment). Readable, but the conventions are mixed rather than predictable.
46 tools is well past the '25+ is too many' threshold, and while the IDE+device+build surface is broad, there are real consolidation opportunities (multiple run tools, multiple problem-analysis tools, IDE-action plumbing). The weight increases the chance of an agent picking a near-duplicate.
The surface covers the full lifecycle: environment discovery, project introspection, Gradle build/test, IDE control, device/emulator management, UI automation, screenshots, logs, and file transfer. Gaps are minor (no breakpoint/debugger control or profiling tools), which agents can work around.
Related MCP Connectors
Remote MCP for Android CLI agent build gate, structured receipts, audit logs, and reviewer-ready evi
Melaya is a remote MCP server. It gives an assistant hands on your own Android phone and browser: it reads the screen through the accessibility tree, then taps, types and navigates inside the apps and sites you allow-list, with no per-app API. It also builds, schedules and runs agent pipelines across 6k+ connected tools. OAuth 2.1, nothing to install.
Cloud Android 14 phones that Claude, Claude Code, Cursor and Codex can use over MCP. Ready in ~15 s. Plain-English tasks return pass/fail, steps, screenshots and video. 1¢ per phone-minute, AI included, 100 free minutes a month.
Give your AI agent a real cloud Android phone: push APKs, drive it, get screenshots and logs.
Related MCP Servers
- AlicenseBqualityDmaintenanceAn MCP server that enables AI assistants to build, test, and debug Android applications by interacting directly with the Android development environment. It provides tools for managing emulators, executing Gradle tasks, running ADB commands, and performing UI automation via accessibility trees.14105 npm19MIT
- FlicenseNot gradedqualityAmaintenanceMCP server that provides AI coding agents real Android development tools—Gradle, adb, logcat, lint, crash triage—through a local, permissioned interface. Enables agents to inspect projects, run safe Gradle tasks, capture logs/screenshots, and triage crashes.1-
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to control a physical Android device or Docker-hosted emulator over ADB by taking screenshots and performing taps, swipes, key presses, text input, shell commands, app launches, and device info queries. It runs as a local MCP stdio server alongside a web UI and REST API for remote access.1MIT
- AlicenseNot gradedqualityAmaintenanceGives MCP-compatible AI assistants vision and control over Android devices — capturing screenshots, tapping, swiping, typing, launching apps, inspecting UI elements, streaming audio/video, transferring files, and running shell commands over ADB, with a fast binary control protocol for near-instant input and screenshots.392 npmMIT