Claude Code reads your app's errors over MCP
Start Buggregator with MCP_ENABLED=true, then add it as a Claude Code MCP server with one command. Claude Code can then list the events Buggregator caught, open a Sentry error with its stack trace, and read your dumps and profiles, so you stop pasting stack traces into the chat.
Steps
1. Turn MCP on
MCP is off by default. Set the environment variable, or put the same setting in buggregator.yaml.
MCP_ENABLED=truemcp:
enabled: true2. Add Buggregator to Claude Code
Run this in your project. buggregator is the path to the binary: the name is enough when it is on your PATH, otherwise use the full path.
claude mcp add buggregator -- buggregator mcpBuggregator must be running with MCP on before Claude Code connects.
3. Use HTTP if Buggregator runs in Docker
In Docker, use the HTTP transport on port 8001 instead.
services:
buggregator:
image: ghcr.io/buggregator/server:latest
ports:
- 127.0.0.1:8000:8000
- 127.0.0.1:8001:8001 # MCP HTTP port
environment:
MCP_ENABLED: "true"
MCP_TRANSPORT: http
MCP_ADDR: ":8001"claude mcp add --transport http buggregator http://localhost:8001/mcpIf you set MCP_AUTH_TOKEN, pass the token as an Authorization: Bearer header, as the MCP docs show. Without it, the server answers 401.
4. Ask in plain words
Claude Code picks the tools itself. For example:
"Show me the latest Sentry errors"
"What's the stack trace for this exception?"
"Analyze the profiling data and find the slowest functions"Why it works
The buggregator mcp subcommand bridges Claude Code's stdio to the running Buggregator through a Unix socket. Tools such as events_list and sentry_event return the event list and a clean error record: message, exception chain with stack traces, environment. Dumps come back as plain text without HTML, so Claude Code reads values, not markup.
Docs: docs.buggregator.dev/config/mcp.html#claude-code
Requires Buggregator v2.6.0+
Related tips
- MCP
Cursor reads the exception you just hit
Connect Cursor to Buggregator over MCP. It reads the stack trace, dumps and profiles your app sent, straight from your local Buggregator.
- Xdebug
Claude Code sets a breakpoint and steps through PHP
Turn on Buggregator's Xdebug proxy and MCP. With no IDE attached, Claude Code sets a breakpoint, waits for the request, reads variables and steps.
- Xdebug
Record every call of one request and find the slow one
Record an Xdebug function trace, send the file to Buggregator, and see the slowest calls, the call tree and a search over every call.
- Sentry
See what happened right before the exception
Point your Laravel Sentry DSN at Buggregator. Each error shows its breadcrumbs, request, tags and stack trace on your laptop.
Checked on with Buggregator v2.8.0