Skip to main content
Glama

šŸ¤– android-mcp

A standard Model Context Protocol (MCP) server that enables AI agents (Claude Desktop, Cursor, Antigravity, and autonomous LLMs) to directly control, inspect, and automate Android devices, Waydroid, and AVD emulators over ADB.


šŸ—ļø Architecture

ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”
│ AI Client (Claude / Cursor)   │
ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜
               │ JSON-RPC (stdio)
               ā–¼
ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”
│         android-mcp           │
│   (Model Context Protocol)    │
ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜
               │ ADB (Android Debug Bridge)
               ā–¼
ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”
│ Android Device / Waydroid     │
ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜

Related MCP server: scrcpy-mcp

✨ Features

  • šŸ‘ļø Vision Support: Captures instant PNG screenshots directly into the LLM's context window.

  • šŸŽÆ Smart UI Click: Parse on-screen XML hierarchy (uiautomator) and click buttons by human label or text (e.g. android_click_by_text("Sign In")).

  • šŸ‘† Gestures & Input: Full support for precise taps, multi-point swipes/drags, and text typing.

  • āŒØļø Hardware Keys: Send system keys (BACK, HOME, ENTER, POWER, VOLUME).

  • šŸ“± App Management: Launch, stop, and inspect installed third-party apps.

  • ⚔ Zero External Pip Dependencies: Built entirely on Python standard library and ADB.


šŸš€ Quick Setup

1. Prerequisites

Ensure adb is installed and your device or Waydroid container is connected:

# Verify ADB sees your device or emulator
adb devices

2. Connect to Claude Desktop

Open your Claude Desktop configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

  • Windows: %APPDATA%\Claude\claude_desktop_config.json

  • Linux: ~/.config/Claude/claude_desktop_config.json

Add android-mcp to your mcpServers:

{
  "mcpServers": {
    "android": {
      "command": "python3",
      "args": ["/path/to/android-mcp/run_server.py"]
    }
  }
}

3. Connect to Cursor / Other MCP Clients

Add an entry pointing to python3 /path/to/android-mcp/run_server.py in your client's MCP settings tab.


šŸ› ļø Available MCP Tools

Tool Name

Description

android_check_connection

Verify device connection, model, and OS version

android_screenshot

Capture screen as base64 PNG for AI visual analysis

android_click_by_text

Find button or label by text and tap its center

android_tap

Tap exact screen coordinate (x, y)

android_swipe

Drag / swipe from (x1, y1) to (x2, y2)

android_type_text

Type string into the active focused input field

android_press_key

Press system key (HOME, BACK, ENTER, POWER)

android_get_ui_tree

Get list of all visible text elements and bounds

android_launch_app

Launch app by package name (e.g. com.android.settings)

android_stop_app

Force-stop an app package

android_list_apps

List installed application package names

android_shell

Run raw ADB shell command on device


šŸ’¬ Example Prompts for Your AI

Once connected in Claude or Cursor, you can ask your AI naturally:

  • "Check if my Android device is connected."

  • "Take a screenshot of Android and tell me what screen is currently open."

  • "Tap the Settings button on screen."

  • "Type 'hello world' into the active search bar and press Enter."

  • "Go back to the Home screen."


āš™ļø Environment Variables (Optional)

Variable

Description

ANDROID_SERIAL

Specific device serial number to target (if multiple devices are connected)

ANDROID_ADB_HOST

Fallback TCP host:port to auto-connect (default: 127.0.0.1:5555)


šŸ›”ļø License

Distributed under the MIT License. Free for personal and commercial use.

Available Tools

12 tools
android_check_connectionA

Check connection status with Android device or emulator, returning model and Android OS version.

Inputs: no named parameters.

android_click_by_textB

Smart-click: searches the screen UI hierarchy for an element with matching text or description and taps its center.

Inputs: text (required).

android_get_ui_treeB

Inspect all visible UI elements on the current Android screen, returning text labels, resource IDs, and bounding coordinates.

Inputs: no named parameters.

android_launch_appB

Launch an Android app by its package name (e.g. com.android.settings).

Inputs: package_name (required).

android_list_appsC

List installed application package names on the device.

Inputs: third_party_only.

android_press_keyA

Press an Android hardware/system key (BACK, HOME, ENTER, TAB, POWER, VOLUME_UP, VOLUME_DOWN).

Inputs: key (required).

android_screenshotA

Capture the current screen of the Android device and return it as a base64 PNG image for visual analysis.

Inputs: no named parameters.

android_shellC

Execute an ADB shell command directly on the Android device.

Inputs: command (required).

android_stop_appB

Force-stop a running Android application.

Inputs: package_name (required).

android_swipeB

Perform a swipe or drag gesture from (x1, y1) to (x2, y2).

Inputs: x1 (required), x2 (required), y1 (required), y2 (required), +1 more.

android_tapC

Tap on specific screen coordinates (x, y).

Inputs: x (required), y (required).

android_type_textB

Type a string of text into the currently active input field on Android.

Inputs: text (required).

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 12 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose: connection check, screenshot, coordinate tap, swipe, text input, key press, text-based click, UI tree inspection, and app lifecycle commands. The only mild overlap is android_tap vs android_click_by_text and android_shell's broad scope, but descriptions make the boundaries explicit.

    Naming Consistency5/5

    Every tool uses the consistent android_ prefix with a verb-based snake_case convention (android_tap, android_type_text, android_launch_app). No deviations or mixed conventions.

    Tool Count5/5

    12 tools is well-scoped for Android device automation, covering interaction, inspection, and app management without redundancy. Each tool earns its place.

    Completeness4/5

    Covers the full core lifecycle: connect, screenshot, input (tap/swipe/type/key/click-by-text), UI inspection, app launch/stop/list, and raw shell. Minor gaps like long-press or explicit scroll/read-field operations exist but are workable via swipe, shell, or UI tree.

    Maintenance

    ActivityStale
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      Enables AI assistants to interact with Android devices and emulators via ADB, providing tools for screenshots, UI inspection, touch and text input, app management, and device control.
      42
      200 npm
      22
      MIT
    • 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.
      357 npm
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Enables an AI client to control an Android emulator or USB device over ADB by selecting a device, inspecting the UI hierarchy, and performing taps, swipes, text entry, key presses, and app launches. It relies only on Android platform-tools and exposes a compatible tool surface for phone automation.
      12
      386 npm
      MIT
    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables AI agents to see and control Android devices over ADB and scrcpy, with image-returning screenshots, taps, swipes, typing, app and file management, UI element inspection, shell commands, and video/audio streaming or recording. It offers fast scrcpy-based input and screenshots with automatic ADB fallback so tools keep working when scrcpy isn't available.
      357 npm
      MIT