Skip to main content

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.

Metadata

Release files for gfg-sentry-mcp-server 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gfg-sentry-mcp-server 0.1.0
File Size Uploaded Provenance
gfg_sentry_mcp_server-0.1.0.tar.gz 4.9 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for gfg-sentry-mcp-server 0.1.0
File Interpreter ABI Platform
gfg_sentry_mcp_server-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 10.6 kB

Release files / gfg_sentry_mcp_server-0.1.0.tar.gz

Download URL gfg_sentry_mcp_server-0.1.0.tar.gz
Size 4.9 kB
Tags Source
SHA-256 checksum
How to use checksums
6917db4a08b06af97eb5aec4f738ce3bfb3e2944ca63ed315d60f9a17e4397ed
BLAKE2b-256 checksum
How to use checksums
9caa2fcbf8b0d28d6a381f942b1583fa6a5cb4855f13bd999aa28c699d28a0d6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Release files / gfg_sentry_mcp_server-0.1.0-py3-none-any.whl

Download URL gfg_sentry_mcp_server-0.1.0-py3-none-any.whl
Size 5.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5fe032682f0bc1cea35877e9a68edbbe022e57647a31fedf8b4b9e32003cb537
BLAKE2b-256 checksum
How to use checksums
0e1d6a89231d98eab04f0352738f39236ec5a7653702f572346a7153ff1f7b7b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Security for gfg-sentry-mcp-server 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page