MCP Server for Self-Hosted Sentry

Bring your Sentry data to AI assistants.

Triage issues, read stack frames, trace breadcrumbs and check debug symbols in your self-hosted Sentry. 28 tools, built so agents stay inside their context window: compact by default, with filters, grep and pagination to narrow further, and a 50k-token budget on list and detail tools.

Self-hosted Optional read-only mode 28 tools
Ask your AI assistant anything about your Sentry
> Show me top issues in production this week
Top Issues (This Week)
IssueEventsUsersFirst Seen
TypeError: Cannot read property 'x'3,4321222d ago
DBConnectionError: timeout1,987983d ago
ChunkLoadError: Loading chunk 23 failed1,102765d ago
Source: selfhosted-sentry-mcp

The problem

Sentry is powerful, but its API is hostile to an agent's context window.

Raw events are enormous

A single Sentry event endpoint can return 100K+ tokens — more than most models can hold.

Manual & time-consuming

Copy-paste, clicking around, exporting data — slow and error-prone.

Direct to your Sentry

The server talks only to your Sentry instance. Tool results go to whichever LLM client you connect, and on to its model provider.

Buried debugging signal

Stack frames, breadcrumbs and missing dSYMs sit deep inside payloads full of noise.

What it does

An MCP server that exposes your Sentry data to AI assistants, sized for their context window.

Issues & Events

List, search and inspect issues and events with Sentry query syntax.

Stack frames

Structured frames pulled out of the event, with an in-app-only filter.

Breadcrumbs

The trail of events leading up to an error, filterable by type.

dSYM checks

Spot missing iOS/macOS debug symbols and Android ProGuard mappings.

Grouping & releases

Fingerprint hashes, per-event grouping breakdowns, release health and distributed traces.

Token-aware

Field filters, grep patterns, stack truncation and cursor pagination. List and detail tools apply a 50k-token budget.

Quickstart (1 minute)

Configure your AI client to use the MCP server.

1

Create a Sentry auth token

Settings → Auth Tokens. Grant org:read, project:read, team:read, event:read and project:releases.

2

Add it to your client config

Pick your client below. Each tab shows where the file lives.

3

Start querying

Ask “list unresolved issues in my-project” to confirm the server loaded.

Use 1.2.0 or later. Earlier versions are deprecated: they can send your Sentry token to arbitrary hosts through raw_sentry_api and ignore SENTRY_READ_ONLY. If you ran one with an agent, rotate the token. See the changelog.

Project scope → .mcp.json in your repo root — gitignore it, it holds a token. User scope → claude mcp add --scope user, which keeps it out of the repo entirely.

{
  "mcpServers": {
    "sentry": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "selfhosted-sentry-mcp@latest"],
      "env": {
        "SENTRY_URL": "https://sentry.yourcompany.com",
        "SENTRY_AUTH_TOKEN": "<your-token>",
        "SENTRY_ORG_SLUG": "your-org",
        "SENTRY_READ_ONLY": "true"
      }
    }
  }
}

Project scope → .cursor/mcp.json. Global → ~/.cursor/mcp.json.

{
  "mcpServers": {
    "sentry": {
      "command": "npx",
      "args": ["-y", "selfhosted-sentry-mcp@latest"],
      "env": {
        "SENTRY_URL": "https://sentry.yourcompany.com",
        "SENTRY_AUTH_TOKEN": "<your-token>",
        "SENTRY_ORG_SLUG": "your-org",
        "SENTRY_READ_ONLY": "true"
      }
    }
  }
}

macOS → ~/Library/Application Support/Claude/claude_desktop_config.json. Windows → %APPDATA%\Claude\claude_desktop_config.json. Restart the app after editing.

{
  "mcpServers": {
    "sentry": {
      "command": "npx",
      "args": ["-y", "selfhosted-sentry-mcp@latest"],
      "env": {
        "SENTRY_URL": "https://sentry.yourcompany.com",
        "SENTRY_AUTH_TOKEN": "<your-token>",
        "SENTRY_ORG_SLUG": "your-org",
        "SENTRY_READ_ONLY": "true"
      }
    }
  }
}

Windsurf → ~/.codeium/windsurf/mcp_config.json. Check your Windsurf version's docs if that path has moved.

{
  "mcpServers": {
    "sentry": {
      "command": "npx",
      "args": ["-y", "selfhosted-sentry-mcp@latest"],
      "env": {
        "SENTRY_URL": "https://sentry.yourcompany.com",
        "SENTRY_AUTH_TOKEN": "<your-token>",
        "SENTRY_ORG_SLUG": "your-org",
        "SENTRY_READ_ONLY": "true"
      }
    }
  }
}

28 tools. Organized for productivity.

Issues (8)

  • get_sentry_issue
  • list_sentry_projects
  • list_sentry_issues
  • list_issues
  • get_issue_hashes
  • update_sentry_issue_statusWRITE
  • create_sentry_issue_commentWRITE
  • bulk_update_issuesWRITE

Events (6)

  • get_sentry_event_details
  • list_issue_events
  • list_error_events
  • get_stack_frames
  • check_dsym_status
  • list_breadcrumbs

Releases (2)

  • list_releases
  • get_release_details

Organization (4)

  • list_teams
  • get_issue_tags
  • get_issue_tag_values
  • list_activity

Advanced (3)

  • get_trace_details
  • get_grouping_config
  • merge_issuesWRITE

Attachments & feedback (3)

  • list_event_attachments
  • get_event_attachment
  • list_user_feedback

Account (1)

  • whoami

Raw API (1)

  • raw_sentry_apiWRITE

WRITE marks tools that can modify Sentry. raw_sentry_api accepts GET, POST, PUT and DELETE, so it can reach any endpoint your token permits. SENTRY_READ_ONLY=true hides and refuses the four mutating tools and restricts raw_sentry_api to GET — it is opt-in, and off by default.

Trust & Safety

Know where your data goes.

Self-hosted

Runs on your machine and talks only to your Sentry instance. Results are sent to whatever LLM client you connect.

Token-based auth

Uses your Sentry auth token, read from the environment. No password, no storage.

Read-only mode

Five tools can write to Sentry. SENTRY_READ_ONLY=true blocks them; it is opt-in, not the default. Bulk updates refuse to run without a query or an explicit ID list.

Open source

MIT licensed and auditable. See SECURITY.md for token scoping guidance.

Supercharge your Sentry workflow with AI.

Install selfhosted-sentry-mcp from npm and point it at your Sentry instance.

View on GitHub
Repo: HieuAnh87/sentry-selfhosted-mcp
npm selfhosted-sentry-mcp
View on npm →