admcp - Android Debug MCP

io.github.dima-xd由 GitHub 账号 dima-xd 发布v1.0.0更新于 Nov 1, 2026

Local-first MCP server for Android debugging via ADB, JDI, LLDB, and Flutter.

已验证STDIO仅桌面浏览器自动化开发者工具

概览

AI 生成的概览

本地 MCP 服务器,让 AI 助手通过 ADB、JDI、LLDB 和 Flutter 在真实设备或模拟器上检查、操作并调试 Android 应用。

可以做什么
  • 列出并检查设备、探测工具链、打开和描述工作区
  • 构建、安装并启动应用,管理调试会话
  • 检查 UI 与 Compose 无障碍树,查找元素、点击操作并截图
  • 启动、查询、停止并统计 logcat,包括崩溃信号
  • 接入 Java/Kotlin JDI、原生 LLDB 或 Flutter DAP 调试器,设置断点、单步、查看调用栈、变量与寄存器并求值表达式
  • 采集 Perfetto 跟踪与堆转储,获取、预览并分析产物和诊断信息
适用场景
适合让智能体在已连接的 Android 设备或模拟器上复现缺陷、验证界面改动、读取崩溃日志或单步调试,而无需人工在 Android Studio 中逐次点击。面向 Android 开发者、智能体构建者和需要可复现设备证据的 QA 流程。
运行要求
作为本地进程运行于 Windows、Linux 或 macOS,需要 JDK 21 和 Android SDK platform-tools(adb);多数工具还需连接设备或模拟器。Flutter SDK、NDK 的 lldb/lldb-server 与 lldb-dap 为可选。通过 --platform-tools、--artifacts、--trust-workspace 等命令行选项配置。无需云账号或 API 密钥。
安装前请注意
它会操作真实设备:界面操作、安装和启动应用都会改变设备状态,破坏性界面操作需要主机确认或一次性令牌。项目控制的代码只有在启动时显式授予工作区信任后才会运行。仅支持可调试的开发版本,root 与安全绕过不在范围内。产物读取默认限定在存储根目录内并做截断与脱敏;服务器为本地优先,不上传项目或设备数据。

安装

在 SourceWeft 中

  1. 打开 控制台中的 admcp - Android Debug MCP,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

admcp

[admcp - Android debugging for AI agents]

admcp is a local-first Model Context Protocol (MCP) server for Android development. It connects any MCP stdio client to a real device or emulator and exposes 51 typed tools for UI inspection, screenshots, logcat, Java/Kotlin JDI debugging, native LLDB, Flutter/Dart DAP, Compose inspection, Perfetto traces, heap dumps, artifacts and evidence-based diagnostics.

No root. No cloud account required.

[MCP] [Android] [JDK] [Tools] [License]

Quick start | What it can do | Example prompts | Why admcp | Documentation

Status: v1, 51 tools, live-tested on a OnePlus CPH2747 (API 36, arm64-v8a). Full evidence and remaining limits: implementation status.

Quick start

  1. Install JDK 21 and Android SDK platform-tools (adb).
  2. Download admcp-<version>.zip from GitHub Releases and unzip it. MCPB-compatible clients can install admcp-<version>.mcpb from the same release instead.
  3. Point your MCP client at bin/admcp.bat on Windows or bin/admcp on Linux and macOS.

Any MCP stdio client can use it. The JSON below uses the common mcpServers shape; adapt the command and arguments to your client (Claude Code, Cursor, VS Code, Codex, Gemini CLI, and similar).

json
{  "mcpServers": {    "admcp": {      "command": "C:\\Tools\\admcp\\admcp-<version>\\bin\\admcp.bat",      "args": [        "--platform-tools", "C:\\Android\\Sdk\\platform-tools",        "--artifacts", "C:\\temp\\admcp-artifacts"      ]    }  }}

On Linux and macOS, use /opt/admcp/admcp-<version>/bin/admcp as command.

Verify the install:

bat
C:\Tools\admcp\admcp-<version>\bin\admcp.bat --selftest

On Linux and macOS:

sh
/opt/admcp/admcp-<version>/bin/admcp --selftest

You should see catalog=51 registered=51 version=<version> on stderr. The server then speaks MCP over stdio; stdout is reserved for protocol traffic.

What it can do

AreaTools
Device and workspacedevice_list, device_inspect, toolchain_probe, workspace_open, workspace_describe
App lifecycleapp_build, app_install, app_launch
Sessionssession_start, session_status, session_stop
UI and screenshotsui_inspect, ui_find, ui_act, ui_screenshot, compose_inspect
Logslogcat_start, logcat_query, logcat_stop, logcat_statistics, logcat_health
Java/Kotlin debugdebug_attach, breakpoints, debug_step, debug_stack, debug_variables, debug_evaluate
Native debugLLDB attach, breakpoints, stack, registers, memory reads and modules
Flutter debugDART_DAP attach, breakpoints, stack, variables, step, pause and detach
PerformancePerfetto system traces, heap dumps and performance_trace_analyze
Artifacts and evidenceartifact_get, analyze_artifact, previews, diagnostics_* and signals_crashes

The full 51-tool contract is in docs/architecture/mcp-tool-catalog-v1.md. The catalog is validated by contract tests.

Example prompts

Once admcp is connected, ask your agent things like:

text
Inspect the current screen, find the INCREMENT button, tap it, and verify the counter changed.Start logcat, reproduce the crash, then summarize the stack trace and the last 50 lines before it.Launch the app, attach JDI, set a breakpoint in MainActivity, and show locals when it hits.Inspect this Compose screen and tell me which accessibility node is the DELETE COUNTER button.Record a 5-second Perfetto trace and summarize what happened.Attach LLDB to the native library, break in fixture_increment, and show the registers.

Why admcp

Many Android MCP tools are thin command wrappers. admcp keeps device, workspace, process and session state together, then exposes debugging primitives with typed schemas, artifacts and safety gates.

It is for:

  • Android developers who want Claude Code, Cursor or another agent to inspect and debug a real device.
  • Agent builders who need stable, typed Android actions instead of parsing adb strings.
  • QA and automation workflows that need reproducible evidence from a device.
adb and shell scriptsAndroid Studioadmcp
Built for AI agentsNoNoYes
Typed MCP tool schemasNoNo51 tools
Session, process and backend stateNoPartialYes
JDI, LLDB and Flutter over MCPNoHuman UIYes
Evidence, artifacts and diagnosticsNoPartialYes
Local-first, no cloud accountYesYesYes

Android Studio is the better tool for a human sitting at the IDE. admcp is for the agent that needs to inspect, act and debug without a human driving every click.

How it works

mermaid
flowchart LR    Client["MCP client / agent"] -->|stdio| Server["admcp (MCP server)"]    Server --> ADB["ADB / Android CLI"]    Server --> JDI["JDI (JDWP client)"]    Server --> LLDB["lldb-dap"]    Server --> DAP["Flutter DAP"]    ADB --> Device["Android device / emulator"]    JDI -.->|via adb forward| ADB    LLDB -.->|via adb forward / lldb-server| ADB    DAP -.->|via adb forward| ADB

The server runs on your machine next to the Android toolchain. It does not upload your project or device data anywhere.

Verified

  • 186 tests with 0 failures on the verified host.
  • The catalog registers all 51 tools over MCP stdio.
  • Live device: OnePlus CPH2747, API 36, arm64-v8a.
  • JDI: attach, breakpoints, step, stack, locals and read-only evaluation.
  • LLDB: attach, breakpoints, stack, registers, bounded memory reads and modules.
  • Flutter: DART_DAP breakpoints, stack, variables, step, pause and detach.
  • Compose: accessibility-tree inspection and verified UI actions.
  • Performance: Perfetto capture/analysis and HPROF heap-dump capture.
  • Evidence: logcat, crash buffer, artifacts, session timeline and diagnostics.

Device-dependent integration tests skip when no device is attached. See implementation status for the full acceptance evidence.

Requirements

  • JDK 21.
  • Android SDK platform-tools (adb).
  • Windows, Linux or macOS.
  • Optional: Android CLI, Flutter SDK, NDK lldb/lldb-server, lldb-dap and a connected device or emulator.

Only debuggable developer builds are supported. Root and Android security bypasses are out of scope.

Build from source

Build, test and package from source

The Gradle wrapper is checked in; no local Gradle install is required.

Windows:

bat
gradlew.bat clean testgradlew.bat :app:admcp:installDist

Linux and macOS:

sh
./gradlew clean test./gradlew :app:admcp:installDist

The installable distribution is written to app/admcp/build/install/admcp/. The release archive is built with :app:admcp:distZip and written to app/admcp/build/distributions/admcp-<version>.zip.

Releases are automated with semantic-release from Conventional Commits on pushes to main or master: fix: is a patch release, feat: is a minor release and BREAKING CHANGE: is a major release. No release PR or changelog is generated.

Configuration

OptionPurpose
--platform-tools <dir>Directory containing adb
--workspace <dir>Default workspace root
--android-cli <path>Android CLI executable
--flutter-root <dir>Flutter SDK root
--artifacts <dir>Artifact store root
--trust-workspace <dir>Operator-approved workspace root; repeatable
--selftestPrint catalog/registration counts and exit
--versionPrint the version and exit

workspace_trust only succeeds for a canonical root passed to the server at startup with --trust-workspace. A tool argument cannot self-assert approval.

Known limitations

  • The verified device is a OnePlus CPH2747 on API 36; other OEM, API and transport combinations are not claimed.
  • Simultaneous JDI and LLDB inspection is not reliable on the verified device. Sequential switching works with debug_attach(switchBackend=true).
  • Compose TREE uses the accessibility hierarchy. Internal semantics, slot table and recomposition data require app instrumentation.
  • No host trace_processor_shell is bundled, so trace analysis returns a bounded summary unless Perfetto SQL tooling is installed.
  • Crashlytics issue clusters require android auth login; the local crash buffer remains the default evidence source.
  • Native LLDB needs a separately installed lldb-dap and an ABI-matched lldb-server.
  • The host confirmation dialog requires an interactive desktop. Headless servers fail closed to a one-shot token.

See implementation status for details and exact error behavior.

Security

  • Only debuggable developer builds are supported.
  • Project-controlled code runs only after an explicit workspace trust grant.
  • Destructive UI actions require host confirmation or a one-shot token bound to the session and action.
  • Artifact reads are confined to the store root, capped and redacted by default.
  • The server is local-first: no cloud account is required.

Documentation

Contributing

Issues and pull requests are welcome. The public tool catalog is versioned; open an issue before adding or renaming a public tool. Run gradlew test before sending a PR.

If admcp saves your agent time, a star helps more Android developers find it.

License

Apache License 2.0. See LICENSE.

来源:README.md,提交 94e5006

工具

0
SourceWeft 曾在隔离沙箱中以无凭据方式启动该软件包一次,以列出其工具,但未能完成:该软件包类型无法在沙箱中运行。

版本历史

1
  1. v1.0.0最新Nov 1, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分