
yhuangsh/adbmcp
Developer toolsこのページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る
MCP server exposing the Android Debug Bridge (adb) as tools, resources and prompts for AI assistants
概要
adbmcp is a Model Context Protocol server that exposes the Android Debug Bridge (adb) to AI agents: list devices, run shell commands, install apps, read logcat, take screenshots, drive the UI (tap/swipe/type/key events), query system services with dumpsys, transfer files, forward ports, manage app permissions and pair/connect to devices over Wi-Fi. It is a thin, predictable wrapper around the official adb binary — no re-implemented adb protocol, no test framework, no extra state. - — every device-scoped tool takes an optional device serial and every adb call is scoped with adb -s ; ambiguity is an error listing the candidates. - — adb stderr/exit codes are mapped to typed causes (NO_DEVICE, MULTIPLE_DEVICES, DEVICE_UNAUTHORIZED, DEVICE_OFFLINE, ADB_SERVER_CONFLICT, TIMEOUT, COMMAND_FAILED) with a hint for the next step. - — full MCP annotations on every tool plus server-side guardrails that are enforced even if a host ignores annotations.
README
以下は原文 README の抜粋です。原文を見る。
adbmcp — Android Debug Bridge, as MCP tools
adbmcp is a Model Context Protocol server that exposes the
Android Debug Bridge (adb) to AI agents: list devices, run shell commands, install apps, read
logcat, take screenshots, drive the UI (tap/swipe/type/key events), query system services with
dumpsys, transfer files, forward ports, manage app permissions and pair/connect to devices over
Wi-Fi. It is a thin, predictable wrapper around the official
adb binary — no re-implemented adb protocol, no test framework, no extra state.
- Multi-device first — every device-scoped tool takes an optional
deviceserial and every adb call is scoped withadb -s; ambiguity is an error listing the candidates. - Failures an agent can act on — adb stderr/exit codes are mapped to typed causes
(
NO_DEVICE,MULTIPLE_DEVICES,DEVICE_UNAUTHORIZED,DEVICE_OFFLINE,ADB_SERVER_CONFLICT,TIMEOUT,COMMAND_FAILED) with a hint for the next step. - Safety by construction — full MCP annotations on every tool plus server-side guardrails that are enforced even if a host ignores annotations.
- stdio by default, Streamable HTTP optional — the client launches
adbmcpas a subprocess;--httpserves the same tools over/mcpfor shared-device-host deployments.
Implements the MVP plus v2.0 items 1–7 in docs/design/product-design-v0.md.
Install
Requires Node.js >= 20 and Android platform-tools (adb) on PATH — or ADB_PATH pointing at the
binary.
# from npm
npx -y @yhuangsh/adbmcp
# from a checkout
git clone https://github.com/yhuangsh/adbmcp.git && cd adbmcp
npm install
npm run build
node dist/index.js # speaks MCP on stdin/stdout
Claude Desktop (claude_desktop_config.json)
{
"mcpServers": {
"adb": {
"command": "npx",
"args": ["-y", "adbmcp"],
"env": {
"ADB_PATH": "/Users/me/Library/Android/sdk/platform-tools/adb"
}
}
}
}
Cursor (.cursor/mcp.json)
{
"mcpServers": {
"adb": {
"command": "node",
"args": ["/absolute/path/to/adbmcp/dist/index.js"],
"env": {
"ADBMCP_ALLOWED_DEVICES": "emulator-5554"
}
}
}
}
Other stdio clients work the same way: a command plus args, with ADB_PATH / ADBMCP_*
environment variables passed through. In stdio mode, stdout carries MCP protocol traffic only;
diagnostics go to stderr.
Streamable HTTP (shared device host)
Use HTTP when several agents or MCP clients should share one machine’s adb server, devices and
インストール
npx -y adbmcp設定
{
"mcpServers": {
"adb": {
"command": "npx",
"args": ["-y", "adbmcp"],
"env": {
"ADB_PATH": "/Users/me/Library/Android/sdk/platform-tools/adb"
}
}
}
}