
Devilge
io.github.Yercko由 GitHub 帳號 Yercko 發布v0.2.3更新於 Oct 24, 2026
Android/KMM MCP server: logcat, ADB device control, Compose previews, network, Maestro flows.
概覽
Android/KMM 開發用 MCP 伺服器,讓助理建置、安裝、操作並觀察開發機上的應用程式。
- 可以做什麼
- 檢視專案結構與 Compose 預覽,並執行任意 Gradle 工作、解析編譯與測試錯誤。列出裝置、讀取 logcat、應用程式錯誤與網路請求。操作執行中的應用程式:點擊、輸入文字、按鍵、滑動、截圖與傾印 UI。以文字或資源 ID 定位元件並等待畫面就緒。啟動、強制停止、清除資料、安裝 APK 與執行 instrumented 測試。以 Maestro YAML 流程重播導覽,並可批次串接多個工具呼叫。
- 適用情境
- 適合正在開發 Android 或 KMM 應用程式、想讓 AI 助理直接建置、安裝、啟動並操作開發機或模擬器上應用程式的開發者。當需要反覆查看 logcat、抓取錯誤與網路請求,或重播固定的 UI 導覽流程時特別有用。
- 執行需求
- 在本機以 npm 套件執行,需 Node.js,並需安裝 Android SDK 的 adb 與可用的裝置或模擬器。必須設定 DEVILGE_ANDROID_PROJECT_ROOT 為專案絕對路徑;可選用 DEVILGE_DEFAULT_DEVICE_SERIAL、DEVILGE_MAESTRO_BIN_PATH 等變數。Maestro 流程工具需另裝 Maestro,否則會回報未安裝。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Devilge,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
devilge
Model Context Protocol (MCP) server that lets an AI assistant — typically Claude — develop, drive, and observe an Android / KMM app end-to-end.
devilge exposes 33 tools that cover the full inner loop: read the project, build it, install it, launch it, drive its UI, capture errors and network traffic, run tests. Anything an LLM coding agent would otherwise have to ask the user to do manually.
What's inside
215 unit tests in Vitest, all green. Strict TypeScript (strict, noUncheckedIndexedAccess).
Batching for fewer permission prompts
Hosts that confirm every tool call (Claude Desktop, Cowork) can become noisy when the agent walks through multi-step UI flows. devilge_batch collapses a sequence into a single MCP call so the user approves once for the whole sequence.
Rules: capped at 20 actions per call; cannot be nested; cannot include destructive tools (devilge_clear_app_data, devilge_install_apk) — those always require their own dedicated prompt; stops on the first error and reports which step failed.
All tools also expose MCP annotations (readOnlyHint, idempotentHint, destructiveHint, openWorldHint). Hosts that respect annotations can auto-approve safe reads and prompt only on state-changing tools.
Architecture
Clean / hexagonal layering, every concern replaceable in isolation:
src/server.ts is the composition root: it constructs every concrete dependency and wires them into an McpServer. Nothing else in the codebase performs construction.
Security model
devilge runs on a developer's machine, exposes mutating tools to an LLM, and shells out to ADB and (optionally) Gradle / Maestro. It assumes the operator connects only to a dev emulator or wiped test device, never a personal device with logged-in apps.
- Project sandbox. All filesystem reads/writes resolve, after symlink resolution, to paths inside
DEVILGE_ANDROID_PROJECT_ROOTor the configured outputs / flows roots. Any escape throwsSecurityError. - No shell. Every external process (
adb,gradlew,maestro) is spawned withshell: falseand an argv array. Arguments are never concatenated into strings. - Strict argument allowlists. Device serials, logcat tags, package names, activity names, deep links, Gradle tasks, Maestro flow names and env-var keys all pass through
CommandSanitizerregex allowlists before reaching argv. - Resource caps. Logcat capped (5000 line ceiling), ADB stdout cap 8 MiB, Gradle output cap 256 KiB ring buffer, file scans bounded, screenshot timeout 15 s, instrumented-test timeout 30 min default cap.
- Symlinks ignored. Walkers never follow symlinks.
- Logs go to stderr only. Stdout is reserved for the MCP JSON-RPC transport.
- Errors are sanitized. Only
DevilgeErrorsubclasses surface their messages. Unexpected exceptions become an opaqueINTERNAL_ERROR. - Header redaction.
Authorization,Cookie,Set-Cookie,X-API-Keyand other well-known sensitive headers are redacted fromget_network_callsoutput. - Maestro
runScript:denied by default. YAML flows containingrunScript:blocks (which execute JS) are rejected unless the operator explicitly setsDEVILGE_ALLOW_FLOW_SCRIPTS=true. - No frontmost-app check. devilge does NOT verify that the targeted package matches the device's foreground app. That check is a deployment concern — keep your dev device clean.
The MVP does include write tools (input automation, app install, data wipe, force-stop). These are gated to a dev-only device by operator policy, not by server logic.
Setup
Run the tests:
Verify the build:
Connecting to Claude Desktop
Add an entry to your claude_desktop_config.json (path varies by OS):
Restart Claude Desktop. The 33 tools should appear in the tool picker.
Local smoke test (MCP Inspector)
Configuration reference
Optional integrations
Maestro (flows)
Maestro is optional. Without it installed, every other devilge tool keeps working. The three flow tools (run_maestro_flow, list_maestro_flows, validate_maestro_flow) register unconditionally and return MAESTRO_NOT_INSTALLED when the binary isn't found.
To enable:
Restart the inspector. Flows go in <project>/devilge-flows/<name>.yaml. Example:
Then:
MAESTRO_DISABLE_ANALYTICS=true is injected automatically. runScript: blocks are denied unless you opt in.
Headless Compose preview rendering (recipe, no devilge tool)
You can render @Preview Composables to PNG without launching the full app. devilge does NOT add a dedicated tool for this — the existing run_gradle_task plus the official Google plugin cover it cleanly, and adding a wrapper would make us depend on Gradle conventions that vary by project.
This is completely optional: if you don't add the plugin, devilge runs unchanged. You only lose this specific workflow.
To enable in your project, add to your Compose module's build.gradle.kts:
And in gradle/libs.versions.toml:
Once the plugin is in place, render previews from the LLM via the existing tool:
The PNGs land under composeApp/build/outputs/screenshotTest/.... Claude can then read them via its Read tool to verify visual output without installing the app.
Recommended inner-loop workflow
For recurring navigation paths (login, search, etc.), capture once as a Maestro flow and replay with one tool call.
Backlog (not committed, lowest priority)
- Compose Live Edit MCP — true HMR for Android Compose. Major project (~2-3 months MVP, JVMTI agent + bytecode transformation + protocol). Waiting for JetBrains' Compose Hot Reload to land for Android first; the wrapper would be ~1-2 weeks.
pull_room_database— pull Room SQLite from device, expose readonly queries. Useful for inspecting cached state.pull_anr_traces+deobfuscate_stacktrace— diagnose runtime hangs and ProGuard-mapped release crashes.dumpsys_meminfo/dumpsys_gfxinfo/measure_cold_start— runtime performance metrics.describe_compose_codebase— structural map of the project (data classes, XML resources, color literal frequencies, composables) so the LLM doesn't have to grep at session start. Considered, deferred until proven necessary in real use.
License
MIT
來源:README.md,提交 17d8b50
工具
0版本歷史
1- v0.2.3最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分