Skip to main content
Glama
android-adb-mcp

android-adb-mcp

by Bzcasper

android-adb-mcp

MCP server that gives AI agents (Claude Code, Goose) control over Android devices via ADB — screen capture, UI automation, app launch, file transfer, and allowlisted shell execution.

npm version License CI Release


Demo

$ claude
> Take a screenshot of my phone and tell me what app is open

● adb_screenshot()
  Screenshot captured.
  [image: 1080×2400 PNG]

Your phone is showing the eBay app on the listing creation screen.
The title field is empty. Would you like me to fill it in?

> Yes, type "14K Gold Vintage Ring — Size 7"

● adb_tap(x=540, y=620)
● adb_type(text="14K Gold Vintage Ring — Size 7")
● adb_screenshot()

Done — title entered and verified. Moving to the description field.

👆 Record this with a real device and drop the GIF in assets/demo.gif. One 30-second asciinema or vhs recording converts more users than 1,000 words.


Related MCP server: scrcpy-mcp

What This Does

Claude Code can write, test, and deploy code. With android-adb-mcp it can also:

  • 📸 Take a screenshot of a real Android device and analyze what it sees

  • 👆 Tap, swipe, and type on the screen

  • 🚀 Launch apps by package name

  • 📁 Pull/push files between host and device

  • 🔒 Run allowlisted shell commands safely

This closes the full mobile development loop — and enables real-world automation workflows that go far beyond the terminal.


Quick Start

npm install -g android-adb-mcp

Requirements:

  • Node.js 18+

  • adb in PATH (brew install android-platform-tools / apt install adb)

  • Android device with USB debugging enabled (or ADB over TCP)

Verify it works:

adb devices                # should show your device
android-adb-mcp &          # starts the MCP server on stdio

Setup

Claude Code

Add to ~/.config/claude/claude_desktop_config.json:

{
  "mcpServers": {
    "android": {
      "command": "android-adb-mcp",
      "env": {
        "ANDROID_ADB_HOST": "localhost",
        "ANDROID_ADB_PORT": "5037"
      }
    }
  }
}

Goose

Add to ~/.config/goose/config.yaml:

extensions:
  - type: stdio
    name: android-adb-mcp
    cmd: android-adb-mcp
    description: Android device control via ADB

Amp

Add to ~/.amp/settings.json:

{
  "mcpServers": {
    "android": {
      "command": "android-adb-mcp"
    }
  }
}

Available Tools

Tool

Description

adb_devices

List connected devices

adb_screenshot

Capture screen → returns base64 PNG

adb_tap

Tap screen coordinates

adb_swipe

Swipe gesture

adb_type

Type text into focused input

adb_key

Send keyevent (BACK, HOME, etc.)

adb_launch_app

Launch app by package name

adb_shell

Run allowlisted shell command

adb_pull

Pull file from device to host

adb_push

Push file from host to device

adb_list_packages

List installed packages


Reference Implementation

The canonical use case is a production jewelry resale automation system powered by Claude Code where:

┌──────────────┐    ADB/TCP     ┌──────────────┐    MCP/stdio    ┌──────────────┐
│  Android     │◄──────────────►│  Ubuntu      │◄───────────────►│  Claude Code │
│  Phone       │                │  Laptop      │                 │  Agent       │
│              │                │              │                 │              │
│  · eBay app  │                │  · adb       │                 │  · Analyze   │
│  · Poshmark  │                │  · MCP       │                 │  · Generate  │
│  · Mercari   │                │    server    │                 │  · Automate  │
└──────────────┘                └──────────────┘                 └──────────────┘
  1. Android phone running Termux/proot acts as the gateway device

  2. ADB is port-forwarded to an Ubuntu laptop

  3. Claude Code orchestrates vision analysis (Qwen3-VL-32B via Modal)

  4. The agent generates listings for 8 platforms simultaneously

  5. The phone interacts with resale apps directly via this MCP server

One person. One phone. One laptop. Fully automated.

→ See the full example


Security Model

Shell execution uses an explicit allowlist — only pre-approved commands can be run. This prevents prompt injection attacks from causing arbitrary code execution on the device.

Default allowed: ls, cat, echo, pwd, pm, am, dumpsys, getprop, input, screencap, screenrecord, logcat, ps, top, find

To extend:

ANDROID_ADB_ALLOWED_COMMANDS="ls,cat,echo,curl,wget" android-adb-mcp

ADB over TCP (Wireless)

# On the Android device (via Termux)
adb tcpip 5555

# On the host
adb connect 192.168.1.x:5555

# Or port-forward from laptop to phone
adb -H localhost -P 5037 devices

Set ANDROID_ADB_HOST and ANDROID_ADB_PORT env vars to match your setup.


Contributing

Issues, PRs, and use case documentation welcome. See CONTRIBUTING.md for guidelines.


License

Apache 2.0 — see LICENSE

Built by Bobby Casper · AIToolPool

Available Tools

11 tools
adb_devicesA

List all connected Android devices and their status

Inputs: no named parameters.

adb_keyB

Send a keyevent to the Android device (e.g. KEYCODE_BACK, KEYCODE_HOME, KEYCODE_ENTER)

Inputs: keycode (required), device.

adb_launch_appB

Launch an Android app by package name. Optionally specify an activity for deep launch.

Inputs: package (required), device, activity.

adb_list_packagesB

List installed app packages on the Android device

Inputs: device, filter.

adb_pullB

Pull a file or directory from the Android device to the host

Inputs: local (required), remote (required), device.

adb_pushC

Push a file or directory from the host to the Android device

Inputs: local (required), remote (required), device.

adb_screenshotB

Capture a screenshot from the Android device. Returns a base64-encoded PNG image.

Inputs: device.

adb_shellA

Run an allowlisted shell command on the Android device. Non-allowlisted commands are rejected.

Inputs: command (required), device.

adb_swipeC

Perform a swipe gesture on the Android device screen

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

adb_tapC

Tap a screen coordinate on the Android device

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

adb_typeA

Type text into the focused input field on the Android device

Inputs: text (required), device.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 11 tools

    Disambiguation4/5

    Most tools map cleanly to a distinct action (tap, swipe, type, key, screenshot, pull, push, launch, list_packages). The one fuzzy boundary is adb_shell, an allowlisted catch-all that could partially overlap with the dedicated action tools, but the allowlist scoping and explicit descriptions keep misselection unlikely.

    Naming Consistency5/5

    Every tool uses the same adb_<verb>_<noun> snake_case pattern with the shared adb_ prefix, e.g. adb_launch_app, adb_list_packages, adb_pull. This is fully predictable and idiomatic for the domain.

    Tool Count5/5

    Eleven tools is well within the sweet spot and each one corresponds to a real ADB capability (device listing, input, screen, files, apps). No filler or redundant wrappers.

    Completeness4/5

    Core device-automation lifecycle is covered: discover devices, screenshot, input gestures/text/keys, launch apps, list packages, and file transfer both directions. Gaps exist around app install/uninstall, UI hierarchy inspection (uiautomator dump), logcat capture, and screen recording, which agents may need for verification-heavy workflows.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables AI agents to see and control Android devices through ADB and screen mirroring, supporting screen capture, touch input, app management, UI element finding, file transfer, shell commands, clipboard access, and audio/video streaming.
      801 npm
      MIT
    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables AI agents to see and control Android devices through ADB and scrcpy, including screenshots, taps, swipes, typing, app management, UI inspection, file transfer, shell commands, audio/video streaming, and clipboard access.
      801 npm
      MIT
    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables AI agents to see and control Android devices via ADB and scrcpy, supporting screenshots, taps, swipes, typing, app and UI automation, file transfer, shell commands, clipboard, and audio/video streaming.
      801 npm
      MIT