@openpets/sentry
v1.0.0
Published
Complete Sentry integration through MCP server for issue tracking, error analysis, and performance monitoring
Downloads
75
Maintainers
Readme
Sentry Pet Plugin
Complete Sentry integration for OpenCode through Sentry's official MCP server, providing comprehensive error monitoring, issue tracking, and performance analysis capabilities.
Features
- Issue Management: List, search, and analyze Sentry issues
- Error Analysis: Find errors in specific files or across projects
- Seer AI Integration: Use Sentry's AI agent for automated root cause analysis
- Project Management: Create projects, manage DSNs, list organizations and teams
- Release Tracking: Query release information and deployment status
- Natural Language Search: AI-powered search for issues and events
- Read-Only Mode: Safe operation with write operations disabled
Setup
1. Get Sentry Access Token
- Go to Sentry → Settings → Account → API
- Click "Create New Token"
- Give it a name and these required scopes:
org:readproject:readproject:writeteam:readteam:writeevent:write
- Copy the token
2. Configure Environment Variables
Create .env file in the Sentry plugin directory:
# Required
SENTRY_ACCESS_TOKEN=your-sentry-token-here
# Optional - for self-hosted Sentry
SENTRY_HOST=your-sentry-instance.com
# Optional - for AI-powered search
OPENAI_API_KEY=your-openai-api-key-here3. Install Dependencies
cd pets/sentry
bun installUsage Examples
Basic Issue Management
# Test connection
opencode run "test sentry connection"
# List all projects
opencode run "list all sentry projects"
# List recent issues
opencode run "list all sentry issues"
# Get issue details
opencode run "get details for issue PROJ-123"Error Analysis
# Search for errors in a specific file
opencode run "search for errors in components/UserProfile.tsx"
# Analyze issue with Seer AI
opencode run "analyze issue with seer for PROJ-456"
# Natural language search for issues
opencode run "find all TypeError issues related to user authentication"Project Management
# Create a new project
opencode run "create a new sentry project called 'my-new-service'"
# List DSNs for a project
opencode run "list DSNs for project my-service"
# List teams in organization
opencode run "list teams in organization my-org"Available Tools
Connection & Organization
sentry-test-connection- Test Sentry connection and get statussentry-list-organizations- List all Sentry organizations
Project Management
sentry-list-projects- List projects with optional filteringsentry-create-project- Create a new Sentry projectsentry-list-dsns- List DSNs for a projectsentry-create-dsn- Create a new DSN
Issue Management
sentry-list-issues- List issues with comprehensive filteringsentry-get-issue-details- Get detailed issue informationsentry-search-issues- Natural language issue search (AI-powered)sentry-update-issue- Update issue status, assignee, etc.sentry-resolve-issue- Mark an issue as resolved
Error Analysis
sentry-search-errors- Search for errors in files/projectssentry-search-events- Natural language event search (AI-powered)
Seer AI Integration
sentry-analyze-issue-with-seer- Use Seer AI to analyze issuessentry-get-seer-analysis- Get Seer analysis results
Release & Team Management
sentry-list-releases- List releases for a projectsentry-get-release-details- Get specific release informationsentry-list-teams- List teams in an organization
Read-Only Mode
Enable read-only mode to prevent accidental modifications:
# Environment variable
export SENTRY_READ_ONLY=true
# Or via CLI
pets read-only sentry on
# Or for all pets
pets read-only --global onIn read-only mode, write operations are disabled:
sentry-create-projectsentry-create-dsnsentry-update-issuesentry-resolve-issue
AI-Powered Features
For enhanced search capabilities, add your OpenAI API key:
export OPENAI_API_KEY=your-openai-api-keyThis enables:
sentry-search-issues- Natural language issue searchsentry-search-events- Natural language event search
Self-Hosted Sentry
For self-hosted Sentry instances:
export SENTRY_HOST=your-sentry-instance.comThe plugin will automatically connect to your instance instead of sentry.io.
Schema Examples
List Issues with Filters
{
organizationSlug: "my-org",
projectSlug: "frontend-app",
status: "unresolved",
environment: "production",
limit: 25
}Create New Project
{
name: "my-new-service",
organizationSlug: "my-org",
platform: "node"
}Search Errors in File
{
query: "TypeError",
file: "components/UserProfile.tsx",
projectSlug: "frontend-app",
limit: 10
}Error Handling
All tools return consistent JSON responses:
{
"success": true,
"data": { ... },
"message": "Operation completed"
}Error responses:
{
"success": false,
"error": "Error message",
"details": { ... }
}Troubleshooting
Connection Issues
- Invalid Token: Ensure your Sentry token has all required scopes
- Network Issues: Check firewall and proxy settings
- Self-hosted Sentry: Verify
SENTRY_HOSTis set correctly
AI Features Not Working
- Missing OpenAI Key: Add
OPENAI_API_KEYto environment - Rate Limits: Check OpenAI API usage and limits
- Token Permissions: Ensure Sentry token has required scopes
Read-Only Mode
- Write Operations Failing: Check if read-only mode is enabled
- Disable: Use
pets read-only sentry offor unset environment variable
Development
The plugin uses Sentry's official MCP server at https://mcp.sentry.dev/mcp for all operations. This ensures:
- Reliability: Official API integration maintained by Sentry
- Security: OAuth authentication and secure token handling
- Features: Access to latest Sentry capabilities and Seer AI
- Performance: Optimized for AI interactions and natural language processing
Support
- Sentry Documentation: sentry.io/docs
- MCP Server: github.com/getsentry/sentry-mcp
- Seer AI: docs.sentry.io/product/ai-in-sentry/seer
- OpenPets: github.com/openpets/openpets
