DEV Community

Cover image for Sentry MCP for Claude Code: Pull Production Errors and Fix Them (1 Command, No Token)
quickpromptco
quickpromptco

Posted on Originally published at quickpromptco.com

Sentry MCP for Claude Code: Pull Production Errors and Fix Them (1 Command, No Token)

A production error fires, and the copy-paste loop starts: open Sentry, copy the stack trace, paste it into Claude Code, go back for the breadcrumbs, paste again, then realize you needed the tags too. The agent only ever sees what you remembered to copy.

Sentry MCP cuts you out of that loop. It’s Sentry’s official server, built for coding agents like Claude Code. The agent can search your issues, pull the full stack trace, breadcrumbs, tags, and trace for an event, and ask Seer, Sentry’s AI debugger, for a root cause. It then fixes the code in the same session. It’s hosted with OAuth sign-in, so there’s no token to create and nothing to install.

This pairs well with our Chrome DevTools MCP setup. DevTools MCP catches bugs on your machine, and Sentry MCP brings in the ones your users hit in production.

Quick Start

One command, then sign in:

claude mcp add --transport http --scope user sentry https://mcp.sentry.dev/mcp
Enter fullscreen mode Exit fullscreen mode

Restart Claude Code, run /mcp, and approve access to your Sentry organization in the browser. Then ask: “What are the top unresolved issues in my Sentry project this week?” Total time: about 2 minutes.

⚡ Copy This Prompt: Let Claude Code Install and Verify It For You

Skip the manual steps below and hand the whole job to the agent instead:

You have shell access and the `claude mcp` CLI on this machine. Connect the hosted Sentry MCP server and report back. Do not tell me it's done unless step 4 actually confirms it:

1. Run `claude mcp list`. If a server named sentry already exists, stop and tell me how it's configured instead of adding a second one.
2. Add the hosted server (OAuth, no token or Node.js needed):
   `claude mcp add --transport http --scope user sentry https://mcp.sentry.dev/mcp`
3. Run `claude mcp list` again and confirm sentry is listed. It's fine if it says it needs authentication.
4. Tell me to restart Claude Code and run `/mcp` to sign in to Sentry in my browser. After I confirm, call the whoami tool and show me which Sentry user and organizations it sees.

Never ask me to paste a Sentry token into this chat. If any step fails, give me the exact error and the command that produced it. Do not skip ahead.
Enter fullscreen mode Exit fullscreen mode

The sign-in step can’t be automated. Sentry’s OAuth needs you to approve access in the browser, so the prompt stops and hands that part to you. That’s intentional.

What You’ll Need

Requirement Why You Need It Time
Claude Code installed Provides the claude mcp command used to register the server 0 min
A Sentry account (sentry.io) The hosted server signs you in with OAuth and reads your organization’s data 0 min
A browser To approve the OAuth connection the first time 1 min
Self-hosted Sentry only: Node.js + a user auth token The hosted server targets sentry.io. Self-hosted installs run the stdio version locally ~5 min

Step-by-Step Setup

Prefer to do it by hand instead of delegating to the agent? Here’s the manual version.

Step 1 — Add the hosted server

~1 min

--scope user makes it available in every project:

claude mcp add --transport http --scope user sentry https://mcp.sentry.dev/mcp
Enter fullscreen mode Exit fullscreen mode

Want it locked to one project? Sentry recommends scoping the URL to an org and project. Run this inside that repo (default local scope). Tools then default to that project, and unneeded discovery tools are hidden:

claude mcp add --transport http sentry https://mcp.sentry.dev/mcp/your-org-slug/your-project-slug
Enter fullscreen mode Exit fullscreen mode

Terminal: claude mcp add --transport http --scope user sentry https://mcp.sentry.dev/mcp; then claude mcp list

Real run, October 2026. Needs authentication means the server is reachable and waiting for you: run /mcp inside claude to sign in.

Step 2 — Sign in and pick permissions

~1 min

Restart Claude Code and run:

/mcp
Enter fullscreen mode Exit fullscreen mode

Select sentry and authenticate. The approval screen lists Sentry’s permission groups (“skills”) as checkboxes. For a read-only setup, keep Inspect and Seer and uncheck Triage and Project management. Sentry remembers your choice for the next sign-in.

Step 3 — Or install the plugin (auto-delegating subagent)

~2 min

The official plugin adds a sentry-mcp subagent. Claude Code hands off to it automatically when you ask about errors, issues, traces, or performance, which keeps Sentry data out of your main context. If you added the server in Step 1, remove it first (claude mcp remove sentry):

claude plugin marketplace add getsentry/sentry-mcp
Enter fullscreen mode Exit fullscreen mode
claude plugin install sentry-mcp@sentry-mcp
Enter fullscreen mode Exit fullscreen mode

Step 4 — Self-hosted Sentry (optional)

~5 min

Create a User Auth Token in Sentry with org:read, project:read, project:write, team:read, team:write, and event:write, then run this in your terminal (not in a chat):

claude mcp add --scope user sentry --env SENTRY_ACCESS_TOKEN=your-token --env SENTRY_HOST=sentry.example.com -- npx @sentry/mcp-server@latest
Enter fullscreen mode Exit fullscreen mode

SENTRY_HOST takes the hostname only. The AI-powered search tools (search_issues, search_events) additionally need an LLM provider, set with EMBEDDED_AGENT_PROVIDER plus that provider’s API key. Every other tool works without one. If your instance doesn’t support Seer, add --env MCP_DISABLE_SKILLS=seer.

A bug under a magnifying glass with a breadcrumb trail and a wrench

From production error to breadcrumbs to the fix, without pasting stack traces by hand.

What Each Piece Does

Skill (permission group) What the Agent Can Do Tools
Inspect Issues & Events Read-only: issues, events, stack traces, breadcrumbs, traces, replays, releases, monitors, profiles, and Sentry docs 38
Seer Sentry’s AI debugger: analyze an issue, find the root cause, and suggest a fix 12
Triage Resolve, assign, and update issues. This one writes to Sentry 18
Project management Create and modify projects, teams, DSNs, and uptime monitors. Also writes to Sentry 16

Tool counts come from Sentry’s published skill definitions (0.39.0). The ones you’ll use most are search_issues, get_issue_details, get_event_stacktrace, get_issue_breadcrumbs, and analyze_issue_with_seer.

Verify It’s Actually Working

claude mcp list
Enter fullscreen mode Exit fullscreen mode

✔ sentry    https://mcp.sentry.dev/mcp (HTTP) – Connected

! sentry    Needs authentication  → run /mcp and finish the browser sign-in

✘ sentry    Failed to connect  → check the URL; org/project slugs must match Sentry exactly

Then give it a real production bug to work through:

Find the most frequent unresolved error in [YOUR PROJECT] from the last 7 days. Show me the stack trace and breadcrumbs, tell me the root cause, then open the file in this repo where it happens and propose a fix.
Enter fullscreen mode Exit fullscreen mode

If the tool calls show search_issues and get_event_stacktrace, and the answer cites real event data, it’s working end to end.

Common Mistakes to Avoid

  • Thinking “Needs authentication” means it’s broken. Every hosted connection uses OAuth. Run /mcp once and sign in. There’s no token to create.
  • Granting Triage when you only wanted to read. Triage lets the agent resolve and reassign issues. Leave it unchecked on the approval screen unless you actually want that.
  • Wrong slugs in a scoped URL. /mcp/{org}/{project} uses the slugs from your Sentry URL, not the display names. A typo means the connection fails.
  • Running both the plugin and a manual server. Pick one. Two entries mean duplicate tools and a subagent that may not be the one answering.
  • Expecting AI search on self-hosted with no LLM key. The stdio server leaves search_issues / search_events unavailable until an LLM provider is configured, and Seer may not be available on self-hosted installs at all.

Q&A

Do I need to create a Sentry API token?

Not for sentry.io. The hosted server uses OAuth, so you sign in through the browser and approve access. Tokens are only needed for the self-hosted stdio setup.

Can the agent change things in Sentry?

Only if you grant it. Inspect and Seer read data and run analysis. Triage (resolve/assign) and Project management (projects, teams, DSNs) are the write permissions, and you choose them on the approval screen.

What’s the difference between the plugin and claude mcp add ?

Both connect to the same hosted server. The plugin also adds a sentry-mcp subagent that Claude Code delegates to automatically for Sentry questions.

Does it work with self-hosted Sentry?

Yes, through the stdio server (npx @sentry/mcp-server) with SENTRY_HOST and a user auth token. Some features, like Seer, may not be available on self-hosted instances.

How do I remove it?

claude mcp remove sentry (or uninstall the plugin). You can also revoke the authorized application in your Sentry account settings.

Official Resources


Originally published at quickpromptco.com, where the guide is kept up to date.

Top comments (1)

Collapse
 
suppdevbot profile image
DEV SUPPORTS •

You need to verify your account.

Enter fullscreen mode Exit fullscreen mode

tr.ee/dev-to