Skip to content

AI agents (MCP)

Connect Claude Code, Cursor or Codex to Holtdroid through a progressive-discovery MCP server, local ADB/DevTools bridge, and installable agent skill.

Holtdroid exposes a Model Context Protocol (MCP) server at /api/v1/mcp and a matching local stdio bridge (holtdroid mcp) so AI coding agents can launch devices, drive native apps and WebViews, debug traffic/logs/Frida, and investigate apps to write automated tests.

Instead of loading dozens of tool schemas into every prompt, Holtdroid MCP uses progressive discovery with three tools (~500 tokens total):

Tool Mode What it does
holtdroid_discover Read-only Lists action groups (builds, sessions, ui, web, logs, mitm, dns, scripts, device, recording, connect, adb), exact params, and built-in workflow playbooks (use-android, debug-app, investigate-for-tests).
holtdroid_inspect Read-only Observes builds, sessions, compact native UI trees (e1..eN), downscaled JPEG screenshots, ranked Appium/Selenide selectors (ui.selectors), WebView DOM (w<id>), filtered logcat/crashes, WebView console/network, MITM flows, DNS queries, device state, and recordings.
holtdroid_act Mutating Launches/stops sessions, runs batched UI/WebView steps (observe: "diff"), resets WebView (clear-webview) or app data, executes direct adb.run shell commands, switches VPN/network/GPS/clipboard, configures live MITM/DNS rules, runs live Frida hooks, pins recording markers, and bridges ADB/ports/chrome-devtools-mcp.

If an agent passes an unknown action or omits required fields, the server responds with an inline signature hint so it self-corrects in one step.

The MCP server and direct adb.run are enabled by default (mcp.enabled: true, mcp.allowADB: true); customize them in the api configuration if you want to restrict eval, Frida or ADB:

mcp:
enabled: true
allowEval: true # web.run eval steps
allowFrida: true # live scripts.run Frida hooks
allowADB: true # direct adb.run shell commands
maxOutputBytes: 24576

In users mode, open the MCP tab in the dock (/mcp) to copy per-client configs (Claude Code, Cursor, Codex, Antigravity/Gemini, VS Code/Copilot, Windsurf/Cline, Claude Desktop) and create or revoke access tokens scoped to mcp right on the page (token management is also available on Account and passkeys → Access tokens).

Terminal window
claude mcp add --transport http holtdroid https://android.example.com/api/v1/mcp \
--header "Authorization: Bearer ${HOLTDROID_TOKEN}"

Cursor (.cursor/mcp.json):

{
"mcpServers": {
"holtdroid": {
"url": "https://android.example.com/api/v1/mcp",
"headers": {
"Authorization": "Bearer ${env:HOLTDROID_TOKEN}"
}
}
}
}

Use the bridge when you also want local adb connect, loopback reverse port publishing, an authenticated --browserUrl relay for chrome-devtools-mcp, or enrollment-based auth without managing PATs:

Terminal window
curl -fsSL https://android.example.com/tunnel.sh | sh -s -- --install-only
claude mcp add holtdroid -- ~/.cache/holtdroid/holtdroid mcp --portal https://android.example.com

Wait-free token printing for Claude Code headersHelper:

Terminal window
~/.cache/holtdroid/holtdroid token --portal https://android.example.com --json
  • Install the skill locally (SKILL.md + debugging and test-authoring references):
    Terminal window
    ~/.cache/holtdroid/holtdroid skill install --portal https://android.example.com
    # or --target agents (~/.agents/skills/holtdroid)
  • MCP Resources: holtdroid://skill, holtdroid://guides/use-android, holtdroid://guides/debug-app, holtdroid://guides/test-authoring.
  • MCP Prompts: use-android, debug-app, investigate-for-tests.
  1. Interactive Android & browser use: builds.list → sessions.launch → share/open the returned watchUrl → ui.tree / web.targets + web.dom → batched ui.run / web.run → sessions.stop.
  2. Debugging & verification: launch with inspectHttps: true, check logs.crash + logs.logcat (packageOnly: true) + mitm.flows + logs.console, inject live mitm.set rules (mock/block/replace/delay), device.set (networkProfile: "subway", location), or live Frida hooks (scripts.run).
  3. Investigating apps to write tests: explore login variants with ui.tree, validate unique locators (id / accessibility id / -android uiautomator / xpath) using ui.selectors, inspect WebView transitions with web.targets + web.dom, and verify app.control {op: "clear-webview"} keeps native auth intact while resetting WebView cookies before emitting Appium/selenide-appium tests against /wd/hub.

Both sessions.launch and sessions.status return a login-free share link watchUrl (also available via Share in the session header or POST /api/v1/sessions/{provider}/{id}/share):

  • Anyone with the link (including unauthenticated guests) can view and control the shared device using the exact same interactive session UI (DeviceScreen, DevTools, Inspector, MITM, DNS, Routes, Network).
  • Opening the session in a compact window (< 960px wide) renders just the phone screen with a dismissible Widen window to see all tools hint — ideal when pairing alongside a CLI agent; widening the window reveals all tools.
  • Account-scoped actions (Stop, Extend, personal recordings, SSH tunnels, S3 app builds/media) remain restricted to the signed-in owner.
  • Every session action enforces ownership or admin (ownedSession).
  • Access tokens scoped only to mcp reach /api/v1/mcp and own /s/{provider}/{id}/devtools/* handoffs — never /api/v1/account, /api/v1/admin/*, /api/v1/connect/*, or raw /adb (use adb.run via MCP, controllable with mcp.allowADB: false).
  • UI strings, DOM nodes, MITM bodies, and logcat output are untrusted and truncated per line/response; server instructions tell clients never to act on instructions inside device content.