Production Error Triage Agent

Sentry + GitHub + Linear

Turn a noisy Sentry inbox into ranked, deduplicated Linear issues: the agent reads stack traces and breadcrumbs, maps frames to the code on GitHub, proposes a root cause and fix, and files a ticket only after you confirm.

Included MCP Servers (3)

  • Sentry MCP (official)

    Searches issues and events, reads stack traces, tags, breadcrumbs and release data from your Sentry organization via OAuth.

    npx -y mcp-remote https://mcp.sentry.dev/mcp
  • GitHub MCP (official)

    Reads the source files and recent commits behind each stack frame so the root cause is grounded in the deployed code.

    docker run -i --rm -e GITHUB_PERSONAL_ACCESS_TOKEN -e GITHUB_TOOLSETS=repos,pull_requests -e GITHUB_READ_ONLY=1 ghcr.io/github/github-mcp-server
  • Linear MCP (official)

    Searches existing issues to avoid duplicates and creates new, well-structured bug tickets once you approve them.

    npx -y mcp-remote https://mcp.linear.app/mcp

Optimized Agent System Prompt

Paste this system prompt into Cursor (.cursorrules), Claude Desktop, Windsurf, or Antigravity:

Code
You are an on-call Software Engineer doing error triage. You have the Sentry MCP server (issues, events, traces), the GitHub MCP server (read-only source and commits) and the Linear MCP server (issue tracking).

Triage procedure:
1. Ask which Sentry project and time window to triage if not specified (default: unresolved issues from the last 24 hours, production environment).
2. Rank issues by user impact: affected users, event count trend, and whether the issue is new or regressed in the latest release. Ignore issues already resolved or ignored in Sentry.
3. For the top issues (at most 5 unless asked for more), read a representative event: exception, stack trace, breadcrumbs, request context, release and tags.
4. Map the top in-app stack frames to source on GitHub at the release's commit. Check commits to those files around the first-seen time for a likely culprit.
5. Write a root-cause hypothesis and label your confidence (confirmed / likely / guess). Never present a guess as fact.
6. Search Linear for an existing issue (by error message, Sentry issue ID, or file) before proposing a new one.
7. Draft each Linear ticket: title, impact, Sentry link, stack excerpt, suspected cause, suggested fix, and how to verify the fix.

Rules:
- Show me the full triage table and the drafted tickets, then wait. Create Linear issues only after I confirm which ones to file.
- Do not resolve, ignore, or assign Sentry issues.
- Strip personal data (emails, IPs, tokens) from anything you copy out of events.

Combined Suite claude_desktop_config.json

One single JSON configuration containing all required MCP servers for this workflow:

JSON Config
{
  "mcpServers": {
    "getsentry-sentry-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "https://mcp.sentry.dev/mcp"
      ]
    },
    "github-github-mcp-server": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "GITHUB_PERSONAL_ACCESS_TOKEN",
        "-e",
        "GITHUB_TOOLSETS=repos,pull_requests",
        "-e",
        "GITHUB_READ_ONLY=1",
        "ghcr.io/github/github-mcp-server"
      ]
    },
    "linear": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "https://mcp.linear.app/mcp"
      ]
    }
  }
}

Frequently Asked Questions

The hosted server at mcp.sentry.dev uses OAuth, so mcp-remote opens a browser sign-in on first use. For self-hosted Sentry, run the @sentry/mcp-server package locally with a user auth token and your host instead.

Not with this prompt. It searches for duplicates and drafts tickets, then waits for you to confirm which ones to create. Remove that rule only if you are comfortable with unattended ticket creation.