Let AI agents debug your bug reports
TraceBug ships a local Model Context Protocol server. It exposes your exported bug reports to AI coding agents — Claude Code, Cursor, Windsurf, VS Code, or any MCP client — so the agent can read the console errors, network failures, repro steps, and screenshots, find the offending code in your repo, and propose the fix.
$ claude mcp add -s user tracebug -- npx -y tracebug mcp
Step-by-step setup for your tool: Claude Code · Cursor · Windsurf — or see the real transcript of what happens after setup.
🔒 Everything stays on your machine
The server reads the same self-contained .html files TraceBug already exports — no account, no cloud, no upload. This is the difference from every other bug-reporting tool's MCP server: theirs are hosted services that require your bug data to live in their cloud first. TraceBug's runs locally over stdio and opens zero network connections.
On this page
1The Workflow
A tester captures a bug and exports the report (Quick Bug → Export replay (.html)). That one .html file contains everything: replay, console, network, user actions, screenshots, root-cause hint.
The tester hands the file to a developer (Slack, email, ticket attachment — it's just a file).
The developer leaves it in Downloads (or anywhere in the repo) and asks their coding agent: "Use the tracebug tools to list my bug reports and debug the first one."
The agent reads the report, correlates the stack trace with the failed request, finds the actual source file, and proposes a fix — with full context a pasted screenshot could never carry.
2The Hand-off Prompt
The fastest way to kick off an agent debugging session is to paste this into Claude Code / Cursor (opened in the codebase that owns the bug):
This is a TraceBug bug report export: <report-file.html>
1. Call get_bug_report("<report-file.html>") to load the report
overview and its investigation guide.
2. Follow the investigation guide to gather the relevant data
(console errors, network failures, repro steps, screenshots).
3. Cross-reference the findings with this codebase to identify
the root cause and propose a fix.You rarely have to type it yourself — TraceBug puts it in front of you at every hand-off point:
The extension shows it after every Export replay (.html)
Already copied to your clipboard, so the tester can paste it straight into a Slack message next to the file.
The exported .html itself carries it
The recipient opens the file, clicks the AI tab, and hits Copy prompt. The file is self-advertising: whoever receives it learns how to feed it to their agent.
It's a first-class MCP prompt
In Claude Code, type /tracebug:debug_bug_report (optionally passing a filename); any MCP client with a prompt picker will surface it. No copy-paste at all.
Investigation guide: get_bug_report responses include a prioritized list of next steps computed from what the report actually contains (e.g. "[HIGH] get_network_activity — 2 failed requests captured, with response-body snippets that often name the server-side error"). The agent spends its tool calls on the data that matters for that specific bug instead of guessing.
3Setup
Claude Code
One-liner for every project (without -s user, Claude Code registers it for the current project only). No folder needed: it finds reports in your project and in your Downloads and Desktop folders.
$ claude mcp add -s user tracebug -- npx -y tracebug mcp
On native Windows (not WSL), wrap it: -- cmd /c npx -y tracebug mcp. Restart Claude Code afterwards.
Or per-project via .mcp.json in the repo root (committed, so the whole team gets it):
{
"mcpServers": {
"tracebug": {
"command": "npx",
"args": ["-y", "tracebug", "mcp"]
}
}
}Cursor
Settings → MCP → Add new MCP server:
- Command: npx
- Args: -y tracebug mcp
Or add the same mcpServers block to .cursor/mcp.json.
Windsurf
Add the same mcpServers block to ~/.codeium/windsurf/mcp_config.json, then refresh the MCP servers in Cascade.
VS Code (GitHub Copilot agent mode)
Add to .vscode/mcp.json:
{
"servers": {
"tracebug": {
"type": "stdio",
"command": "npx",
"args": ["-y", "tracebug", "mcp"]
}
}
}Any other MCP client
The server speaks standard MCP over stdio. Point the client at:
$ npx -y tracebug mcp
It lists reports newest first, from the directory it starts in (your project, up to 3 levels deep, skipping node_modules, .git, build output and dot-directories) and from your Downloads and Desktop folders. --dir <path> limits it to one folder, which is useful in CI.
4Tools
list_bug_reportsEvery TraceBug export under the directory: title, summary, severity, priority, root-cause hint, and counts of captured data. Agents start here.
get_bug_reportOverview of one report: environment, tester annotations, description, plus the investigation guide — a prioritized list of which tools to call next for this specific bug.
get_console_errorsFull console capture (errors / warnings / logs) with stack traces.
get_network_activityFailed requests with response-body snippets by default; pass failuresOnly: false for every captured request.
get_repro_stepsPlain-English reproduction steps, structured user actions (including rage-click / dead-click frustration signals), and the full session timeline.
get_screenshotA screenshot as real image content the agent can see. Screenshots are auto-named from the triggering action (01_click_save.png).
get_playwright_testThe generated failing test — a runnable Playwright spec that replays the captured session and asserts the failure is gone. Red while the bug exists, green after the fix. (Exports from SDK 1.9+.)
resolve_stackMaps the report's minified stack frames to original source files/lines using .map files found in the current repo — run the server from the project that built the app.
get_fix_contextOne-call fix starter: the failing request (with response snippet), the user action that triggered it, the first error with source-map-resolved top frames, and whether a generated failing test is available.
get_auditThe Site Audit in an audit export: which checks ran (accessibility, layout, performance, SEO, runtime) with their limitations and page metrics, 0–100 scores with their formula, plus the findings. A check that didn't run is never reported as a pass.
get_findingOne audit finding in full: bounded HTML and visible-text evidence, metrics, its WCAG criteria, a suggested fix, help link and hints to search your codebase for. Pass searchDir for a literal search.
compare_auditsTwo audit exports of the same page, before and after a fix: fixed, still present, new, and regressed. Text from the audited page comes back marked untrusted.
Screenshots and video are deliberately excluded from the text tools (they're token-heavy); get_screenshot delivers images on demand.
Every tool's file argument is forgiving: pass a path, a bare filename (found anywhere under the scan dir), or a case-insensitive fragment of the filename or report title — get_bug_report("vendor update") works. Unresolvable names error with the list of available reports.
The server also exposes one MCP prompt, debug_bug_report (optional file argument) — the same hand-off prompt above, invokable as /tracebug:debug_bug_report in Claude Code or from any client's prompt picker.
What Files Does It Read?
Any TraceBug export:
.html replay exports (the primary artifact)
The report JSON is embedded in the file, so the exact file a tester shares is what the agent reads. The file still opens as a full interactive replay in any browser.
.json report payloads
With the same structure as the embedded payload.
Files that aren't TraceBug exports are ignored, so scanning your Downloads folder only ever picks up real reports.
Try It Right Now
The repo ships a demo report:
git clone https://github.com/prashantsinghmangat/tracebug-ai cd tracebug-ai && npm install && npm run build npx @modelcontextprotocol/inspector node dist/bin.mjs mcp --dir demo-bug-reports
The Inspector opens a browser UI where you can call each tool against demo-bug-reports/sample-report.html — a critical vendor-save bug with a 500 response, client-side TypeError, and a rage-click signal. Or open the repo in Claude Code (the included .mcp.json registers the server automatically) and ask it to debug the report.
Privacy
- ✓The server binds to stdio only — it opens no network ports and makes no network requests.
- ✓It reads files from the directory you point it at, nothing else.
- ✓What the agent sees is exactly what's in the export — which already went through TraceBug's capture-time redaction (sensitive storage keys, URL params, and token shapes are scrubbed before the report is built).
Troubleshooting
list_bug_reports returns count: 0If you registered the server with --dir, it only looks in that folder; re-add it without --dir so Downloads is scanned too. Otherwise the report is somewhere it doesn't look (a custom download folder, or deeper than 3 levels in the project): move it into the project, or pass --dir pointing at it.
Client says the server won't startRequires Node ≥ 18. Test manually: npx -y tracebug mcp --dir . should print "TraceBug MCP server — reading bug reports from …" to stderr and then wait for input.
Which package am I running?The tracebug package is the standalone ~70 KB CLI (MCP server + init) — all a developer receiving reports needs. tracebug-sdk (the full capture SDK) bundles the same CLI, so inside a project with the SDK installed, npx tracebug mcp resolves locally.
Report file not recognizedOnly files exported by TraceBug (containing the embedded report payload) are picked up — a screenshot or PDF export is not readable by the MCP server; use Export HTML.
Bug report → fix, without your data leaving the machine
One command connects your coding agent to every TraceBug export on disk.
$ claude mcp add -s user tracebug -- npx -y tracebug mcp
The next bug is one AltB away from fixed
Free, no account to capture. Works with any front-end framework. Your data stays on your machine.
Edge, Brave and Opera install from the Chrome Web Store.