Skip to main content
Glama
droidpilot

droidpilot

by Mihirokte

droidpilot

droidpilot lets an AI coding agent use a real Android phone. The agent looks at the screen and touches it like a finger.

droidpilot is an MCP server. Any agent that supports MCP can use it. Examples: Claude Code, Codex, Gemini CLI, Kiro.

What it does

Action

Tool

Look at the screen

observe (UI list, snapshot id, state), screenshot

Touch

tap_text, tap_element, tap, double_tap, long_press

Move a finger

swipe, scroll

Use two or more fingers

pinch, gesture

Type and press keys

type_text, press_key

Open an app

open_app, list_apps

Wait

wait, wait_for

An action returns in about 0.4 seconds. It does not check the screen. The next observe says changed=yes or changed=NO. The agent can then find a tap that did nothing.

observe also wakes and unlocks a phone that has no PIN. If a PIN blocks it, the result starts with NEEDS_HUMAN.

A tap on a buy, pay, send or delete button returns BLOCKED. The agent must repeat it with confirm=true.

Related MCP server: phone-mcp-server

How it works

AI agent  --MCP-->  droidpilot  --scrcpy control socket-->  phone (real touch events)
                        |
                        +--adb screencap + uiautomator-->  screenshot + numbered UI elements
  1. droidpilot sends touch events through the scrcpy control socket. This gives real multi-touch.

  2. If scrcpy fails, droidpilot uses adb shell input. This gives one finger only.

  3. droidpilot reads the screen with screencap and uiautomator dump.

Quick start

Do these steps once on the phone:

  1. Open Settings > About. Tap Build number 7 times.

  2. Open Developer options. Turn on USB debugging.

  3. On realme and Oppo phones, turn on Disable permission monitoring.

  4. Set the USB mode to File transfer. Do not use USB tethering.

  5. Connect the cable. Tap Allow on the phone.

Then run these commands on the computer:

source env.sh               # sets the paths for adb and scrcpy
uv run droidpilot doctor    # checks the phone and every layer
uv run droidpilot serve     # starts the MCP server

Add to an agent

Use this command as the MCP server. The transport is stdio.

uv --directory /path/to/droidpilot run droidpilot serve

An example config is in examples/mcp.example.json.

Settings

Variable

Default

Meaning

DROIDPILOT_VERIFY

off

full checks the screen after each action with screenshots. It is slow (about 5 seconds).

DROIDPILOT_SETTLE_MS

400

Wait after each action.

DROIDPILOT_GUARD

on

off turns the safety guard off.

DROIDPILOT_COMPACT

1

0 lists every UI element.

DROIDPILOT_SERIAL

first device

Choose a phone when more than one is connected.

DROIDPILOT_HOME

~/.cache/droidpilot

Where the run log is kept.

Commands

Command

Use

droidpilot serve

Start the MCP server.

droidpilot doctor

Test adb, the phone, the screen, and touch.

droidpilot clean

Remove the files droidpilot put on the phone.

Test

uv run pytest                       # no phone needed
uv run python tests/e2e_device.py   # needs a phone or an emulator

Known limits

  • observe takes about 3 seconds. The UI dump on the phone is the limit. See docs/ROADMAP.md.

  • Apps that block screenshots show a black screen. The UI tree can still work.

  • Web views inside apps give only part of their UI to the tree.

  • A phone without a PIN is easy to use. A phone with a PIN needs the user to unlock it.

Documents

License

MIT. See LICENSE.

Available Tools

18 tools
device_statusA

Show the phone, screen size, rotation, input backend (scrcpy multi-touch or adb fallback) and foreground app.

Inputs: no named parameters. Returns: result

double_tapB

Double tap (zoom in maps/photos, select a word).

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

gestureA

Arbitrary multi-finger gesture. All fingers move in lockstep over duration_ms (rotate, three-finger swipe, curves).

Inputs: strokes (required), duration_ms. Returns: result

list_appsB

Installed package names (third-party only unless include_system).

Inputs: include_system. Returns: result

long_pressB

Press and hold (context menus, drag handles, selection).

Inputs: x (required), y (required), duration_ms. Returns: result

observeA

Numbered UI elements, a snapshot id, app/rotation/keyboard state and whether the screen changed. Call before acting.

Inputs: image, diff_only.

open_appB

Launch an app by package name.

Inputs: package (required). Returns: result

pinchA

Two-finger pinch centred at (x,y). Needs the scrcpy backend (see device_status).

Inputs: x (required), y (required), scale (required), duration_ms. Returns: result

press_keyC

Press a hardware/navigation key.

Inputs: key (required). Returns: result

screenshotA

Screenshot only, without the element list.

Inputs: no named parameters.

scrollB

Scroll the view. 'down' reveals content below (finger moves up).

Inputs: amount, direction. Returns: result

swipeA

Drag one finger from (x1,y1) to (x2,y2). Short duration = fling, long = precise drag (sliders, reorder).

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

tapC

Single tap at a point.

Inputs: x (required), y (required), confirm. Returns: result

tap_elementA

Tap the center of an element from the latest observe.

Inputs: index (required), confirm, snapshot. Returns: result

tap_textA

Tap the element whose label contains text. One call instead of observe, read index, tap.

Inputs: text (required), nth, confirm. Returns: result

type_textA

Type into the focused field (tap the field first). Handles non-ASCII via clipboard paste.

Inputs: text (required), submit. Returns: result

waitB

Wait until the screen stops changing (loading spinners, animations).

Inputs: ms. Returns: result

wait_forB

Wait until an element with this label appears.

Inputs: text (required), timeout_ms. Returns: result

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 18 tools

    Disambiguation4/5

    Most tools target clearly distinct capabilities (observe vs screenshot vs wait vs wait_for are well differentiated in descriptions). The tap family (tap, tap_text, tap_element), and the movement family (swipe, scroll, pinch, gesture) are related but descriptions make the boundaries intelligible. An agent can generally pick correctly, though swipe vs scroll and gesture vs pinch require reading the description.

    Naming Consistency3/5

    Casing is uniformly lowercase snake_case, but verb style is mixed: verb_noun tools (open_app, list_apps, press_key, type_text, tap_text, tap_element) coexist with bare verbs (tap, swipe, scroll, pinch, observe, wait), nouns (screenshot, gesture) and a noun_phrase (device_status). Still readable, but no single predictable pattern.

    Tool Count4/5

    18 tools is on the heavy side but each maps to a real mobile-automation capability (observation, touch, gesture, text input, app management, waiting). Nothing is obviously redundant, though a few bare taps could arguably be collapsed. Count is justified by the breadth of the domain.

    Completeness4/5

    The surface covers the mobile interaction lifecycle well: observe/status/screenshot for perception, a full touch and gesture set, text/key input, app launch and listing, and both time- and element-based waits. Minor gaps remain: no close/stop app, no element-scoped scroll or swipe (only coordinates), and no text clearing or clipboard retrieval.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables full Android control from any AI agent via 7 MCP tools, including screen capture, touch interaction, app management, and system control.
      23 PyPI
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Controls Android and iOS devices from AI agents through a token-efficient MCP server, enabling observation, tapping, typing, gestures, navigation, assertions, and safety-gated actions.
      2
      MIT