// mcp
MCP & Claude Code
Keynobi exposes an MCP server so Claude Code (and other stdio MCP clients) can trigger builds, read logcat, inspect UI, and manage devices using the same state as the GUI. Transport is local stdio to the Keynobi binary— not a Keynobi-hosted proxy.
Setup (headless, recommended)
Register the app once with the exact path to your installed binary. Prefer the command from Health Center or Copy MCP Setup Command in the command palette.
claude mcp add --transport stdio keynobi -- "/Applications/Keynobi.app/Contents/MacOS/keynobi" --mcp
The server uses whichever project is currently open in Keynobi. To pin a folder regardless of the GUI selection, append --project /path/to/MyAndroidProject.
GUI mode: open Keynobi, load a project, press Cmd+Shift+M for the MCP panel, and use the same copy command if needed.
Status indicator
The status bar MCP pill reflects server/client state: idle, server alive (stdio), in progress, or client connected (e.g. Claude). Click it for the activity panel.
Built-in prompts
diagnose-crash— Crash logs, memory, and app info for root-cause analysisfull-deploy— Build, find APK, install, and launch in one workflowbuild-and-fix— Run build and explain each error with suggested fixes
Resources
Readable project files exposed to the client:
android://manifest— AndroidManifest.xmlandroid://app-build-gradle— app/build.gradle.ktsandroid://build-gradle— root build.gradle.ktsandroid://gradle-settings— settings.gradle.ktsandroid://project-info— Project name and path
Workflow example
- Ask Claude Code to build and list errors.
- It calls
get_project_info, thenrun_gradle_task, thenget_build_errors. - For deploy:
list_devices,install_apk,launch_app. - For UI automation:
find_ui_elements, thenui_tapon returned centers; usescreenHash/expect_screen_hashto avoid stale screens.
Tools reference
| Tool | Description |
|---|---|
| run_gradle_task | Run a Gradle task (e.g. assembleDebug); returns result + structured errors |
| get_build_status | Current build status (idle, running, success, failed, cancelled) |
| get_build_errors | Structured compiler errors and warnings from the last build (JSON) |
| get_build_log | Raw Gradle output lines (last N lines, capped) |
| cancel_build | Cancel the running Gradle build |
| list_build_variants | List variants and active variant (JSON) |
| set_active_variant | Set the active build variant (persists in settings) |
| find_apk_path | Output APK path for a variant after a build |
| get_build_config | Parse build.gradle(.kts) for SDK levels, applicationId, types, flavors (no Gradle run) |
| run_tests | Run unit tests (testDebug), connected tests, or a custom test task |
| get_crash_stack_trace | Parsed crash from logcat buffer; needs logcat streaming |
| restart_app | Force-stop or clear data, relaunch, wait for display |
| get_app_runtime_state | Processes, threads, RSS for an app package |
| start_logcat | Start logcat streaming (required in headless before reads) |
| stop_logcat | Stop the logcat stream |
| get_logcat_entries | Recent logcat entries with filters (JSON) |
| get_crash_logs | FATAL EXCEPTION, ANR, and native crash entries (JSON) |
| clear_logcat | Clear the in-memory logcat buffer |
| get_logcat_stats | Logcat statistics (counts by level, crashes, packages) |
| list_devices | Connected ADB devices (JSON) |
| get_ui_hierarchy | Focused window UI tree from UI Automator (JSON; interactive_only option) |
| find_ui_elements | Fresh dump + search by text, content-desc, resource-id, class, or package |
| find_ui_parent | Direct parent of a node from find_ui_elements / Layout tab treePath |
| ui_tap | Tap device pixel coordinates; optional expect_screen_hash |
| ui_type_text | adb shell input text (ASCII-oriented); optional screen hash |
| ui_swipe | Swipe or long-press in device pixels |
| send_ui_key | Allowlisted keyevent (Back, Home, Enter, …) |
| grant_runtime_permission | pm grant for android.permission.* on a package |
| screenshot | Capture a screenshot (inline image) |
| get_device_info | SDK level, model, screen, battery |
| dump_app_info | App version, install path, activities |
| get_memory_info | Memory breakdown (PSS, heap, native, graphics) |
| install_apk | Install an APK (path-validated) |
| launch_app | Launch an app (am start) |
| stop_app | Force-stop an app |
| list_avds | List AVDs (JSON) |
| launch_avd | Start an emulator |
| stop_avd | Stop a running emulator |
| get_project_info | Project name, path, Gradle root |
| run_health_check | Java, SDK, ADB, Gradle wrapper, disk, app dir (JSON) |
Canonical reference: USER_MANUAL.md §10 · Features