CLI · MCP Server
adbridge
A CLI and MCP server that hands your AI assistant a steering wheel for any connected Android device - screenshots, OCR, logcat, taps, and crash reports, exposed as structured tools instead of pasted text.
Overview
why MCP for AndroidDebugging Android by chat is brutal. You screenshot the device, drag the PNG into the chat, paste 200 lines of logcat, then describe in prose what just happened on screen. Three round-trips later the model finally has enough context to guess.
adbridge cuts that loop. It runs as a standalone CLI for humans and as an MCP server for AI clients (Claude Code, Cursor, Cline, anything speaking MCP stdio). Once it's wired up, the assistant can pull the crash trace itself while you're still typing - capture a downscaled JPEG, OCR the visible text, parse the view hierarchy into tappable elements, and read filtered logcat in one tool call.
It's for mobile devs who already live in an agent loop and are tired of being the meat-puppet middleware between their phone and their model. Stop describing the device, let the agent look at it.
Capabilities
what the agent can doThe MCP server exposes seven tools. Grouped four ways:
Screenshots & OCR
Capture downscaled to 720px and JPEG-compressed at 80% for token efficiency. Optional Tesseract OCR with noise-line filtering. View hierarchy parsed into a compact list of interactive UI elements with tap coordinates - agents get clickable targets, not raw XML.
Logcat
Filter by app package, tag, level (error / warn / info), and line count. JSON or plain output. device_logcat.
Input control
Text typing, tap, swipe with duration, hardware keys (home / back / etc.), and clipboard set. Coordinates from the element
parser feed back in. device_input.
State & crash reports
Current activity, fragment backstack, display info, optional memory stats. Crash reports bundle stacktrace, recent errors,
and a screenshot in one call. Plus device_info for listing devices and device_shell as an escape
hatch for raw ADB commands.
MCP integration
how a model uses it
Wire it into Claude Code by adding to ~/.mcp.json:
{
"mcpServers": {
"adbridge": {
"command": "adbridge",
"args": ["serve"]
}
}
}
Restart, and the agent now has device_screenshot, device_logcat, device_state,
device_input, device_info, device_shell, and device_crash_report.
Any MCP client speaking stdio works the same way - just point it at adbridge serve.
In practice you end up saying things like “tap the login button and tell me what happens” or “the app just crashed, what went wrong” and the agent handles the rest.
Stack
what it's built on- Rust
- tokio
- rmcp
- adb_client
- leptess
- image
Rust because this thing sits in the hot path of every agent turn - startup time, memory, and reliability all matter when the
model is going to call it dozens of times in a session. adb_client talks the ADB wire protocol natively, so there's
no shelling out to the adb binary (the server still needs to be running, but no fragile string-parsing of CLI output).
rmcp is the official Rust MCP SDK, leptess gives FFI bindings to Tesseract for OCR, and image
handles JPEG compression.
Token budget is treated as a first-class constraint: hierarchy XML is stripped of default attributes (~50% smaller), screenshots are pre-downscaled, OCR noise is filtered before it ever hits the model.
Status
v0.1.1, public
Currently v0.1.1 on crates.io. Public,
MIT-licensed, CI green, MSRV 1.75.
# crates.io cargo install adbridge # from source git clone https://github.com/Slush97/adbridge.git cd adbridge && cargo install --path .
Requires a running ADB server (adb start-server) and, for OCR, a local Tesseract install
(brew install tesseract on macOS, pacman -S tesseract tesseract-data-eng on Arch,
apt install tesseract-ocr libtesseract-dev libleptonica-dev on Debian / Ubuntu).
No tagged GitHub releases or Homebrew formula yet - crates.io is the install path for now. Prebuilt binaries via GitHub Releases, a Homebrew tap, and richer state introspection are the obvious next moves.