Skip to main content

MCP server for querying Sentry alerts and issues.

Project description

Sentry MCP Server (Python)

This project provides a Python MCP server with tools for:

  • list alerts
  • retrieve alert detail (including rule payload)
  • search issues
  • retrieve an issue
  • list issue events
  • retrieve issue event

Tools

  1. sentry_list_alert_rules
    • Lists issue alert rules and/or metric alert rules.
  2. sentry_retrieve_alert_rule_detail
    • Retrieves a single alert rule detail (metric or issue).
  3. sentry_search_issues
    • Searches issues using Sentry query syntax.
    • Parameters:
      • query (required): Sentry issue search query.
      • org_slug (optional): overrides SENTRY_ORG_SLUG.
      • limit (optional): max results, clamped to 1..100 (default 25).
    • Returns:
      • organization: organization slug used.
      • query: original query string.
      • count: number of issues in this response.
      • issues: raw issue objects from Sentry.
    • Notes:
      • This tool fetches one page of results only.
      • For large result sets, use narrower filters and run multiple queries.
  4. sentry_retrieve_issue
    • Retrieves one issue by issue ID.
  5. sentry_list_issue_events
    • Lists error events for a specific issue.
    • Parameters:
      • issue_id (required): global Sentry issue ID.
      • org_slug (optional): overrides SENTRY_ORG_SLUG.
      • start / end (optional): ISO-8601 time range.
      • stats_period (optional): relative range like 24h, 7d (overrides start/end).
      • environment (optional): one or more environment filters.
      • full (optional): include full event body payload (stacktrace/context).
      • sample (optional): deterministic pseudo-random event order.
      • query (optional): Sentry event search query.
      • cursor (optional): pagination cursor from Sentry response headers.
    • Returns:
      • organization: organization slug used.
      • issue_id: issue ID used.
      • count: number of events in this response.
      • events: raw event objects from Sentry.
  6. sentry_retrieve_issue_event
    • Retrieves one specific issue event.
    • Parameters:
      • issue_id (required): global Sentry issue ID.
      • event_id (required): event ID, or latest, oldest, recommended.
      • org_slug (optional): overrides SENTRY_ORG_SLUG.
      • environment (optional): one or more environment filters.
    • Returns:
      • organization: organization slug used.
      • issue_id: issue ID used.
      • event_id: event identifier used.
      • event: raw event object from Sentry.

search_issues query examples

Use Sentry issue search filters in the query field:

  • is:unresolved level:error
  • environment:production release:1.2.3
  • user.email:alice@example.com
  • transaction:/api/orders has:stacktrace
  • project:backend assigned:me

Required Environment Variables

  • SENTRY_AUTH_TOKEN: Sentry token with sufficient read permissions.
  • SENTRY_ORG_SLUG: Default organization slug (optional if always passed to tools).
  • SENTRY_BASE_URL: Optional, defaults to https://sentry.io/api/0.

Install

python -m venv .venv
source .venv/bin/activate
pip install -e .

Run

export SENTRY_AUTH_TOKEN="YOUR_TOKEN"
export SENTRY_ORG_SLUG="your-org"
sentry-mcp-server

Example MCP config snippet

Use this in your MCP client configuration:

{
  "mcpServers": {
    "sentry": {
      "command": "sentry-mcp-server",
      "env": {
        "SENTRY_AUTH_TOKEN": "YOUR_TOKEN",
        "SENTRY_ORG_SLUG": "your-org"
      }
    }
  }
}

Publish to PyPI

This repository includes .github/workflows/publish-pypi.yml for trusted publishing.

  1. Create a release tag like v0.1.1.
  2. Push the tag to GitHub.
  3. GitHub Actions builds the package and publishes it to PyPI.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gfg_sentry_mcp_server-0.1.0.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gfg_sentry_mcp_server-0.1.0-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file gfg_sentry_mcp_server-0.1.0.tar.gz.

File metadata

  • Download URL: gfg_sentry_mcp_server-0.1.0.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for gfg_sentry_mcp_server-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6917db4a08b06af97eb5aec4f738ce3bfb3e2944ca63ed315d60f9a17e4397ed
MD5 134c94edafdfbf056259d97a74e1ab48
BLAKE2b-256 9caa2fcbf8b0d28d6a381f942b1583fa6a5cb4855f13bd999aa28c699d28a0d6

See more details on using hashes here.

File details

Details for the file gfg_sentry_mcp_server-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for gfg_sentry_mcp_server-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5fe032682f0bc1cea35877e9a68edbbe022e57647a31fedf8b4b9e32003cb537
MD5 a1c4204cc0cfed69872920ce9a9a4c2f
BLAKE2b-256 0e1d6a89231d98eab04f0352738f39236ec5a7653702f572346a7153ff1f7b7b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page