
When a production error fires, most developers follow the same pattern: switch to the browser, open Sentry, find the issue, copy the stack trace, switch back to the terminal, and paste it in. That context switch breaks focus and adds minutes to every debugging cycle.
To help your developers pull Sentry error data directly into their coding session, we'll show you how to connect Sentry with Merge Agent Handler's Sentry MCP server.
Merge Agent Handler routes requests from Claude Code to Sentry's API. You install the Merge CLI, authenticate once, and register the connection with a single command. Agent Handler manages auth token storage so you don't keep Sentry credentials in your local environment or wire them into your codebase.
Here's the command that registers the connection:
Before getting started, you'll need the following:
claude --version to confirm)pipx --version to confirm, or install via pip install pipx)If you want to connect Merge Agent Handler's Sentry MCP with internal or customer-facing agentic products, you can follow the steps in our docs.
Install with pipx: pipx install merge-api

Verify your installation: merge --version
Related: How to use a Sentry MCP in Cursor
Run merge login to authenticate your session and link the CLI to your Merge Agent Handler account: merge login
This authenticates your session so the CLI can make authorized requests on your behalf.
To add Agent Handler to Claude Code, run:
Or register manually with:
Verify the connection registered. Open Claude Code and run: /mcp
agent-handler should appear under Local MCPs with a connected status.

Open a Claude Code session and test it with: "Show me the 5 most recent unresolved errors in the production environment and summarize the stack trace for the most critical one."
The first time you use a Sentry tool, a Magic Link will appear to authenticate the connector.

You should then see an output like the following:

{{this-blog-only-cta}}
In case you have more questions on setting up and using the Sentry MCP in Claude Code, we've addressed several more commonly-asked questions below.
With Sentry connected, Claude Code can:
This pays off most during active debugging. Instead of switching to the browser to find the relevant Sentry issue, copying the stack trace, and pasting it into your terminal, Claude Code can retrieve the full error context in the same session where you're writing the fix.
You can build a self-hosted MCP server that talks directly to Sentry's API. For a single developer on a personal project, that approach is straightforward.
It breaks down at the team level. Self-hosting means managing Sentry auth tokens per developer, handling token rotation when someone leaves, and keeping the server maintained as Sentry's API evolves. Each developer ends up with their own credential management problem, and there's no central place to audit what your agents are reading or writing.
Merge Agent Handler is a managed MCP layer. It centralizes authentication, scopes access at the Tool Pack and Registered User level so each developer gets access to exactly the projects they need, and logs every tool call for observability. When you need to know what an agent queried during an incident, the audit trail is there.
For teams running agents in production against live Sentry data, Merge Agent Handler removes the credential overhead and adds the security controls that matter at scale.
Sentry is where your production errors live. Claude Code is where you fix them. The gap between those two environments is the context switch that slows down every debugging session.
With the Sentry MCP connected, Claude Code can retrieve issue lists, read full stack traces, and check error status without leaving the terminal. That means you can describe a bug to Claude, have it pull the relevant Sentry events, and start reasoning about the root cause in a single session. Engineers debugging regressions can ask Claude to compare recent errors against a specific release, identify the spike, and trace it to a file, all without opening a browser.
Use Merge Agent Handler’s 150+ connectors (including Sentry) to power reliable, secure, and powerful agents.