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

uv add opdroid

You can also run it without installing into the current environment:

uvx opdroid --help
uvx opdroid devices

For local development:

uv sync
uv run opdroid --help

Agent Skill

opdroid is built to be skill-native according to the agentskills.io open standard. You can install it directly into your AI coding assistant (like Claude Code or Cursor) using the Vercel Skills CLI:

npx skills add shikhargen/opdroid

Alternatively, you can print the recommended skill instructions for manually pasting or configuring other agents using the CLI:

opdroid skill

The MCP server also exposes this through the get_android_use_skill tool.

MCP Server

Run the MCP server over stdio:

opdroid mcp

Run it directly from PyPI with uvx:

uvx opdroid mcp

Target a specific device:

opdroid mcp --serial emulator-5554
uvx opdroid mcp --serial emulator-5554

Print a ready-to-copy MCP config snippet:

opdroid mcp-config

Example config:

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

Alternative config that runs through uvx without a prior install:

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

Project-local Codex config example in .codex/config.toml:

[mcp_servers.opdroid]
command = "uvx"
args = ["opdroid", "mcp"]
enabled = true

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.1.0.tar.gz (82.8 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.1.0-py3-none-any.whl (23.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: opdroid-1.1.0.tar.gz
  • Upload date:
  • Size: 82.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","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.1.0.tar.gz
Algorithm Hash digest
SHA256 08efebbc5821dae2172f9abb4ca1c704f4ec6513d04db8eb1717d93a98018d75
MD5 6c39c8842e4fbb6743c674d615c6df56
BLAKE2b-256 9dae9ea005a803659a8d8bb3d7a64f52c6e935d6481422ce4a79497da4473cce

See more details on using hashes here.

File details

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

File metadata

  • Download URL: opdroid-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 23.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9e2b527f617c2d81d0396e4912137c3e70bf525e9f29e3f551b281035d137881
MD5 b787442992a88ea2968c2ca383676a31
BLAKE2b-256 d9836f3db6ca63b44a7679b81b21c5d9686fd5e849f6cd1f257a2bd5c144232f

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