Metadata-Version: 2.4
Name: opdroid
Version: 1.0.1
Summary: Android device control through MCP and a deterministic CLI
Project-URL: Homepage, https://github.com/shikhargen/opdroid
Project-URL: Repository, https://github.com/shikhargen/opdroid
Project-URL: Issues, https://github.com/shikhargen/opdroid/issues
Author: Shikhar Mishra
License: MIT License
        
        Copyright (c) 2026 Shikhar Mishra
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: adb,agents,android,automation,cli,mcp
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Testing
Classifier: Topic :: System :: Hardware :: Hardware Drivers
Requires-Python: >=3.10
Requires-Dist: adbutils>=2.0.0
Requires-Dist: mcp>=1.0.0
Requires-Dist: pillow>=10.0.0
Requires-Dist: rich>=13.0.0
Requires-Dist: typer>=0.9.0
Description-Content-Type: text/markdown

# 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

```bash
pip install opdroid
```

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

```bash
uvx opdroid --help
uvx opdroid devices
```

For local development:

```bash
uv sync
uv run opdroid --help
```

## MCP Server

Run the MCP server over stdio:

```bash
opdroid mcp
```

Run it directly from PyPI with `uvx`:

```bash
uvx opdroid mcp
```

Target a specific device:

```bash
opdroid mcp --serial emulator-5554
uvx opdroid mcp --serial emulator-5554
```

Print a ready-to-copy MCP config snippet:

```bash
opdroid mcp-config
```

Example config:

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

Alternative config that runs through `uvx` without a prior install:

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

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

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

## Agent Skill

Print the recommended skill text for another agent:

```bash
opdroid skill
```

The MCP server also exposes this through `get_android_use_skill`.

## CLI

List devices:

```bash
opdroid devices
```

Capture the current screen with a grid and UI hierarchy:

```bash
opdroid screen --output artifacts/screen.png
```

Operate the device:

```bash
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:

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

## Development Checks

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

## License

MIT
