Sentry MCP Server Setup Guide
On this page
From error alert to fix in one conversation
An alert says checkout is throwing a TypeError. The usual routine is: open Sentry, find the issue, read the stack trace, copy the relevant frame, switch back to your editor, find the file. With Sentry's MCP server connected, you can ask the agent "what's the most common error in the checkout project this week, and where in our code does it start?" and it does the lookup and opens the file.
Step 1: build a scoped URL
The hosted server is at https://mcp.sentry.dev/mcp. You can scope it by adding your organization slug, and optionally a project slug, to the path:
| URL | Scope |
|---|---|
https://mcp.sentry.dev/mcp | Every organization your account can see |
https://mcp.sentry.dev/mcp/acme | One organization |
https://mcp.sentry.dev/mcp/acme/checkout-web | One project |
Sentry recommends scoping to a project when you can. Tools then default to that project, and discovery tools you don't need are hidden, which keeps the tool list short. Both slugs are in your Sentry URLs: acme.sentry.io/projects/checkout-web/.
Step 2: add it to your tool
All connections use OAuth. The first time the server is used, your browser opens to sign in to Sentry. There's no token to manage.
Claude Code:
claude mcp add --transport http sentry https://mcp.sentry.dev/mcp/acme/checkout-webIf the browser doesn't open on its own, start Claude Code and run /mcp, or run claude mcp login sentry from your terminal.
Cursor (.cursor/mcp.json):
{
"mcpServers": {
"sentry": {
"url": "https://mcp.sentry.dev/mcp/acme/checkout-web"
}
}
}VS Code: open the Command Palette, run MCP: Add Server, choose HTTP and paste the URL.
Codex CLI opens the sign-in right after adding:
codex mcp add sentry --url https://mcp.sentry.dev/mcp/acme/checkout-webClaude Code plugin. Sentry also ships the server as a plugin, which adds a sentry-mcp subagent for triage work:
claude plugin marketplace add getsentry/sentry-mcp
claude plugin install sentry-mcp@sentry-mcpRunning it locally, or against self-hosted Sentry
The @sentry/mcp-server package runs the server on your machine. It's the option for self-hosted Sentry, or when you'd rather use a token than OAuth. Sign in once, then run it:
npx @sentry/mcp-server@0.49.0 auth loginOr give it a user auth token through SENTRY_AUTH_TOKEN. For self-hosted Sentry, also set SENTRY_HOST:
{
"mcpServers": {
"sentry": {
"command": "npx",
"args": ["-y", "@sentry/mcp-server@0.49.0"],
"env": {
"SENTRY_AUTH_TOKEN": "your-token",
"SENTRY_HOST": "sentry.example.com"
}
}
}
}The older SENTRY_ACCESS_TOKEN variable and --access-token flag still work but print a deprecation warning.
The AI-powered search tools (search_errors, search_issues, search_traces and search_logs) turn plain-English questions into Sentry queries, and the local server needs its own model for that. Set EMBEDDED_AGENT_PROVIDER (for example openai, with OPENAI_API_KEY) to pick one. OpenAI, Azure OpenAI, Anthropic and OpenRouter are supported. Without one, those four tools are unavailable and the rest still work.
Things to know before you rely on it
- Rate limits. Tool calls go through Sentry's API limits. If you see "Rate Limited", ask the agent to make calls one at a time.
- It's read-heavy, not read-only. The server can also manage projects. Keep tool approval on, and read what the agent plans to change.
- Skills. The hosted server groups tools into skills such as
inspect,triageandseer. You can turn some off with a query parameter, for example?disable-skills=seer.
Check it works
Ask: "Show me the three most frequent unresolved issues in this project from the last 24 hours." You should see a search tool call and a list with issue titles and counts. If you get an authorization error, run /mcp (Claude Code) or codex mcp login sentry (Codex) and sign in again.
Check yourself
https://mcp.sentry.dev/mcp/<org>/<project>. Tools default to that project and unneeded discovery tools are hidden, so the agent has fewer, more relevant tools.
The local server has no model for its AI search tools. Set EMBEDDED_AGENT_PROVIDER and the provider's API key.
Use the local @sentry/mcp-server package with SENTRY_AUTH_TOKEN and SENTRY_HOST set to your instance.