Claude Code
Give Claude Code the Dungbeetle MCP tools so it can triage snapshot runs and — with your confirmation — approve baselines. You stay the account owner; Claude holds only a scoped, revocable agent token.
1. Prerequisites
- The Dungbeetle CLI:
npm install -g dungbeetle. - Node.js with
npx(the server is on npm asdungbeetle-mcp— see Setup). - A Dungbeetle cloud account with a repository (getting access).
2. Mint a token
dungbeetle login --label "Claude Code"Approve the printed code at /ui/connect in your browser, picking the repository Claude may work with. Or approve the code from any signed-in browser on another machine — see Agent authentication.
3. Add the MCP server
claude mcp add dungbeetle \
--env DUNGBEETLE_AGENT_TOKEN=dbat_… \
-- npx -y dungbeetle-mcpOr commit a project-scoped .mcp.json at the repo root so every teammate's Claude Code picks it up (each teammate supplies their own token — don't commit one):
{
"mcpServers": {
"dungbeetle": {
"command": "npx",
"args": ["-y", "dungbeetle-mcp"],
"env": {
"DUNGBEETLE_AGENT_TOKEN": "${DUNGBEETLE_AGENT_TOKEN}"
}
}
}
}Verify with claude mcp list.
Self-hosting
Both commands default to the hosted cloud. On a self-hosted server, pass --server <url> to dungbeetle login and add "DUNGBEETLE_SERVER_URL": "https://your-server" to the env block above.
4. First loop
Ask Claude Code:
List the recent Dungbeetle runs and show me the semantic diff of the latest failed one.
Claude calls dungbeetle_list_runs, then dungbeetle_get_run with detail: "full" — a compact node-level diff, never screenshots. Fix the regression (or decide the change is intended), then:
Approve that run and promote the new baselines.
dungbeetle_approve_run is a destructive tool, so Claude Code asks for your confirmation before it runs — approval stays human-owned.
Scopes
Use the Triage preset (runs:read baselines:read analytics:read reviews:write) — the default when dungbeetle login requests no explicit scopes. Claude can read diffs and record your review decisions but can't push runs or rewrite baselines outside the promote-on-approve path. See scopes.