Overview
Access Sentry error tracking and application monitoring data.
Setup
Run with npx:
npx -y @modelcontextprotocol/server-sentryConfiguration
SENTRY_AUTH_TOKEN and SENTRY_ORG environment variablesDocumentation
Sentry MCP
Overview
Sentry MCP is a Model Context Protocol server that enables AI agents to interact with Sentry, the leading application monitoring and error tracking platform. It allows agents to fetch error reports, analyze issues, and help diagnose problems in production applications.
Key Features
🐛 Error Analysis
- Fetch Issues: Retrieve error issues from Sentry projects
- Issue Details: Get detailed information about specific errors
- Error Trends: Analyze error frequency and patterns
- Stack Trace Analysis: Understand error root causes
📊 Project Insights
- List Projects: View all Sentry projects
- Project Stats: Get error statistics per project
- Release Tracking: Monitor errors by release version
- Environment Filtering: Filter by environment (production, staging, etc.)
🔍 Search & Filter
- Search Issues: Find specific errors by message or fingerprint
- Filter by Tags: Filter issues by custom tags
- Date Range: Query errors within specific time periods
- Severity Levels: Filter by error severity
Installation
# Using npx (recommended)
npx -y @modelcontextprotocol/server-sentry
# With Sentry DSN
SENTRY_DSN=https://xxx@xxx.ingest.sentry.io/xxx npx -y @modelcontextprotocol/server-sentry
Configuration
Required Setup
-
Get a Sentry API Key:
- Log into Sentry
- Go to Settings → API Keys
- Create a new API key with appropriate permissions
- Recommended scopes:
project:read,event:read
-
Set Environment Variables:
export SENTRY_AUTH_TOKEN=your-auth-token export SENTRY_ORG=your-organization-slug -
Configure in Claude Desktop:
{ "mcpServers": { "sentry": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-sentry"], "env": { "SENTRY_AUTH_TOKEN": "your-auth-token", "SENTRY_ORG": "your-org-slug" } } } }
Available Tools
| Tool | Description |
|---|---|
list_projects | List all projects in the organization |
get_issue | Get details of a specific issue by ID or URL |
list_issues | List issues with filtering options |
get_issue_stats | Get error statistics for a project |
search_issues | Search for issues by query |
get_releases | List releases for a project |
get_tags | List available tags for filtering |
Usage Examples
List Your Projects
Show me all my Sentry projects
Returns:
Projects:
- my-app-web (web)
- my-app-api (api)
- my-app-mobile (mobile)
Get Issue Details
Show me details for issue ABC-123
Returns:
Issue: ABC-123
Title: TypeError: Cannot read property 'map' of undefined
Project: my-app-web
Status: Unresolved
First Seen: 2026-05-10
Last Seen: 2026-05-14
Occurrences: 247
Users Affected: 42
Search for Recent Errors
Find all errors in my-app-api from the last 24 hours
Agent queries Sentry with:
- Project:
my-app-api - Time range: Last 24 hours
- Level:
error
Analyze Error Patterns
What are the most common errors in production this week?
Agent returns:
TypeError: undefined is not a function- 1,234 occurrencesNetworkError: Failed to fetch- 892 occurrencesValidationError: Invalid input- 567 occurrences
Get Error Statistics
Show me error trends for my-app-web over the last month
Returns daily error counts with trend analysis.
Filter by Tags
Show me errors tagged with 'critical' in the last week
Agent filters by tag: level:error tag:critical
Integration with AI Agents
Proactive Error Monitoring
Claude: "I noticed you have several unresolved errors in Sentry..."
[Lists recent critical issues]
Claude: "Let me analyze the most frequent one..."
[Fetches and analyzes stack trace]
Claude: "This appears to be caused by a null reference in the user profile component. Here's a potential fix..."
Incident Response
User: "We're seeing errors in production"
Claude: "Let me check Sentry for recent issues..."
[Queries Sentry for last hour]
Claude: "I found 3 new critical issues. Let me get details..."
[Provides analysis and potential fixes]
Release Monitoring
Claude: "Your latest release v2.3.1 has 47 new errors..."
[Lists new errors by release]
Claude: "Most are related to the new authentication flow. Here's what I found..."
Custom Agent Integration
from mcp import ClientSession, StdioServerParameters
from mcp.client.stdio import stdio_client
import os
# Connect to Sentry MCP
server_params = StdioServerParameters(
command="npx",
args=["-y", "@modelcontextprotocol/server-sentry"],
env={
"SENTRY_AUTH_TOKEN": os.environ["SENTRY_AUTH_TOKEN"],
"SENTRY_ORG": os.environ["SENTRY_ORG"]
}
)
async with stdio_client(server_params) as (read, write):
async with ClientSession(read, write) as session:
await session.initialize()
# List projects
projects = await session.call_tool("list_projects", arguments={})
# Get recent issues
issues = await session.call_tool(
"list_issues",
arguments={
"project": "my-app-web",
"status": "unresolved",
"limit": 10
}
)
# Get specific issue
issue = await session.call_tool(
"get_issue",
arguments={"issue_id": "ABC-123"}
)
Sentry API Permissions
Required API key scopes:
| Scope | Required For |
|---|---|
project:read | List projects, get issue details |
event:read | Read error events and stack traces |
org:read | Access organization settings |
release:read | View release information |
Pros
- ✅ Production Insights: Direct access to real error data
- ✅ Root Cause Analysis: AI can analyze stack traces
- ✅ Trend Detection: Identify error patterns over time
- ✅ Release Tracking: Monitor errors by version
- ✅ Proactive Alerts: Agents can notify about new issues
- ✅ Stack Trace Understanding: AI explains complex errors
Cons
- ❌ API Key Required: Must create Sentry API key
- ❌ Organization Setup: Requires Sentry organization
- ❌ Rate Limits: Sentry API has rate limits
- ❌ Cost: Sentry has costs for high-volume projects
- ❌ Read-Only: Cannot create issues or resolve them
When to Use
Choose Sentry MCP when:
- You use Sentry for error tracking
- You want AI to help diagnose production errors
- You need to analyze error patterns
- You want proactive error monitoring
Consider alternatives when:
- You use a different error tracking service
- You only need occasional error checks
- You want write access to Sentry (not supported)
Resources
- GitHub: https://github.com/modelcontextprotocol/servers/tree/main/src/sentry
- Sentry Documentation: https://docs.sentry.io/
- Sentry API: https://docs.sentry.io/api/
- MCP Servers Repo: https://github.com/modelcontextprotocol/servers
Comparison
| Feature | Sentry MCP | Logtail MCP | Datadog MCP |
|---|---|---|---|
| Error Tracking | ✅ Excellent | ⚠️ Basic | ✅ Good |
| Stack Traces | ✅ Full | ⚠️ Limited | ✅ Full |
| Trend Analysis | ✅ Yes | ⚠️ Basic | ✅ Excellent |
| Release Tracking | ✅ Yes | ❌ No | ✅ Yes |
| Setup Complexity | ⚠️ Moderate | ✅ Easy | ⚠️ Moderate |
| Cost | ⚠️ Can be high | ✅ Low | ⚠️ Can be high |
Last updated: May 2026
