
Androidbuild Mcp
io.github.dev-jackson由 GitHub 账号 dev-jackson 发布v0.1.1更新于 Oct 24, 2026
Build, deploy, drive and debug Android apps: Gradle, emulators, adb, logcat, UI automation
概览
一个本地 MCP 服务器,让 AI 助手通过 Gradle、模拟器、adb、logcat 和 UI 自动化来构建、部署、操作和调试 Android 应用。
- 可以做什么
- 检查环境与项目:doctor、查找项目和模块、列出构建变体、读取应用 ID 与 Gradle 配置,并设置项目、模块、变体和设备的会话默认值。构建、测试与质量检查:构建 APK 并返回精简的编译错误、一键构建安装启动、单元测试与仪器测试、Lint、clean 和覆盖率报告。管理设备与模拟器:列出设备和 AVD,创建、启动、清除和关闭模拟器,设置 GPS 位置与外观。控制应用生命周期:安装、启动、停止、卸载、清除数据并查看应用信息。自动化界面:获取带点击坐标的 UI 快照、截图(可标注)、点击、滚动、滑动、拖拽、长按、输入文字、按键和等待元素出现。读取日志与录制:logcat 抓取、崩溃日志、后台日志捕获和屏幕录制。生成一个可直接构建的 Compose 项目骨架。
- 适用场景
- 适合让助手端到端处理真实 Android 项目:编译并修复构建错误、运行测试、在模拟器或设备上启动应用、通过 UI 自动化复现问题,或采集日志、截图和录屏。
- 运行要求
- 通过 npx 以 stdio 在本地运行(Node 18+)。需要 Android SDK(ANDROID_HOME 或默认安装路径)、用于 Gradle 构建的 JDK 17+,以及 adb/模拟器工具;部署和 UI 操作需要模拟器或已连接设备。可选:Google 的 Android CLI 用于标注截图,ADBKeyboard 输入法用于非 ASCII 输入。
安装
在 SourceWeft 中
- 打开 控制台中的 Androidbuild Mcp,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
AndroidBuildMCP
Give your AI agent hands on Android. AndroidBuildMCP is an MCP server that lets any MCP client (Claude Code, Cursor, ...) build, deploy, drive and debug real Android apps: Gradle builds with readable errors, emulator management, adb deployment, logcat capture and full UI automation.
Quick start
Requirements: Node 18+, the Android SDK (ANDROID_HOME or a default install), and a JDK 17+ for Gradle builds.
No install step — npx fetches the server on first run.
Claude Code
Any other MCP client
Run from source instead
Then ask your agent to run doctor — it checks the SDK, adb, emulator, Java and connected devices, and tells you exactly what is missing.
What your agent can do
- Build and test —
build_appcompiles and returns compactfile:linecompiler errors instead of a thousand lines of Gradle noise.test_app/test_instrumentedreturn parsed pass/fail summaries. Lint, clean, coverage (Kover/Jacoco) included. - Manage emulators — list, create, boot (waits for full boot, returns the serial), wipe, and kill AVDs. Set GPS location, dark mode, and a clean demo status bar for screenshots.
- Deploy —
build_runcompiles, installs and launches in one call. Install/uninstall/clear-data/app-info via adb, with the right device auto-selected when only one is connected. - See the screen —
snapshot_uireturns the UI as a compact list of named elements with tap coordinates (Compose semantics merged, noise filtered).screenshotreturns an image; withannotate: trueit draws numbered boxes using vision, catching text inside images and WebViews. - Touch the screen — tap, scroll, swipe, drag, long-press, type (keyboard-aware, with clear/submit), hardware keys, and
wait_for_uito poll until an element appears. - Read the logs — background logcat capture filtered to your app, one-shot dumps, and the crash buffer for stack traces.
- Start new apps —
scaffold_android_projectgenerates a minimal Compose project that builds out of the box.
Session defaults (session_set_defaults) mean you configure project, module, variant and device once — every other call then works without arguments.
Tool reference
53 tools over stdio. Every tool takes plain arguments and returns text (or an image, for screenshot).
Environment and project
Session defaults
Build, test and quality
Devices and emulators
App lifecycle
UI automation
Logs and recording
Scaffolding
Tapping accurately
Everything adb-side shares one coordinate space (device pixels), but MCP clients often display screenshots scaled — estimating pixel positions by eye from the image sends taps to the wrong place. Three safe ways to hit the target:
snapshot_ui— returns exact device-pixel centers for every named element. Preferred.screenshot { annotate: true }+tap_element { element: N }— tap by the number drawn on the image; the mapping is resolved on the original PNG, so client-side scaling cannot distort it.tap { xPct, yPct }— screen percentages (0-1), also available on long_press/swipe/drag. Resolution-independent.
Raw tap { x, y } still works when you have real pixel coordinates.
Reliability
Every tool was exercised against real emulators and real projects — happy paths and corner cases — before release; the scenario-by-scenario evidence is in qa-results.md. Some of the details that keep agent flows from misfiring:
type_textwaits for the soft keyboard before injecting (typing right after focusing a field silently drops the first characters otherwise).scrollcomputes a long, slow swipe from the screen size — short fast swipes get ignored by some lists.long_pressholds 1000 ms, which launchers require.- Taps outside the screen are rejected with the actual screen size instead of silently doing nothing.
- Text-heavy screens (e-book WebViews and the like) are capped and searchable with
snapshot_ui { filter }instead of flooding the context. - Build/test/device failures come back as short, actionable messages with the next tool to call.
Optional extras
- Google's Android CLI enables
screenshot { annotate: true }.doctorprints the one-line installer for your OS. - The ADBKeyboard IME enables non-ASCII
type_text(adb alone is ASCII-only). Install its APK once; the server uses it automatically.
Development
License
MIT — see LICENSE.
Conceptually inspired by XcodeBuildMCP; independent implementation built around the Android toolchain.
来源:README.md,提交 98055b2
工具
0版本历史
1- v0.1.1最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分