# androidbuild-mcp [Health: Active]

**Category:** 💻 Developer Tools  
**Repository:** https://github.com/dev-jackson/androidbuild-mcp  
**GitHub Stars:** 1  
**npm Downloads (last month):** 335  
**Views:** 5  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/androidbuild-mcp

## Description
Build, deploy, drive and debug Android apps: Gradle, emulators, adb, logcat, UI automation

## Tools
Capabilities this server exposes over MCP:

- **doctor** — Check the Android development environment: SDK location, adb, emulator, avdmanager, Java, and connected devices. Run this first if any other tool fails with a missing-binary error.
- **session_set_defaults** — Set default projectDir/module/variant/serial/appId used by other tools when the corresponding argument is omitted. Set these once after discovering the project.
- **session_show_defaults** — Show the current session defaults.
- **session_clear_defaults** — Clear all session defaults, or only the listed keys.
- **discover_projects** — Find Android/Gradle projects (directories with settings.gradle[.kts]) under a path. Use the result to session_set_defaults projectDir.
- **list_modules** — List modules declared in settings.gradle(.kts) of the project.
- **list_variants** — List build variants of a module by inspecting its Gradle assemble tasks (runs './gradlew <module>:tasks').
- **get_app_id** — Get the applicationId (package name) of a module, parsed from its build.gradle(.kts). Needed by install/launch/log tools.
- **show_gradle_config** — Show toolchain versions: Gradle (from wrapper properties) and everything in the version catalog (AGP, Kotlin, Compose, ...).
- **build_app** — Build an APK with Gradle (assemble<Variant>). On failure returns compact compiler errors with file:line. On success returns the APK path.
- **build_run** — Build the APK, install it on a device/emulator (adb install -r), and launch the app. Needs appId (session default or argument) to launch.
- **test_app** — Run local JVM unit tests (test<Variant>UnitTest) and return a parsed pass/fail summary with failure messages.
- **test_instrumented** — Run instrumented tests on a connected device/emulator (connected<Variant>AndroidTest) and return a parsed summary. Requires a booted device.
- **lint** — Run Android Lint (lint<Variant>) and return the textual report summary.
- **clean** — Run gradle clean for the project.
- **get_apk_path** — Locate the most recent built APK for a module/variant without building.
- **stop_gradle** — Stop the project's Gradle daemons (use when a build hangs or to free memory).
- **list_devices** — List connected devices and emulators with serial, state, model, Android version and API level.
- **install_app** — Install an APK on a device/emulator (adb install -r).
- **launch_app** — Launch an app by application id (resolves the launcher activity automatically).
- **stop_app** — Force-stop a running app (am force-stop).
- **uninstall_app** — Uninstall an app from a device/emulator.
- **clear_app_data** — Clear all data of an app (pm clear) — resets it to a fresh-install state.
- **get_app_info** — Get installed-app info from the device: version, target/min SDK, install path, running PID.
- **list_avds** — List available Android Virtual Devices and which ones are currently running.
- **boot_emulator** — Boot an AVD in the background and wait until Android finishes booting. Returns the adb serial. Set wipeData to factory-reset the AVD on boot.
- **kill_emulator** — Shut down a running emulator (adb emu kill).
- **create_avd** — Create an AVD from an installed system image (e.g. 'system-images;android-35;google_apis;arm64-v8a'). If systemImage is omitted, lists the installed images to choose from.
- **delete_avd** — Delete an AVD permanently.
- **set_emulator_location** — Set the GPS location of a running emulator.
- **set_appearance** — Switch a device/emulator between dark and light mode (cmd uimode night).
- **statusbar_demo_mode** — Enable clean status bar for screenshots (fixed clock, full battery, full signal) or disable it.
- **record_video_start** — Start recording the device screen (adb screenrecord, max 3 minutes). Returns a recordingId for record_video_stop.
- **record_video_stop** — Stop a screen recording and pull the MP4 to the local machine.
- **start_log_capture** — Start capturing logcat to a file in the background. Filter by app (via its pid) and/or tag. Returns a sessionId for stop_log_capture. The app must be running to filter by appId.
- **stop_log_capture** — Stop a log capture session and return the file path plus the last lines.
- **get_logs** — One-shot dump of recent logcat lines, optionally filtered by app (must be running) and/or tag.
- **get_crash_logs** — Dump the crash log buffer (Java exceptions, native crashes, ANRs).
- **screenshot** — Take a screenshot of the device/emulator screen and return it as an image. With annotate: true (needs the Google android CLI), UI elements get numbered bounding boxes — including text inside images/WebViews that snapshot_ui cannot see.
- **snapshot_ui** — Dump the current UI as a compact list of actionable elements (text, id, content-desc, tap coordinates). Use the @(x,y) centers with tap/long_press. Text-heavy screens are capped; pass 'filter' to search within them.
- **tap** — Tap the screen. Coordinates from snapshot_ui are exact device pixels — prefer them over estimating positions by looking at a screenshot image. Instead of pixels you can pass screen percentages (0-1): safer when estimating positions from a screenshot image.
- **tap_element** — Tap element #N from the most recent screenshot { annotate: true } capture — no coordinate math needed. The mapping is exact even if your client displays the image scaled. Re-capture after the UI changes: element numbers go stale.
- **scroll** — Scroll the screen in a direction (computes a safe swipe in the middle of the screen, avoiding the status bar and navigation areas). Prefer this over raw swipe for scrolling.
- **long_press** — Long-press the screen at coordinates. Instead of pixels you can pass screen percentages (0-1): safer when estimating positions from a screenshot image.
- **swipe** — Swipe from one point to another (scrolling, dismissing). For drag-and-drop use drag instead. Instead of pixels you can pass screen percentages (0-1): safer when estimating positions from a screenshot image.
- **drag** — Drag an element from one point to another (input draganddrop). Instead of pixels you can pass screen percentages (0-1): safer when estimating positions from a screenshot image.
- **type_text** — Type ASCII text into the focused field. Waits for the soft keyboard first, so it is safe to call right after tapping a field. Options: clear the field first, press ENTER after. Non-ASCII characters are not supported by adb input.
- **key_press** — Press a hardware/navigation key: BACK, HOME, ENTER, TAB, DELETE, ESCAPE, MENU, APP_SWITCH, DPAD_*, or any KEYCODE_ name.
- **key_sequence** — Press several keys in order (same names as key_press).
- **wait_for_ui** — Poll the UI until an element containing the given text / content-desc / resource-id appears. Returns its tap coordinates.
- **get_coverage_report** — Run a coverage Gradle task (Kover or Jacoco) and summarize line coverage per package. Tries koverXmlReport<Variant> by default; pass 'task' for a custom one (e.g. jacocoTestReport). The project must apply a coverage plugin.
- **get_file_coverage** — Show covered/uncovered line numbers of one source file from the latest coverage report (run get_coverage_report first).
- **scaffold_android_project** — Create a new minimal Jetpack Compose app project (single module, version catalog, Gradle wrapper included) ready to build with build_app.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "androidbuild-mcp": {
    "command": "npx",
    "args": ["-y","@asjackson/androidbuild-mcp"],
    "env": {
      "ANDROID_HOME": ""
    }
  }
}
```

**Requires environment variables:** `ANDROID_HOME` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What the androidbuild-mcp MCP server does

The androidbuild-mcp MCP server gives an MCP client a structured interface for Android development workflows. It can inspect Gradle projects, identify modules and variants, read application IDs, review Gradle configuration, and check whether the local SDK, Java, adb, emulator tooling, and connected devices are available.

Build and quality workflows include APK compilation, combined build-install-launch operations, JVM unit tests, instrumented tests, Android Lint, Gradle cleaning, APK discovery, daemon shutdown, and Kover or JaCoCo coverage summaries. Coverage can also be inspected at the source-file level. Build failures are returned in a compact form with file and line information.

The server also covers device and app lifecycle tasks. Agents can list devices and AVDs, create or remove AVDs, boot an emulator until it is ready, stop it, change emulator location or appearance, and prepare the status bar for demonstrations. APKs can be installed with adb, while apps can be launched, stopped, uninstalled, reset, or inspected.

## How it works

The androidbuild-mcp MCP server runs as a stdio MCP process. The documented quick-start path uses `npx -y @asjackson/androidbuild-mcp`, so a separate package installation is not required for the first run. It can also be built from a cloned source tree and started from its generated `dist/index.js` file.

A client can establish session defaults for the project path, module, build variant, device serial, and application ID. Later calls can use those defaults instead of repeating the same values; the defaults can be displayed or cleared when the workflow changes.

UI automation uses adb-backed actions such as taps, swipes, scrolling, dragging, long presses, text entry, key presses, and waits for visible elements. `snapshot_ui` reports named elements and device-pixel coordinates. Screenshots can optionally be annotated with numbered regions, and screen recordings can be started and stopped. Log tools provide filtered dumps, crash-buffer output, and background capture to a file.

## Setup and configuration

The documented prerequisites are Node.js 18 or newer, an Android SDK installation, and JDK 17 or newer for Gradle builds. The SDK can be exposed through `ANDROID_HOME` or found in a default installation location. The server's `doctor` tool checks these dependencies along with adb, emulator tooling, and connected devices.

For Claude Code, add the server with `claude mcp add androidbuild -- npx -y @asjackson/androidbuild-mcp`. Other MCP clients can use a server entry whose command is `npx` and whose arguments are `-y` and `@asjackson/androidbuild-mcp`. Running from source requires cloning the repository, installing npm dependencies, building the project, and pointing the client at the resulting Node entry point.

Two optional extras are documented. Google's Android CLI enables annotated screenshots, and ADBKeyboard enables non-ASCII text input; the server uses that input method automatically after it is installed.

## Tools and capabilities

The tool groups cover environment checks, project inspection, session state, building and testing, emulator management, application lifecycle, UI automation, logs, video recording, and project scaffolding. The scaffolding tool creates a minimal Compose project described as buildable out of the box.

## Limitations and notes

The server depends on the local Android SDK, Java, Gradle project, adb, and available device or emulator state. Instrumented tests and UI actions require a usable target device. Screen recording is limited to three minutes. Raw screen coordinates can be distorted when a client scales an image, so named UI elements, annotated element numbers, or percentage coordinates are safer choices. Text-heavy screens may be capped when returned through UI inspection.

_Full upstream README: https://allmcps.com/mcp/androidbuild-mcp/readme_

