// 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-crashCrash logs, memory, and app info for root-cause analysis
  • full-deployBuild, find APK, install, and launch in one workflow
  • build-and-fixRun build and explain each error with suggested fixes

Resources

Readable project files exposed to the client:

  • android://manifestAndroidManifest.xml
  • android://app-build-gradleapp/build.gradle.kts
  • android://build-gradleroot build.gradle.kts
  • android://gradle-settingssettings.gradle.kts
  • android://project-infoProject name and path

Workflow example

  1. Ask Claude Code to build and list errors.
  2. It calls get_project_info, then run_gradle_task, then get_build_errors.
  3. For deploy: list_devices, install_apk, launch_app.
  4. For UI automation: find_ui_elements, then ui_tap on returned centers; use screenHash / expect_screen_hash to avoid stale screens.

Tools reference

ToolDescription
run_gradle_taskRun a Gradle task (e.g. assembleDebug); returns result + structured errors
get_build_statusCurrent build status (idle, running, success, failed, cancelled)
get_build_errorsStructured compiler errors and warnings from the last build (JSON)
get_build_logRaw Gradle output lines (last N lines, capped)
cancel_buildCancel the running Gradle build
list_build_variantsList variants and active variant (JSON)
set_active_variantSet the active build variant (persists in settings)
find_apk_pathOutput APK path for a variant after a build
get_build_configParse build.gradle(.kts) for SDK levels, applicationId, types, flavors (no Gradle run)
run_testsRun unit tests (testDebug), connected tests, or a custom test task
get_crash_stack_traceParsed crash from logcat buffer; needs logcat streaming
restart_appForce-stop or clear data, relaunch, wait for display
get_app_runtime_stateProcesses, threads, RSS for an app package
start_logcatStart logcat streaming (required in headless before reads)
stop_logcatStop the logcat stream
get_logcat_entriesRecent logcat entries with filters (JSON)
get_crash_logsFATAL EXCEPTION, ANR, and native crash entries (JSON)
clear_logcatClear the in-memory logcat buffer
get_logcat_statsLogcat statistics (counts by level, crashes, packages)
list_devicesConnected ADB devices (JSON)
get_ui_hierarchyFocused window UI tree from UI Automator (JSON; interactive_only option)
find_ui_elementsFresh dump + search by text, content-desc, resource-id, class, or package
find_ui_parentDirect parent of a node from find_ui_elements / Layout tab treePath
ui_tapTap device pixel coordinates; optional expect_screen_hash
ui_type_textadb shell input text (ASCII-oriented); optional screen hash
ui_swipeSwipe or long-press in device pixels
send_ui_keyAllowlisted keyevent (Back, Home, Enter, …)
grant_runtime_permissionpm grant for android.permission.* on a package
screenshotCapture a screenshot (inline image)
get_device_infoSDK level, model, screen, battery
dump_app_infoApp version, install path, activities
get_memory_infoMemory breakdown (PSS, heap, native, graphics)
install_apkInstall an APK (path-validated)
launch_appLaunch an app (am start)
stop_appForce-stop an app
list_avdsList AVDs (JSON)
launch_avdStart an emulator
stop_avdStop a running emulator
get_project_infoProject name, path, Gradle root
run_health_checkJava, SDK, ADB, Gradle wrapper, disk, app dir (JSON)

Canonical reference: USER_MANUAL.md §10 · Features