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.
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)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| gfg_sentry_mcp_server-0.1.0.tar.gz | 4.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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.