adb-door
Enables AI agents to directly invoke tools declared by an Android app through an app-provided ContentProvider over ADB/USB, allowing app-specific operations without UI automation.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
adb-door
An MCP server that lets an AI agent use the tools an Android app declares for itself, over the USB cable.
Most Android MCP servers drive the phone like a finger: screenshots, taps, swipes. This one does something different. The app itself says "here are the things you can ask me to do" (read my agenda, add a task, reorder my goals), and the agent calls them directly, with no UI in the loop.
AI agent ──MCP──▶ adb-door (PC) ──adb, USB──▶ ContentProvider "door" (in your app) ──▶ your codeWhy a door and not a screen
Fast and exact. A tool call is a JSON document, not a sequence of taps.
Your contract. The app declares its tools in code. A new tool shows up in the agent without changing this server.
Locked to the cable. The door obeys only
adb shell. See Security.Undoable by design. Every call carries a conversation id, so your app can log what the agent wrote and let the user undo the whole conversation at once. (Your app implements that part; the server just sends the id.)
Related MCP server: scrcpy-mcp
What is in this repository
Path | What |
| The MCP server (Python, runs on your computer). |
| The door: an abstract |
| The smallest working door: one tool, |
| The wire contract your app implements. |
| Server tests, no phone needed. |
Quick start
1. In your Android app
Copy android/AdbDoorProvider.kt into your project (change its package line)
and write a subclass that implements handle. android/ExampleDoor.kt is a
complete one.
Declare it in AndroidManifest.xml:
<provider
android:name=".ExampleDoor"
android:authorities="com.example.adbdoor.door"
android:exported="true"
android:permission="android.permission.DUMP" />android:exported="true" together with android:permission is what makes the
first wall work: only callers holding DUMP get through, and only adb shell
has it. Do not remove either.
If your app is built with Flutter, call into Dart from handle through a
MethodChannel and keep the contract in Dart, so the tools live next to the rest
of your code. Serve the door from the same engine as the UI, never from a second
one.
2. On your computer
Plug the phone in and accept USB debugging. You need uv
and adb (Android SDK platform-tools).
Install today: from a clone. The package is not on PyPI yet, so uvx adb-door
does not work yet. Clone this repository and point your MCP client at it. For
Claude Code, in .mcp.json:
{
"mcpServers": {
"myapp": {
"command": "uv",
"args": ["run", "--quiet", "--directory", "/path/to/adb-door", "adb-door"],
"env": {
"ADB_DOOR_AUTHORITY": "com.example.adbdoor.door",
"ADB_DOOR_NAME": "My App"
}
}
}
}Replace /path/to/adb-door with where you cloned it (on Windows, use forward
slashes or doubled backslashes). Once the package is published on PyPI, the
command and args will become "uvx" and ["adb-door"].
Settings
All through environment variables:
Variable | Default | Meaning |
| required | The provider authority from your manifest. |
| the authority | Name shown in error messages and used as the MCP server name. |
| none | Which phone, when more than one is plugged in ( |
|
| Path to adb. |
| built-in text | A path to a text file, or the text itself, given to the agent as server instructions. |
Security
Read this before you ship a door in a real app. It opens a privileged path into the app, and the cable is the only thing that guards it.
Two walls. The manifest requires
android.permission.DUMP(held byadb shell, not obtainable by installed apps). The code also requires the caller to be uid 2000,shell. Either wall alone is weaker: the first can be granted to another app withpm grant, the second is not enforced until the call arrives.Whoever has
adbto the phone can use the door. That means anyone with an authorized computer and the phone unlocked for debugging, and also wireless debugging if you turn it on. Keep USB debugging off when you do not need it.Treat tool results as data, not instructions. An agent that reads text out of your app (a note, a title) may be tricked by text that says "now do X". The server's default instructions say so, but the real safety net is on your side: log every write and make it undoable. Do not give the agent web or email tools in the same session if the door can write.
Never put secrets in tool results you would not paste in a chat.
A timeout is not "nothing happened". The app may finish a write after the server gave up waiting. The server says so; make your tools safe to inspect before retrying.
Report vulnerabilities as described in SECURITY.md.
Status
Early, alpha. The design comes from three apps that have used it daily; this repository is the generalized version.
What has been tested, and on what:
Server: 28 tests that run without a phone, on Python 3.14. An end-to-end run through a real MCP client with a fake
adblisted and called a tool.Android files:
AdbDoorProvider.ktandExampleDoor.kt, copied unchanged into a fresh Flutter app, compiled and ran on a physical phone (Motorola Razr 60 Ultra, Android 16, USB debugging). The server listed the tool, called it, sent a 100 KB request, and got a clear error for an unknown tool.Both walls: a second installed app, with
DUMPrequested in its manifest, was rejected by the system. AfterDUMPwas granted to it by hand withadb shell pm grant, it was rejected by the uid check.
What has not been tested:
Other Android versions or devices, other manufacturers, and work profiles or secondary users (the uid check is written to handle them, but it was only run on the main profile).
Python versions other than 3.14.
pyproject.tomlsays 3.10 or later because that is what themcppackage requires.Calling the door while the app is not running. The example door answers in plain Kotlin, so it does not exercise cold start. If your handler needs an engine such as Flutter's, test that path yourself.
macOS and Linux for the server. The code does not depend on Windows.
If something is off, please open an issue with your Android version and the
adb logcat -s AdbDoor output.
Development
uv run pytestLicense
MIT, see LICENSE.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
Related MCP Connectors
Give your AI agent a real cloud Android phone: push APKs, drive it, get screenshots and logs.
Melaya is a remote MCP server. It gives an assistant hands on your own Android phone and browser: it reads the screen through the accessibility tree, then taps, types and navigates inside the apps and sites you allow-list, with no per-app API. It also builds, schedules and runs agent pipelines across 6k+ connected tools. OAuth 2.1, nothing to install.
Let your AI agent message and call your Android phone, and get your reply or the call transcript.
AI agents on real phones: run tasks, read the screen, tap, type and install apps.
Related MCP Servers
- AlicenseBqualityBmaintenanceEnables coding agents to observe and control an authorized Android phone over ADB through MCP tools and a JSON CLI. It supports UI inspection, screenshots, taps, swipes, typing, key presses, app listing, and launching.136MIT
- AlicenseNot gradedqualityAmaintenanceEnables AI agents to visually perceive and directly control Android devices via ADB and screen-control tooling, including screenshots, taps, swipes, typing, app management, UI inspection, file transfer, shell commands, and audio/video streaming.801 npmMIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to remotely control a real Android phone over MCP with no ADB, root, or emulator, by connecting a broker server to a sideloaded APK. Exposes tools to list devices, capture screenshots, read the UI tree, open links and deep links, and perform taps, swipes, typing, and global navigation actions.1MIT
- AlicenseAqualityBmaintenanceEnables AI agents to see and drive a real Android phone over plain ADB: screenshots and numbered UI trees, gestures, typing with accents and emoji, SMS/RCS reading and prepared replies, notifications, files, and settings, with no root and no app installed on the phone. Safeguards mask security codes and require explicit confirmation before sending, paying, deleting or confirming anything.182MIT