Skip to main content
Glama
MauricePutinas

Android Studio MCP

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
STUDIO_HOMENoAlternative environment variable for Android Studio home directory.C:\Program Files\Android\Android Studio
ANDROID_HOMENoAlternative environment variable for Android SDK directory.%LOCALAPPDATA%\Android\Sdk
ANDROID_SDK_ROOTNoAlternative environment variable for Android SDK directory.%LOCALAPPDATA%\Android\Sdk
ASMCP_BUNDLETOOLNoPath to bundletool jar file (auto-downloaded on first use if not set).
ASMCP_ANDROID_SDKNoAndroid SDK directory.%LOCALAPPDATA%\Android\Sdk
ASMCP_STUDIO_HOMENoAndroid Studio home directory.C:\Program Files\Android\Android Studio
ASMCP_WORKSPACE_ROOTSNoSemicolon-separated list of allowed workspace root directories.E:\Projekte;%USERPROFILE%
ASMCP_BUILTIN_SERVER_PORTNoPort for the built-in IDE server.63342

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
as_statusA

Report the full Android Studio / toolchain environment status.

Use this FIRST to understand what is available before acting. It reports whether Android Studio is installed and running, the resolved paths for the SDK / JBR / adb / emulator / sdkmanager, the IDE build number, whether the built-in IDE server is reachable, connected devices and a count of AVDs.

Args: params (StatusInput): response_format ('json'|'markdown') and deep (bool).

Returns: str: JSON (or markdown) with keys: studio_installed (bool), studio_running (bool), studio_build (str), paths (dict of resolved tool paths), adb_version (str|None), devices (list), avds (list[str]), java_version (str|None), builtin_server_up (bool), ide_plugins (dict).

as_is_runningA

Quick check whether an Android Studio process (studio64.exe) is running.

Returns: str: JSON with running (bool) and processes (list of {image,pid,...}).

as_launchA

Launch Android Studio (optionally opening a project), detached.

The IDE is started as an independent process so the call returns immediately with its PID. If a project_dir is given it is passed to studio64.exe to open that project. The IDE's built-in server takes a few seconds to come up.

Args: params (LaunchInput): optional project_dir to open.

Returns: str: JSON with pid, already_running (bool) and the launched command.

as_closeA

Close Android Studio. Graceful by default; force-kill only on request.

A graceful close (default) sends a normal terminate signal so the IDE can save state. force=true uses taskkill /F which can lose unsaved work, so it additionally requires confirm=true.

Args: params (CloseInput): force (bool), confirm (bool).

Returns: str: JSON with the taskkill result, or a confirmation_required payload.

as_restartA

Restart Android Studio (close then relaunch). Requires confirm=true.

Args: params (CloseInput): force (bool) for the close phase, confirm (bool).

Returns: str: JSON describing the close result and the relaunch pid.

as_open_projectA

Open an existing project directory in Android Studio.

Launches (or reuses) the IDE with the given project. This does not modify project files.

Args: params (OpenProjectInput): project_dir (must exist).

Returns: str: JSON with the launched command and pid.

as_open_fileA

Open a file (optionally at a line/column) in the running Android Studio.

Prefers the built-in IDE server (instant, reuses the running window). Falls back to launching studio64.exe with --line if the server is not reachable.

Args: params (OpenFileInput): file (path), line (optional), column (optional).

Returns: str: JSON describing which method was used and whether it succeeded.

as_diffA

Open the IDE's visual diff viewer for two files or directories.

Uses studio64.exe diff <left> <right>.

Args: params (DiffInput): left and right paths.

Returns: str: JSON with the launched command and pid.

as_gradle_tasksA

List the Gradle tasks available in a project.

Args: params (GradleTasksInput): project_dir, all_tasks (bool), timeout.

Returns: str: JSON with the raw 'tasks' output and the parsed build status.

as_gradle_assembleA

Build APK(s) with assemble and report the produced artefacts.

Equivalent to Android Studio's "Build > Build APK(s)". After a successful build the response lists the produced .apk paths under build/outputs.

Args: params (GradleAssembleInput): project_dir, variant ('Debug'/'Release'), optional module (':app'), timeout.

Returns: str: JSON with gradle status, command, and 'outputs' {apk,aab,mapping}.

as_gradle_bundleB

Build an Android App Bundle (.aab) with bundle.

Args: params (GradleAssembleInput): project_dir, variant, optional module, timeout.

Returns: str: JSON with gradle status and produced 'outputs' (aab paths).

as_gradle_testA

Run unit tests (default) or instrumented connected tests.

Args: params (GradleTestInput): project_dir, instrumented (bool), module, timeout.

Returns: str: JSON with gradle status and parsed failures. HTML/XML test reports are written under /build/reports/tests and build/outputs.

as_gradle_lintA

Run Android Lint via Gradle and point to the generated reports.

Args: params (GradleProjectInput): project_dir, timeout.

Returns: str: JSON with gradle status. Reports: /build/reports/lint-results-*.html|xml.

as_gradle_cleanA

Delete build outputs via 'gradle clean'. Only touches the build/ dir.

Args: params (GradleProjectInput): project_dir, timeout.

Returns: str: JSON with gradle status.

as_gradle_dependenciesA

Print the dependency tree for a module.

Args: params (GradleDependenciesInput): project_dir, module (':app'), optional configuration filter, timeout.

Returns: str: JSON with the dependency tree in command.stdout.

as_gradle_signing_reportA

Show signing configs and certificate fingerprints (SHA1/SHA256).

Useful for configuring API keys (Maps, Firebase). Secrets in the output are redacted by the server.

Args: params (GradleProjectInput): project_dir, timeout.

Returns: str: JSON with the signingReport output.

as_gradle_run_taskA

Run arbitrary Gradle tasks with optional extra args (power tool).

Use the dedicated tools (assemble/test/lint/clean) when possible; this is the escape hatch for anything else (e.g. installDebug, uninstallAll, custom tasks).

Args: params (GradleRunTaskInput): project_dir, tasks (list), args (list), timeout.

Returns: str: JSON with gradle status, command output and detected build outputs.

as_gradle_stopA

Stop all Gradle daemons for the project (frees memory, clears stuck state).

Args: params (GradleProjectInput): project_dir, timeout.

Returns: str: JSON with command output.

as_sdk_listA

List installed (and optionally available) Android SDK packages.

Args: params (ListInput): installed_only (bool), timeout.

Returns: str: JSON with 'installed' and 'available' lists of {path, version, description}, plus the raw output.

as_sdk_installA

Install one or more Android SDK packages (downloads + accepts licenses).

Args: params (InstallInput): packages (list of sdkmanager paths), confirm, timeout.

Returns: str: JSON with the install command output, or confirmation_required.

as_sdk_accept_licensesA

Accept all pending Android SDK licenses (sdkmanager --licenses).

Args: params (LicensesInput): confirm, timeout.

Returns: str: JSON with the command output, or confirmation_required.

as_avd_listA

List configured Android Virtual Devices.

Args: params (AvdListInput): detailed (bool).

Returns: str: JSON with 'names' (list) and, if detailed, 'avds' (list of {name, device, target, path, based_on}).

as_avd_createA

Create a new Android Virtual Device from an installed system image.

The system image must already be installed (use as_sdk_install with e.g. 'system-images;android-34;google_apis;x86_64').

Args: params (AvdCreateInput): name, system_image, device, confirm.

Returns: str: JSON with the create command output, or confirmation_required.

as_avd_deleteA

Delete an Android Virtual Device permanently. Requires confirm=true.

Args: params (AvdDeleteInput): name, confirm.

Returns: str: JSON with the delete command output, or confirmation_required.

as_avd_startB

Boot an AVD in the emulator (detached) and optionally wait for boot.

Args: params (AvdStartInput): name, cold_boot, wipe_data, headless, wait_boot.

Returns: str: JSON with the emulator pid and (if wait_boot) the booted serial.

as_avd_stopA

Stop a running emulator (adb emu kill).

Args: params (AvdStopInput): optional serial (else the first running emulator).

Returns: str: JSON with the command output.

as_adb_devicesA

List connected devices and emulators (adb devices -l).

Returns: str: JSON with 'devices': list of {serial, state, model, device, product, transport_id, is_emulator} and 'count'.

as_adb_installB

Install an APK onto a device/emulator.

Args: params (InstallInput): apk_path, serial, reinstall, allow_downgrade, grant_permissions.

Returns: str: JSON with the install result.

as_adb_uninstallA

Uninstall an application (removes app + data). Requires confirm=true.

Args: params (PackageInput): package, serial, confirm.

Returns: str: JSON with the uninstall result, or confirmation_required.

as_adb_logcatA

Dump a snapshot of the most recent device logs (non-streaming).

Args: params (LogcatInput): serial, lines, filter_spec, clear_first, grep.

Returns: str: JSON with 'log' (the captured text) and 'line_count'.

as_adb_logcat_clearB

Clear the device log buffer (adb logcat -c).

Args: params (SerialInput): serial.

Returns: str: JSON with the command result.

as_adb_shellA

Run a shell command on the device. Read-only commands run freely; anything potentially destructive requires confirm=true.

Recognised safe first-words include getprop, dumpsys, pm list, settings get, ls, cat, df, ps, am, input, wm, screencap. Commands containing markers like 'rm ', 'reboot', 'uninstall', 'clear', 'wipe' always require confirm=true.

Args: params (ShellInput): command, serial, confirm.

Returns: str: JSON with stdout/stderr, or confirmation_required.

as_adb_screenshotA

Capture the device screen to a PNG on this PC (adb exec-out screencap).

Args: params (ScreenshotInput): out_path (inside a workspace root), serial.

Returns: str: JSON with 'saved_to' and the file size.

as_adb_inputB

Send a tap/swipe/text/keyevent to the device (UI automation of the app).

Args: params (InputEventInput): kind ('text'|'keyevent'|'tap'|'swipe'), value, serial.

Returns: str: JSON with the command result.

as_adb_start_appA

Launch an app by component or by package (via monkey launcher intent).

Args: params (StartAppInput): component ('pkg/.Activity') or package, serial.

Returns: str: JSON with the launch result.

as_adb_stop_appA

Force-stop an app (am force-stop). Does not delete data.

Args: params (PackageInput): package, serial (confirm not required).

Returns: str: JSON with the command result.

as_adb_pullA

Copy a file from the device to this PC (adb pull).

Args: params (FileTransferInput): remote (device path), local (workspace path), serial.

Returns: str: JSON with the result and saved local path.

as_adb_pushA

Copy a file from this PC to the device (adb push).

Args: params (FileTransferInput): local (workspace path), remote (device path), serial.

Returns: str: JSON with the result.

as_project_createA

Scaffold a new, buildable Android project (Views or Compose template).

Generates settings/build Gradle files, a Gradle wrapper, local.properties (pointing at the detected SDK), manifest, MainActivity and resources, then optionally opens it in Android Studio.

Args: params (CreateProjectInput): parent_dir, name, application_id, template, min_sdk, compile_sdk, open_in_studio, confirm.

Returns: str: JSON with project_dir, files_written, wrapper status, and a hint to build via as_gradle_assemble. Or confirmation_required.

as_project_infoA

Extract metadata from an Android project without building it.

Reads settings/build Gradle files and the app manifest to report the modules, applicationId, version, SDK levels, plugins and permissions.

Args: params (ProjectPathInput): project_dir.

Returns: str: JSON with modules, application_id, version_code/name, min_sdk/target_sdk/compile_sdk, manifest (permissions, activities), and detected gradle files.

as_project_validateA

Check that a project has the expected structure and report problems.

Args: params (ProjectPathInput): project_dir.

Returns: str: JSON with 'valid' (bool), 'problems' (list) and 'checks' (dict).

as_project_backupA

Create a timestamped .zip backup of a project (excluding build artefacts).

Args: params (ProjectPathInput): project_dir.

Returns: str: JSON with the backup zip path.

as_project_list_recentA

List recently opened projects from Android Studio's config.

Args: params (RecentInput): limit.

Returns: str: JSON with 'recent' (list of project paths). Empty if none recorded.

as_apk_infoA

Summarise an APK: package, version, SDK levels, permissions, label.

Uses aapt2 badging (most reliable) and falls back to apkanalyzer.

Args: params (ApkInput): apk_path.

Returns: str: JSON with package, version_code/name, min_sdk, target_sdk, label, launchable_activity and permissions.

as_apk_methodsA

Report dex method counts and the largest packages (apkanalyzer dex).

Args: params (ApkInput): apk_path.

Returns: str: JSON with the reference method count and per-package breakdown text.

as_apk_filesizeA

Report the on-disk and estimated download size of an APK.

Args: params (ApkInput): apk_path.

Returns: str: JSON with file_size and download_size (bytes).

as_apk_verify_signatureA

Verify an APK's signature and print the signing certificates (apksigner).

Args: params (ApkInput): apk_path.

Returns: str: JSON with verified (bool) and the certificate details.

as_apk_compareA

Compare the file sizes of two APKs (apkanalyzer apk compare).

Args: params (ApkCompareInput): apk_a (baseline), apk_b.

Returns: str: JSON with the comparison table.

as_inspect_codeA

Run Android Studio's code inspection headlessly and return the problems.

This launches the IDE's offline inspection engine (the same one behind "Analyze > Inspect Code") via studio64.exe inspect, writes XML reports to a temp dir and parses them into a structured problem list grouped by severity and inspection. It must index the project first, so it can take minutes on a large project. Do not run while Android Studio is open with the same project (config-dir contention) — close it first or expect a slower run.

Args: params (InspectInput): project_dir, optional scope_dir, optional profile, max_problems, timeout.

Returns: str: JSON with total_problems, by_severity, by_inspection, and a truncated 'problems' list of {inspection, severity, file, line, description}.

as_format_codeA

Reformat files in place using the IDE's formatter (studio64.exe format).

Backups of every affected file are written to the server backup dir before formatting. Requires confirm=true.

Args: params (FormatInput): target, mask, recursive, confirm.

Returns: str: JSON with the formatter output and the list of backups created.

as_ide_statusA

Report live-IDE connectivity: process, built-in server, MCP plugin.

Returns: str: JSON with studio_running (bool), builtin_server_up (bool), builtin_server_url, about (IDE build info if reachable), official_mcp_plugin_installed (bool) and guidance.

as_ide_list_mcp_toolsA

List the tools exposed by the running IDE's built-in MCP server.

Bridges to studio64.exe stdioMcpServer. Requires the official MCP Server plugin. Returns an actionable message if unavailable.

Args: params (TimeoutInput): timeout.

Returns: str: JSON with available (bool), tools (list) or an error explanation.

as_ide_call_mcp_toolA

Invoke a tool on the running IDE's built-in MCP server (live control).

Use as_ide_list_mcp_tools first to discover available tool names/arguments. Requires the official MCP Server plugin and a running IDE.

Args: params (CallMcpToolInput): name, arguments, timeout.

Returns: str: JSON with the tool result, or an error explanation.

as_ui_screenshotA

Capture a screenshot of the Android Studio window (or full screen).

Args: params (ScreenshotInput): out_path (optional), window_only (bool).

Returns: str: JSON with 'saved_to' and the captured dimensions.

as_ui_focusA

Bring the Android Studio window to the foreground.

Returns: str: JSON indicating whether a Studio window was found and focused.

as_ui_send_keysA

Focus Android Studio and send a raw SendKeys sequence. Requires confirm=true.

This is a generic, lower-reliability fallback. Prefer the CLI/Gradle/ADB tools. After sending, a screenshot is captured for verification.

Args: params (SendKeysInput): keys (SendKeys string), confirm, screenshot_after.

Returns: str: JSON with the send result and a verification screenshot path.

as_ui_invoke_actionA

Invoke any IDE action via Find Action (Ctrl+Shift+A). Requires confirm=true.

This opens Find Action, types the action name and presses Enter — giving access to essentially any IDE command (e.g. 'Sync Project with Gradle Files', 'Rebuild Project', 'Reformat Code'). It is a best-effort UI path; verify the result with the returned screenshot. Prefer dedicated tools where they exist.

Args: params (InvokeActionInput): action (name), confirm, screenshot_after.

Returns: str: JSON with the result and a verification screenshot path.

as_report_healthA

Produce a comprehensive markdown health report of the dev environment.

Aggregates installation/runtime status, SDK package count, connected devices, configured AVDs and (optionally) a project's metadata into one report.

Args: params (HealthInput): optional project_dir.

Returns: str: JSON with a 'markdown' report plus the underlying structured data.

as_logs_ideA

Return the tail of Android Studio's idea.log (optionally filtered by level).

Args: params (LogTailInput): lines, level (optional 'ERROR'/'WARN').

Returns: str: JSON with 'log' (text) and the source path.

as_logs_mcpA

Return the tail of this MCP server's own log file.

Args: params (LogTailInput): lines, level (optional).

Returns: str: JSON with 'log' (text) and the source path.

as_configA

Show the fully-resolved configuration (all discovered paths and roots).

Returns: str: JSON with every resolved path, the workspace allow-list, and the built-in server URL. Use this to debug discovery/path issues.

as_backup_fileB

Create a timestamped backup of a single file in the server backup dir.

Args: params (BackupFileInput): path.

Returns: str: JSON with the backup path.

as_restore_backupA

Restore a previously-created backup file to a destination. Requires confirm=true.

The current destination (if any) is itself backed up before being overwritten.

Args: params (RestoreInput): backup_path, restore_to, confirm.

Returns: str: JSON with the restore result.

as_run_appA

Build, install and launch an app on a device/emulator, then capture logs.

One-shot equivalent of Android Studio's Run button:

  1. assemble 2. install the APK 3. launch the launcher activity

  2. capture the app's recent logcat (and detect crashes) 5. optional screenshot.

Args: params (RunAppInput): project_dir, variant, module, serial, install, launch, capture_logcat_lines, screenshot, timeout.

Returns: str: JSON with a 'steps' object (build/install/launch/logcat/screenshot), the apk path, package, and 'crash_detected' (bool).

as_logcat_watch_startA

Start a background logcat capture you can poll incrementally.

Returns a watch_id; read new lines with as_logcat_watch_read (pass the returned offset back each time) and stop it with as_logcat_watch_stop.

Args: params (WatchStartInput): serial, filter_spec, clear_first.

Returns: str: JSON with watch_id and the initial offset (0).

as_logcat_watch_readA

Read new output from a running logcat watch since a byte offset.

Args: params (WatchReadInput): watch_id, since_offset, grep.

Returns: str: JSON with 'text' (new lines), 'offset' (pass to the next read), 'running' and 'total_bytes'.

as_logcat_watch_stopB

Stop a running logcat watch (or any managed process) by id.

Args: params (ProcIdInput): proc_id (the watch_id).

Returns: str: JSON with the final process info.

as_proc_listA

List all background processes started by this server (watches etc.).

Returns: str: JSON with 'processes': list of {id, kind, running, pid, output_file, ...}.

as_proc_stopB

Stop a managed background process by id.

Args: params (ProcIdInput): proc_id.

Returns: str: JSON with the final process info.

as_retraceA

De-obfuscate an R8/ProGuard stack trace using its mapping.txt (retrace).

Args: params (RetraceInput): mapping_file (mapping.txt), stacktrace (text).

Returns: str: JSON with the de-obfuscated trace in 'retraced'.

as_screenrecordC

Record the device screen to an .mp4 and pull it to this PC.

Args: params (ScreenrecordInput): out_path, seconds, serial.

Returns: str: JSON with the saved local path and size.

as_aab_build_apksA

Convert an Android App Bundle (.aab) into an installable .apks set (bundletool).

Args: params (AabBuildInput): aab_path, out_apks, universal, confirm.

Returns: str: JSON with the produced .apks path.

as_aab_installA

Install a .apks set onto a connected device (bundletool install-apks).

Args: params (AabInstallInput): apks_path, serial, confirm.

Returns: str: JSON with the install result.

Prompts

Interactive templates invoked by user choice

NameDescription
run_appBuild, install and run an Android project on a device/emulator.
diagnose_buildDiagnose and fix a failing Gradle build.

Resources

Contextual data attached and managed by the client

NameDescription
resource_configResolved server configuration (all discovered tool paths and roots).
resource_idea_logThe last 200 lines of Android Studio's idea.log.
resource_recent_projectsRecently opened Android Studio projects (from recentProjects.xml).

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/MauricePutinas/Android-Studio-MCP-Claude-Code'

If you have feedback or need assistance with the MCP directory API, please join our Discord server