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
sentry_list_alert_rules- Lists issue alert rules and/or metric alert rules.
sentry_retrieve_alert_rule_detail- Retrieves a single alert rule detail (
metricorissue).
- Retrieves a single alert rule detail (
sentry_search_issues- Searches issues using Sentry query syntax.
- Parameters:
query(required): Sentry issue search query.org_slug(optional): overridesSENTRY_ORG_SLUG.limit(optional): max results, clamped to1..100(default25).
- 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.
sentry_retrieve_issue- Retrieves one issue by issue ID.
sentry_list_issue_events- Lists error events for a specific issue.
- Parameters:
issue_id(required): global Sentry issue ID.org_slug(optional): overridesSENTRY_ORG_SLUG.start/end(optional): ISO-8601 time range.stats_period(optional): relative range like24h,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.
sentry_retrieve_issue_event- Retrieves one specific issue event.
- Parameters:
issue_id(required): global Sentry issue ID.event_id(required): event ID, orlatest,oldest,recommended.org_slug(optional): overridesSENTRY_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:errorenvironment:production release:1.2.3user.email:alice@example.comtransaction:/api/orders has:stacktraceproject: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 tohttps://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.
- Create a release tag like
v0.1.1. - Push the tag to GitHub.
- GitHub Actions builds the package and publishes it to PyPI.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6917db4a08b06af97eb5aec4f738ce3bfb3e2944ca63ed315d60f9a17e4397ed
|
|
| MD5 |
134c94edafdfbf056259d97a74e1ab48
|
|
| BLAKE2b-256 |
9caa2fcbf8b0d28d6a381f942b1583fa6a5cb4855f13bd999aa28c699d28a0d6
|
File details
Details for the file gfg_sentry_mcp_server-0.1.0-py3-none-any.whl.
File metadata
- Download URL: gfg_sentry_mcp_server-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5fe032682f0bc1cea35877e9a68edbbe022e57647a31fedf8b4b9e32003cb537
|
|
| MD5 |
a1c4204cc0cfed69872920ce9a9a4c2f
|
|
| BLAKE2b-256 |
0e1d6a89231d98eab04f0352738f39236ec5a7653702f572346a7153ff1f7b7b
|