loading…
Search for a command to run...
loading…
Automatically reads Sentry issues, investigates them by analyzing your Ruby codebase, explains why issues happened, and provides fix suggestions.
Automatically reads Sentry issues, investigates them by analyzing your Ruby codebase, explains why issues happened, and provides fix suggestions.
A Model Context Protocol (MCP) server that automatically reads Sentry issues, investigates them by analyzing your Ruby codebase, explains why issues happened, and provides fix suggestions tailored for Ruby applications.
git clone https://github.com/doraemon0905/sentry-mcp
cd sentry-mcp
npm install
npm run build
org:readproject:read event:readalerts:readteam:readAdd the MCP server to your Cursor configuration. Edit your MCP settings file:
On macOS/Linux: ~/.cursor/mcp.json
On Windows: %APPDATA%\Cursor\mcp.json
{
"mcpServers": {
"sentry-investigator": {
"command": "node",
"args": ["/path/to/sentry-mcp/dist/index.js"],
"env": {
"SENTRY_AUTH_TOKEN": "your-sentry-auth-token-here",
"SENTRY_ORGANIZATION": "your-sentry-org-slug",
"SENTRY_PROJECT": "your-default-project-slug"
}
}
}
}
Required Environment Variables:
SENTRY_AUTH_TOKEN: Your Sentry API tokenSENTRY_ORGANIZATION: Your Sentry organization slugSENTRY_PROJECT: (Optional) Your default project slugReplace /path/to/sentry-mcp with the actual path to this project.
Restart Cursor to load the new MCP server.
Use the get_sentry_issues tool to fetch recent issues:
- project: (optional) Specific project slug
- limit: Number of issues (default: 10, max: 100)
- status: unresolved, resolved, or ignored (default: unresolved)
Use the investigate_issue tool with:
- issue_id: The Sentry issue ID
- codebase_path: Path to your Ruby codebase (default: current directory)
- include_fix: Whether to include fix suggestions (default: true)
Use the analyze_stack_trace tool to analyze any Ruby stack trace:
- stack_trace: The stack trace text
- codebase_path: Path to your Ruby codebase (default: current directory)
| Tool | Description |
|---|---|
get_sentry_issues |
Fetch recent issues from Sentry |
investigate_issue |
Full investigation of a specific issue (supports short IDs like "ATS-3YJ") |
analyze_stack_trace |
Analyze any stack trace with Ruby code context |
When you investigate a Ruby issue, you'll get a comprehensive report including:
# 🐛 Issue Investigation Report
**Issue:** NoMethodError: undefined method `name' for nil:NilClass
**ID:** 12345 (PROJ-1AB)
**Status:** unresolved
**Level:** error
**Occurrences:** 45 (12 users affected)
**First Seen:** 2024-01-15 10:30:00
**Last Seen:** 2024-01-20 15:45:00
## 🔍 Stack Trace Analysis
**Parsed Stack Trace:**
1. `get_user_data`
📁 app/services/user_service.rb:25
### 📄 `app/services/user_service.rb` (Line 25)
```ruby
23: def get_user_data(user_id)
24: user = User.find_by(id: user_id)
→ 25: user.name # Error occurs here
26: end
🔧 Function: get_user_data
Error Type: NoMethodError
Ruby error caused by trying to call a method on a nil object.
Frequency Analysis: Medium frequency (9 occurrences/day) Impact Level: 🟡 Medium (12 users affected)
# Add method existence checks
if user.respond_to?(:name)
user.name
else
# Handle missing method case
end
# Or use safe navigation
user&.name
src/
├── index.ts # Main MCP server entry point
├── services/
│ ├── SentryService.ts # Sentry API integration
│ ├── CodebaseAnalyzer.ts # Ruby-focused code analysis utilities
│ └── IssueInvestigator.ts # Main investigation logic
The MCP is optimized for Ruby applications and includes:
.rb, .erb, .rake filesdef, self., lambdas, procs)require, require_relative, include, extend, gem statementsNoMethodError, NameError, ArgumentError, TypeError, etc.npm run build - Build the TypeScript projectnpm run dev - Build in watch mode for developmentnpm start - Run the built servernpm install
npm run build
MIT License - see LICENSE file for details.
"Sentry service not configured"
SENTRY_AUTH_TOKEN and SENTRY_ORGANIZATION environment variables are set in your MCP configuration"No project specified and no default project configured"
SENTRY_PROJECT environment variable"Failed to connect to Sentry"
"File not found in codebase"
.rb, .erb, .rake) over other file typesvendor/, tmp/) from analysisRun in your terminal:
claude mcp add sentry-investigator -- npx Not sure what to pick?
Find your stack in 60 seconds
Author?
Embed badge for your README
Browse similar
All development MCPs