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

已驗證STDIO僅桌面瀏覽器自動化開發者工具

概覽

AI 產生的概覽

一個本機 MCP 伺服器,讓 AI 助理透過 Gradle、模擬器、adb、logcat 和 UI 自動化來建置、部署、操作與偵錯 Android 應用程式。

可以做什麼
檢查環境與專案:doctor、尋找專案和模組、列出建置變體、讀取應用程式 ID 與 Gradle 設定,並設定專案、模組、變體和裝置的工作階段預設值。建置、測試與品質檢查:建置 APK 並回傳精簡的編譯錯誤、一鍵建置安裝啟動、單元測試與 instrumentation 測試、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 中

  1. 開啟 儀表板中的 Androidbuild Mcp,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

AndroidBuildMCP

[npm] [license]

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

bash
claude mcp add androidbuild -- npx -y @asjackson/androidbuild-mcp

Any other MCP client

json
{  "mcpServers": {    "androidbuild": {      "command": "npx",      "args": ["-y", "@asjackson/androidbuild-mcp"]    }  }}
Run from source instead
bash
git clone https://github.com/dev-jackson/androidbuild-mcp.gitcd androidbuild-mcpnpm install && npm run buildclaude mcp add androidbuild -- node /absolute/path/to/androidbuild-mcp/dist/index.js

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_app compiles and returns compact file:line compiler errors instead of a thousand lines of Gradle noise. test_app / test_instrumented return 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_run compiles, 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_ui returns the UI as a compact list of named elements with tap coordinates (Compose semantics merged, noise filtered). screenshot returns an image; with annotate: true it 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_ui to 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_project generates 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

ToolDescription
doctorCheck SDK, adb, emulator, avdmanager, Java and connected devices; reports what is missing
discover_projectsFind Android/Gradle projects under a path
list_modulesList modules declared in settings.gradle(.kts)
list_variantsList build variants of a module
get_app_idRead the applicationId of a module
show_gradle_configShow Gradle, AGP, Kotlin and version-catalog entries

Session defaults

ToolDescription
session_set_defaultsSet default project, module, variant, serial and appId for all later calls
session_show_defaultsShow the current defaults
session_clear_defaultsClear all defaults, or only the listed keys

Build, test and quality

ToolDescription
build_appBuild an APK; returns compact file:line compiler errors
build_runBuild, install and launch in one call
test_appRun JVM unit tests with a parsed pass/fail summary
test_instrumentedRun instrumented tests on a device
lintRun Android Lint and summarize the report
cleanRun gradle clean
get_apk_pathLocate the most recent APK without building
stop_gradleStop the project's Gradle daemons
get_coverage_reportRun Kover/Jacoco and summarize line coverage per package
get_file_coverageShow covered/uncovered lines of one source file

Devices and emulators

ToolDescription
list_devicesList devices with serial, state, model, Android version, API level
list_avdsList AVDs and which are running
boot_emulatorBoot an AVD and wait for full boot; returns the serial
kill_emulatorShut down a running emulator
create_avdCreate an AVD from an installed system image
delete_avdDelete an AVD
set_emulator_locationSet GPS location
set_appearanceSwitch dark/light mode
statusbar_demo_modeClean status bar for screenshots

App lifecycle

ToolDescription
install_appInstall an APK (adb install -r)
launch_appLaunch by application id, resolving the launcher activity
stop_appForce-stop a running app
uninstall_appUninstall an app
clear_app_dataReset an app to fresh-install state
get_app_infoVersion, target/min SDK, install path, running PID

UI automation

ToolDescription
snapshot_uiDump the UI as named elements with exact tap coordinates
screenshotCapture the screen; annotate: true draws numbered boxes
tap_elementTap element #N from the last annotated screenshot
tapTap at pixels or screen percentages
scrollScroll in a direction with a safe computed swipe
swipeSwipe between two points
dragDrag from one point to another
long_pressLong-press, holding 1000 ms
type_textType into the focused field, waiting for the keyboard
key_pressPress BACK, HOME, ENTER, DPAD_*, or any keycode
key_sequencePress several keys in order
wait_for_uiPoll until an element appears

Logs and recording

ToolDescription
get_logsOne-shot logcat dump, filterable by app and tag
get_crash_logsCrash buffer: Java exceptions, native crashes, ANRs
start_log_captureStart background logcat capture to a file
stop_log_captureStop capture and return the file plus the last lines
record_video_startStart screen recording (max 3 minutes)
record_video_stopStop recording and pull the MP4

Scaffolding

ToolDescription
scaffold_android_projectCreate a minimal Compose app that builds out of the box

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:

  1. snapshot_ui — returns exact device-pixel centers for every named element. Preferred.
  2. 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.
  3. 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_text waits for the soft keyboard before injecting (typing right after focusing a field silently drops the first characters otherwise).
  • scroll computes a long, slow swipe from the screen size — short fast swipes get ignored by some lists. long_press holds 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 }. doctor prints 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

bash
npm installnpm test            # unit tests (no real processes spawned)npm run dev         # run the server from sourcenpm run build       # compile to dist/

License

MIT — see LICENSE.

Conceptually inspired by XcodeBuildMCP; independent implementation built around the Android toolchain.

來源:README.md,提交 98055b2

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.1.1最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分