Sentry MCP Server
Connect your AI coding tools to Sentry using the Model Context Protocol (MCP) for direct access to issues, errors, and debugging data.
The Sentry MCP Server is production-ready, but MCP is still evolving. Expect rough edges. File bugs on GitHub.
The Sentry MCP Server connects your AI coding tools to Sentry using the Model Context Protocol (MCP). It gives your agent direct access to issues, errors, projects, and Seer analysis.
Sentry hosts the MCP server at https://mcp.sentry.dev/mcp. Your client connects over Streamable HTTP with OAuth — there's nothing to install.
Add the server automatically:
npx add-mcp https://mcp.sentry.dev/mcp
Or add it manually to your client's MCP configuration:
{
"mcpServers": {
"Sentry": {
"url": "https://mcp.sentry.dev/mcp"
}
}
}
When you first connect, you'll be prompted to log in with your Sentry organization and grant access. During authentication, you select which tool groups to expose — this keeps the context window focused on the tools you actually need.
See Client Instructions for setup steps specific to your editor or IDE.
If you've joined a new Sentry organization, log out of your LLM's MCP integration and log back in to refresh access.
Alternatively, you can run the MCP server locally via npx @sentry/mcp-server. Your IDE spawns the process and communicates over stdin/stdout. This is required for self-hosted Sentry.
For sentry.io users, the server uses device-code authentication. On first run it opens your browser to log in — no manual token creation needed. The token is cached at ~/.sentry/mcp.json for future sessions.
If you're in a non-interactive environment (CI, piped stdio), authenticate ahead of time:
npx @sentry/mcp-server@latest auth login
You can check or clear your auth state with auth status and auth logout.
Add the server to your client's MCP configuration:
{
"mcpServers": {
"Sentry": {
"command": "npx",
"args": ["@sentry/mcp-server@latest"]
}
}
}
When using stdio, the AI-powered search tools (search_events, search_issues) require an OPENAI_API_KEY environment variable for natural language query translation. The Cloud transport handles this automatically.
Restrict the MCP session to a specific organization or project to keep context focused.
Cloud: Append the slug to the URL path:
https://mcp.sentry.dev/mcp/my-org— one organizationhttps://mcp.sentry.dev/mcp/my-org/my-project— one project
Stdio: Use CLI flags:
--organization-slug=my-org--project-slug=my-project
When scoped, redundant discovery tools are hidden automatically.
Self-hosted instances use the stdio transport with an access token. The Cloud endpoint and device-code OAuth are only available for sentry.io.
Create a token in User Settings → Auth Tokens with these scopes:
org:readproject:readproject:writeteam:readteam:writeevent:write
Configure the server with your hostname:
npx @sentry/mcp-server@latest --access-token=YOUR_TOKEN --host=sentry.example.com
Or as environment variables:
SENTRY_ACCESS_TOKEN=YOUR_TOKEN
SENTRY_HOST=sentry.example.com
JSON config for clients that support it:
{
"mcpServers": {
"Sentry": {
"command": "npx",
"args": [
"@sentry/mcp-server@latest",
"--access-token=YOUR_TOKEN",
"--host=sentry.example.com"
]
}
}
}
Some cloud-only features like Seer aren't available on self-hosted. Disable them:
npx @sentry/mcp-server@latest --access-token=YOUR_TOKEN --host=sentry.example.com --disable-skills=seer
The MCP server targets the cloud service. Some tools may call APIs that aren't available in your self-hosted version yet.
Paste a Sentry issue URL into your agent. The MCP server pulls the stack trace, event details, and tags so the agent can investigate and propose a fix. Try prompts like:
- "Fix this issue:
https://sentry.io/issues/6811213890/" - "What's the root cause of
https://my-org.sentry.io/issues/PROJECT-123/?"
Ask questions in plain English. The search_issues and search_events tools translate your queries into Sentry's search syntax:
- "What are the top unresolved errors in production this week?"
- "Show me errors that started after the last deploy."
- "Compare error rates between v2.3 and v2.4 for my-project."
Setup steps for specific editors and IDEs. All instructions default to the Cloud transport — see Stdio Transport if you need the local server.
The Sentry MCP page has a web interface where you can authenticate and test the server directly in your browser.
OAuth Authentication Problems
- Ensure your client supports OAuth
- Check that you have the right permissions in your Sentry organization
- Try reauthenticating (see below)
Reauthenticating in Claude Code
- Type
/mcpin the Claude Code prompt - Select the Sentry server
- Choose "Clear authentication" or "Authenticate" to re-trigger OAuth
Reauthenticating in OpenCode
opencode mcp auth list— check statusopencode mcp logout sentry— log outopencode mcp auth sentry— log back in
Reauthenticating in Factory Droid
- Type
/mcp→ select Sentry → "Reauthenticate"
Connection Issues
- Verify the URL:
https://mcp.sentry.dev/mcp - Check your client's MCP config syntax
Missing Tools
- Verify authentication completed
- Check your Sentry org access
- Look for errors in your client's console
For additional help, visit the GitHub repository or contact Sentry support.
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").