Skip to main content
Glama
Android DevTools MCP

Android DevTools MCP

by xleepy

Android DevTools MCP

An MCP server that lets an agent inspect and operate an already-running Android emulator or physical device through ADB.

It provides a Chrome-DevTools-style workflow:

  1. Capture a semantic UI snapshot or screenshot.

  2. Identify a UI node.

  3. Tap the revalidated node, type text, swipe, or press a key.

  4. Inspect the resulting UI, foreground activity, and application logs.

The server talks to Android through ADB, not directly to QEMU. This keeps the same interface usable with Android Studio emulators, headless emulators, third-party QEMU frontends, and physical devices.

Requirements

  • Node.js 20 or later

  • Android SDK Platform Tools with adb available on PATH, or ADB_PATH set to the executable

  • A booted device visible in adb devices -l

  • USB debugging authorization accepted for physical devices

The server attaches to existing devices. It does not start AVDs, install APKs, or launch applications.

Related MCP server: Android MCP

Build and run

npm install
npm run build
node dist/cli.js

The process uses MCP stdio, so its standard output is reserved for protocol messages. Operational messages are written to standard error.

Example MCP client configuration for this checkout:

{
  "mcpServers": {
    "android-devtools": {
      "command": "node",
      "args": [
        "<path-to-repo>/dist/cli.js"
      ],
      "env": {
        "ANDROID_SERIAL": "emulator-5554"
      }
    }
  }
}

ANDROID_SERIAL is optional when exactly one ready device is connected. Use ADB_PATH when adb is not on PATH.

Tools

Tool

Purpose

android_list_devices

List ready, offline, and unauthorized ADB devices

android_take_snapshot

Return a compact semantic UI hierarchy

android_take_screenshot

Return the current display as PNG

android_get_app_state

Inspect foreground activity, process, and display state

android_tap

Tap coordinates or a revalidated snapshot node

android_type_text

Clear and type into the focused field

android_swipe

Perform a coordinate-based swipe

android_press_key

Send Android key events

android_wait_for

Wait for a selector and semantic state

android_get_logs

Return bounded logcat lines for an app's current PIDs

Snapshot selectors use exact AND matching over resource ID, text, content description, class, and state flags. Node IDs are scoped to one snapshot. Before a node tap, the server captures a fresh hierarchy and verifies that the same semantic node still occupies the same bounds. It returns a stale or ambiguous-target error instead of tapping when that check fails.

Verification

npm run check
npm test
npm run build

There is also an opt-in smoke test for a disposable emulator. It sends the Home key and reads the current launcher's logs:

$env:ANDROID_MCP_TEST_SERIAL = "emulator-5554"
npm run test:device

Limitations

  • UI Automator exposes the accessibility/semantic tree, not Android Studio's private Layout Inspector data.

  • Canvas-rendered interfaces, games, protected windows, and some WebViews may only be inspectable through screenshots and coordinates.

  • Compose elements need usable semantics to appear as distinct nodes.

  • Text entry intentionally accepts only ADB-safe ASCII: letters, numbers, spaces, and .,_@+-/:=. Unicode input requires an optional device-side input method or instrumentation component and is not part of this release.

  • Network tracing, CPU/memory profiling, frame timing, AVD lifecycle, and APK management are outside the current black-box scope.

Available Tools

10 tools
android_get_app_stateGet Android app stateA
Read-onlyIdempotent

Get the foreground package/activity, optional package process state, and display metadata.

Inputs: serial, package.

android_get_logsGet Android app logsA
Read-onlyIdempotent

Read bounded logcat output filtered to the requested or foreground application's current process IDs.

Inputs: level, serial, package, maxLines.

android_list_devicesList Android devicesA
Read-onlyIdempotent

List all ADB-connected emulators and physical devices, including offline and unauthorized targets.

Inputs: no named parameters.

android_press_keyPress Android keyA
Destructive

Press Back, Home, Enter, Delete, a directional key, a KEYCODE_* name, or a numeric Android keycode.

Inputs: key (required), serial.

android_swipeSwipe Android UIB
Destructive

Perform a swipe gesture between two screen coordinates.

Inputs: to (required), from (required), serial, durationMs.

android_take_screenshotCapture Android screenshotC
Read-onlyIdempotent

Capture the current Android display as a PNG image.

Inputs: serial.

android_take_snapshotInspect Android UIA
Read-onlyIdempotent

Capture a compact UI Automator hierarchy. Use its snapshot and node IDs for safe node-targeted taps.

Inputs: serial.

android_tapTap Android UIB
Destructive

Tap either explicit screen coordinates or a node from the latest snapshot. Node taps are revalidated before acting.

Inputs: x, y, nodeId, serial, +1 more.

android_type_textType text in AndroidA
Destructive

Type ADB-safe ASCII text into the focused UI node. Optionally clear its existing content first.

Inputs: text (required), clear, serial.

android_wait_forWait for Android UI stateA
Read-onlyIdempotent

Poll the semantic UI until matching nodes exist, disappear, or have the requested state.

Inputs: state (required), selector (required), serial, timeoutMs, +1 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.8/5.0

    Scored across 10 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose: device listing, app state, logs, input methods (tap, swipe, key, type), UI capture (screenshot, snapshot), and UI waiting. No overlaps.

    Naming Consistency5/5

    All tools follow the consistent prefix 'android_' and use snake_case with verb_noun pattern (e.g., get_app_state, press_key, take_screenshot). Minor exception with 'wait_for' but still consistent pattern.

    Tool Count5/5

    10 tools is well-scoped for Android UI automation, covering essential actions without being too many or too few.

    Completeness4/5

    Covers core UI interaction (tap, swipe, type, key press), device info, logging, screenshots, and UI hierarchy snapshots. Missing actions like long press or scroll, but these can be worked around.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      A
      quality
      D
      maintenance
      Enables AI agents to interact with Android devices through UI manipulation, screen capture, touch gestures, text input, and app management via ADB. Provides comprehensive mobile automation capabilities including element detection, navigation, and application control for Android device testing and interaction.
      9
      123 PyPI
      2
      -
    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables interaction with Android devices and emulators through ADB, allowing control actions like tapping, text input, screenshots, UI inspection, and app launching through natural language.
      8
      -
    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables AI agents to visually perceive and directly control Android devices via ADB and screen-control tooling, including screenshots, taps, swipes, typing, app management, UI inspection, file transfer, shell commands, and audio/video streaming.
      392 npm
      MIT