Pull errors, traces, and releases from your Sentry org into OpenCode. Useful when investigating a production issue or correlating a deploy with new errors.
- Investigating a production error someone pasted a link to
- Auditing recent errors after a deploy
- Correlating a release with a regression
- Tracking down the request trace for a slow endpoint
Sentry MCP uses OAuth. OpenCode handles Dynamic Client Registration automatically.
Add to opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"sentry": {
"type": "remote",
"url": "https://mcp.sentry.dev/mcp",
"oauth": {}
}
}
}Restart OpenCode, then complete OAuth:
opencode mcp auth sentryA browser will open. Sign in to Sentry and authorize OpenCode. The credentials are stored locally.
Verify:
opencode mcp list # should show "sentry" as authenticateduse sentry to fetch the latest 10 errors in the production environment
use sentry — pull the error at https://my-org.sentry.io/issues/12345/
and explain what's happening
the user got a 500 — request ID is `req_abc123`. find the corresponding
trace in sentry and walk me through what happened
we deployed `v2.45.0` 30 minutes ago. use sentry to compare error rates
in the last 30 minutes versus the previous hour — any new error types?
- List issues / errors with filtering (project, environment, time range, severity)
- Fetch full error context — stack trace, breadcrumbs, request data, user context
- List recent releases and their error counts
- Fetch traces and spans
- Search issues by message or stack frame
use sentry to fetch the most recent occurrence of issue PROJ-12345
- Look at the stack trace and identify the failing code
- Open the relevant file (use @ syntax)
- Explain the root cause and propose a fix
- Resolve issues automatically (you wouldn't want it to)
- Create new releases or deploys
- Access projects you're not a member of
- OAuth scope — the OAuth flow grants the same permissions your Sentry user has. Audit before authorizing on shared/admin accounts.
- Re-auth periodically — tokens expire. If queries start failing, run
opencode mcp auth sentryagain. - Rate limits — Sentry's API has rate limits. Heavy querying gets throttled.