Skip to main content

Android device control through MCP and a deterministic CLI

Project description

opdroid

Android device control through MCP and a deterministic CLI.

opdroid exposes a connected Android device as a set of practical tools: capture a gridded screen, inspect UI hierarchy, tap cells, swipe, type text, press Android navigation keys, and launch apps. Bring your own MCP-capable agent.

Requirements

  • Python 3.10+
  • ADB installed and running
  • Android device or emulator with USB debugging enabled

Installation

pip install opdroid

For local development:

uv sync
uv run opdroid --help

MCP Server

Run the MCP server over stdio:

opdroid mcp

Target a specific device:

opdroid mcp --serial emulator-5554

Print a ready-to-copy MCP config snippet:

opdroid mcp-config

Example config:

{
  "mcpServers": {
    "opdroid": {
      "command": "opdroid",
      "args": ["mcp"]
    }
  }
}

Agent Skill

Print the recommended skill text for another agent:

opdroid skill

The MCP server also exposes this through get_android_use_skill.

CLI

List devices:

opdroid devices

Capture the current screen with a grid and UI hierarchy:

opdroid screen --output artifacts/screen.png

Operate the device:

opdroid tap E10
opdroid tap-sequence B16 E16 H16
opdroid swipe E18 E6
opdroid input-text "hello world"
opdroid press back
opdroid launch-app com.android.settings

MCP Tools

  • get_screen: returns a gridded screenshot and compact interactive element list.
  • tap: tap a grid cell.
  • tap_sequence: tap multiple grid cells.
  • swipe: swipe between two grid cells.
  • input_text: type text into the focused field.
  • press_home, press_back, press_enter, press_recent_apps: Android key actions.
  • launch_app: launch an app by package name.
  • wait: wait for loading or animation.
  • list_devices: list connected Android devices.
  • get_android_use_skill: return the recommended agent skill text.

Configuration

By default opdroid connects to ADB at 127.0.0.1:5037.

Environment variables:

  • OPDROID_ADB_HOST: ADB server host.
  • OPDROID_ADB_PORT: ADB server port.
  • OPDROID_CELL_SIZE: grid cell size in analysis screenshots.

Equivalent CLI options are available where device access is needed:

opdroid devices --adb-host 127.0.0.1 --adb-port 5037
opdroid mcp --adb-host 127.0.0.1 --adb-port 5037

Development Checks

uv run python -m compileall src tests
uv run opdroid --help

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

opdroid-1.0.tar.gz (79.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

opdroid-1.0-py3-none-any.whl (19.7 kB view details)

Uploaded Python 3

File details

Details for the file opdroid-1.0.tar.gz.

File metadata

  • Download URL: opdroid-1.0.tar.gz
  • Upload date:
  • Size: 79.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for opdroid-1.0.tar.gz
Algorithm Hash digest
SHA256 0551b683a5fdefa4fab67811ff42bfc3dba60bff48b2ea79993c63f5d71bb6a1
MD5 21246f42d7d730ce2f0723918962c34f
BLAKE2b-256 8f24f09e7778511b1f3f789165da1b84d035d5ad0922a1a78f33153d89dedc7a

See more details on using hashes here.

File details

Details for the file opdroid-1.0-py3-none-any.whl.

File metadata

  • Download URL: opdroid-1.0-py3-none-any.whl
  • Upload date:
  • Size: 19.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for opdroid-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 db3f794a262318957f252143b7d60f107a040f0b14a0fa8c3c9e4a71ab96405f
MD5 8673ed412c84648be0fb873c6f40afbd
BLAKE2b-256 cb251b8775c7b9c70258a7b57a8be36663555b2954fa08a5cd24b0c1616c27ca

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page