Sentry MCP + Claude Code: The Agent That Triages Your Errors
Connect Sentry's MCP server once with claude mcp add, and Claude Code's debugger subagent can pull a live issue — stack trace, affected release, event count — straight into its context instead of you pasting it in by hand. This is the exact config and the walkthrough for turning a Sentry alert into a verified fix in one pass. Last updated 2026-10-31 by Rakshit Yadav.
What the Sentry MCP server actually gives the agent
Without MCP, debugging a Sentry alert in Claude Code means opening the Sentry dashboard yourself, copying the stack trace and breadcrumbs into the chat, and hoping you grabbed the right event out of a few hundred occurrences. The Sentry MCP server removes that copy-paste step: once connected, the model can call tools to list an org's unresolved issues, fetch a specific issue's full event payload (stack trace, tags, affected release, user count), and in some server builds search issues by project or time window — all live, mid-conversation, against whatever is actually in Sentry right now rather than a description you typed from memory. The server's tool list costs roughly 1,400 tokens of context on every turn once connected (see the context budget estimator, which ballparks this across popular MCP servers), which is cheap next to what it saves in back-and-forth pasting a trace.
mcp.json config for Sentry
Add it once from the CLI, which writes the entry into your project's .mcp.json (or pass -s user for a machine-wide connection instead of per-project):
claude mcp add sentry -- npx -y @sentry/mcp-serverThe server prompts for a Sentry auth token (or org/API-key pair, depending on the version you install) on first use — there's no separate config file to hand-write. Confirm the connection and see what it cost you in context before trusting it in a long session:
claude mcp list
claude mcp remove sentry # if you want it out againWhich AgenticKit agent calls it, and when
AgenticKit doesn't ship a Sentry-specific subagent — it ships a debugger agent whose whole job is root-cause analysis from stack traces and failing tests, and that's the one that reaches for Sentry's MCP tools once they're connected. It triggers on the same inputs it already handles without MCP — a pasted stack trace, a failing CI log, "users are getting a 500 on checkout" — except now instead of asking you to go fetch the trace, it calls the Sentry MCP tool directly to pull the live issue, its event count, and which release introduced it. The debugger agent reads from the sre-observability skill for how your project structures logs and error tracking, so it knows where in the codebase a given Sentry tag (route, job name, tenant ID) actually maps to before it starts tracing. No separate agent file is needed for Sentry specifically — the MCP connection is what turns a general debugging agent into one that can self-serve Sentry data.
Walkthrough: auto-triage a Sentry error
- Connect once — run the
claude mcp add sentrycommand above and authenticate when prompted. - Point the agent at the alert — paste the Sentry issue URL or just describe the symptom:
/fix the checkout 500 that's spiking in Sentry, project api-prod. The debugger agent calls the Sentry MCP tool to list unresolved issues on that project rather than asking you to describe the error. - It fetches the full event — stack trace, the release/commit tag the event is attached to, and how many users hit it — and cross-references the file and line from the trace against the actual source, not a guess from the error message alone.
- It isolates the cause — the same way it would from a pasted trace: reproducing with a minimal test case where possible, checking whether the flagged release introduced the regression via a recent diff.
- It proposes a fix and a regression test, then stops — the debugger agent's rule is to make a clean, minimal fix and verify it, not to also resolve the Sentry issue or push anything; closing the alert in Sentry once you've confirmed the fix is still a manual step.
What this replaces: tabbing to Sentry, finding the right issue among dozens of similar-looking ones, copying the trace, and losing the "which release" context that the dashboard shows but a pasted error message doesn't.
Installing the full pack vs. just the Sentry piece
The Sentry connection itself is a one-line claude mcp add call — there's nothing to install for that part beyond the command above. What AgenticKit adds on top is the agent and skill that make the connection worth having: the debugger subagent and the sre-observability skill it reads project conventions from, both installed with the rest of the 34-agent roster in one run of the AgenticKit installer. If you only want the MCP wiring and already have your own debugging workflow, the claude mcp add sentry command above is the entire integration — no AgenticKit install required for that part.
Related pages
Frequently asked questions
Does Claude Code ship a Sentry MCP server by default?
No. MCP servers are opt-in per project or per user — you connect Sentry's with one claude mcp add command, same as any other MCP server. Nothing is wired in out of the box.Which agent uses the Sentry MCP connection?
AgenticKit's debugger agent is the one that reaches for Sentry's MCP tools once connected — it's the subagent built for root-cause analysis from stack traces and failing tests, and the Sentry connection just gives it live access to that data instead of a pasted trace.Can the agent resolve or close the Sentry issue automatically?
Only if the MCP server exposes a write tool for that and you explicitly ask — the debugger agent's default behavior is to propose and verify a fix, not to also mutate Sentry state. Treat closing the alert as a manual confirmation step.How much context does the Sentry MCP server cost on every turn?
Roughly 1,400 tokens for its tool descriptions once connected, which is small next to most MCP servers (GitHub's full tool surface runs closer to 9,000). Still worth running `claude mcp list` periodically and removing servers you're not actively using in a given project.Does this work with self-hosted Sentry, not just sentry.io?
Check the MCP server's own docs for your installed version — self-hosted support and the exact auth flow (token vs. org/API-key pair) vary by release, and this page doesn't cover that configuration in detail.
Get the debugger agent pre-wired
AgenticKit ships the debugger subagent and the sre-observability skill it reads from — add your own Sentry MCP server alongside them in one `claude mcp add` call.