mirror of
https://github.com/wesammustafa/opencode-primer.git
synced 2026-11-18 18:04:22 +00:00
Each walkthrough follows the same template: when to reach for it, setup (verbatim opencode.json snippet), example prompts, capabilities and limitations, gotchas, resources. - playwright.md: browser automation — visual iteration loop, e2e scaffolding, bug repro from a URL - context7.md: live, version-pinned library docs piped into the prompt, with the "resolve first, query second" pattern - sentry.md: errors / traces / releases via OAuth (DCR), with the error-to-root-cause pattern - grep.md: code search across public GitHub via the Vercel-hosted MCP README.md ranks "when to add a server" against the cost of the extra tokens it puts in the model's context every turn, with a tools-map example for disabling chatty MCP tools per agent. All endpoint URLs and package names link-checked at commit time.
2.6 KiB
2.6 KiB
Sentry MCP
Pull errors, traces, and releases from your Sentry org into OpenCode. Useful when investigating a production issue or correlating a deploy with new errors.
When to reach for it
- 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
Setup
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 sentry
A browser will open. Sign in to Sentry and authorize OpenCode. The credentials are stored locally.
Verify:
opencode mcp list # should show "sentry" as authenticated
Example prompts
use 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?
What it can do
- 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
Common pattern: error → root cause
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
What it won't do
- Resolve issues automatically (you wouldn't want it to)
- Create new releases or deploys
- Access projects you're not a member of
Gotchas
- 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.