agi-android-mcp
Control any Android phone from Claude Code, Cursor, or any MCP client — just ADB, no app required.
How it works
Claude Code ──(MCP stdio)──► agi-android-mcp ──(ADB)──► Android Phone
A lightweight Python MCP server that translates tool calls into adb commands. Works with any Android phone that has USB debugging enabled. No proprietary dependencies.
Quick Start
1. Install
pip install agi-android-mcp
2. Plug in your phone
Enable USB debugging (Settings > Developer options > USB debugging), connect via USB, and verify:
adb devices
# emulator-5554 device
3. Add to Claude Code
Add to ~/.claude/claude_code_config.json:
{
"mcpServers": {
"android": {
"command": "agi-android-mcp"
}
}
}
Restart Claude Code. That's it. Tell Claude:
"Take a screenshot of my phone"
"Open Chrome and search for the weather"
"Launch Settings and turn on dark mode"
Claude will take screenshots, reason about the UI, and tap/type/swipe to accomplish the task.
Add to Cursor
Add to .cursor/mcp.json:
{
"mcpServers": {
"android": {
"command": "agi-android-mcp"
}
}
}
Any MCP client
The server uses stdio transport. Run agi-android-mcp as the command — it speaks MCP over stdin/stdout.
Tools (18)
| Tool | Description |
|---|---|
screenshot |
Take a screenshot, returned as PNG image |
get_screen_size |
Get screen dimensions in pixels |
tap(x, y) |
Tap at pixel coordinates |
double_tap(x, y) |
Double-tap at pixel coordinates |
long_press(x, y) |
Long-press at pixel coordinates |
type_text(text) |
Type text into focused input field |
press_key(key) |
Press a key (enter, backspace, tab, space, home, back) |
swipe(direction) |
Swipe up/down/left/right from screen center |
drag(start, end) |
Drag between two points |
press_home() |
Press the Home button |
press_back() |
Press the Back button |
open_notifications() |
Open the notification shade |
open_quick_settings() |
Open quick settings panel |
launch_app(package) |
Launch an app by package name |
get_current_app() |
Get the currently visible app/activity |
list_installed_apps() |
List installed packages |
shell(command) |
Run any ADB shell command |
get_device_info() |
Get device model, Android version, screen size, battery |
Environment Variables
| Variable | Default | Description |
|---|---|---|
ADB_PATH |
Auto-detected | Path to adb binary |
ADB_SERIAL |
(none) | Target a specific device by serial number |
Multiple devices? Set ADB_SERIAL:
{
"mcpServers": {
"android": {
"command": "agi-android-mcp",
"env": {
"ADB_SERIAL": "XXXXXXXXXXXXXX"
}
}
}
}
Agentic Demo
demo.py runs a full autonomous loop: screenshot → Claude reasons → execute action → repeat.
pip install anthropic
ANTHROPIC_API_KEY=sk-... python demo.py "Open Chrome and search for cats"
How It Works
- MCP server starts over stdio (standard MCP transport)
- When a tool is called, it translates to an
adbsubprocess call - Screenshots:
adb exec-out screencap -p - Input:
adb shell input tap/swipe/text/keyevent - Apps:
adb shell am,adb shell pm
Development
pip install -e .
python -c "from agi_android_mcp.server import mcp; print(len(mcp._tool_manager._tools), 'tools')"
License
MIT
Metadata
Release files for agi-android-mcp 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| agi_android_mcp-0.0.1.tar.gz | 349.1 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| agi_android_mcp-0.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 357.0 kB
Release files / agi_android_mcp-0.0.1.tar.gz
| Download URL | agi_android_mcp-0.0.1.tar.gz |
|---|---|
| Size | 349.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a88227c87f12140400f686031cddc883d02f86ed3b495142c8555c8c35d68aae
|
|
BLAKE2b-256 checksum How to use checksums |
fd9bfdb9abce73100428d21ee47d098f478043530ab0b1e15f622726956a3ca0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.12
|
Release files / agi_android_mcp-0.0.1-py3-none-any.whl
| Download URL | agi_android_mcp-0.0.1-py3-none-any.whl |
|---|---|
| Size | 7.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d533428651aabc20374e287558c4083cf84900f08360c4d44412356020e56715
|
|
BLAKE2b-256 checksum How to use checksums |
ba625cab55030d1c8f00d7104da6c11628e13238ac3b08622865e19acd3f4bde
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.12
|
Security for agi-android-mcp 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.