Skip to main content

What You'll Build

An automated error monitoring system that uses Gobi CLI with Sentry MCP to analyze production errors, identify root causes with AI, and create detailed GitHub issues with suggested fixes.

What You’ll Learn

This cookbook teaches you to:
  • Use Sentry MCP to access issues
  • Analyze error patterns and stack traces with AI
  • Automatically create GitHub issues with root cause analysis
  • Set up continuous error monitoring with GitHub Actions

Prerequisites

Before starting, ensure you have:
  • GitHub repository where you want to create issues
  • Sentry account with an active project collecting errors
  • Node.js 18+ installed locally
  • Gobi CLI with active credits (required for API usage)
  • GitHub CLI installed (gh command)
1

Install Gobi CLI

2

Set up Gobi CLI Account & API Key

  1. Visit Gobi Organizations
  2. Sign up or log in to your Gobi account
  3. Navigate to your organization settings
  4. Click “API Keys” and then ”+ New API Key”
  5. Copy the API key immediately (you won’t see it again!)
  6. Login to the CLI: cn login
Gobi CLI handles complex error analysis and API interactions - you just need to provide the right prompts!

Step 1: Set Up Your Credentials

First, you’ll need to gather your Sentry and GitHub API credentials.
See Sentry MCP Documentation for detailed configuration options
The Sentry MCP supports multiple configuration methods. For Gobi CLI, OAuth is recommended:Option 1: OAuth Configuration (Recommended)The Sentry MCP will prompt for OAuth authentication when first used. Simply follow the authorization flow.Option 2: STDIO Mode with Auth TokenFor local development or self-hosted Sentry installations, you can use STDIO mode:
Or use environment variables:
The --host parameter is required and should point to your Sentry instance (e.g., sentry.io or sentry.example.com for self-hosted).

Sentry Error Monitoring Workflow Options

Fastest Path to Success

Skip the manual setup and use our pre-built Sentry Continuous AI agent that includes optimized prompts, rules, and the Sentry MCP for more consistent results.
How Sentry MCP Works:
  • Connects to your Sentry organization via OAuth
  • Provides tools for accessing issues, projects, teams, and DSNs
  • Supports both hosted (https://mcp.sentry.dev) and self-hosted Sentry instances
  • Automatically handles authentication and API interactions
Why GitHub CLI over GitHub MCP: While GitHub MCP is available, it can be token-expensive to run. The gh CLI is more efficient, requires no API tokens (authenticated via gh auth login), and provides a cleaner command-line experience. GitHub MCP remains an option if you prefer full MCP integration.
To use the pre-built agent, you need either:
  • Gobi CLI Pro Plan with the models add-on, OR
  • Your own API keys added to Gobi Hub secrets (same as Step 1)
The agent will automatically detect and use your configuration. For Sentry MCP:
  • Sentry account with at least one project
  • User Auth Token with appropriate scopes (or OAuth flow)
  • The MCP works with both Sentry’s hosted service (sentry.io) and self-hosted instances

Repository Labels Required: Make sure your GitHub repository has these labels:
  • bug, sentry, production
  • critical, high-priority, medium-priority, low-priority
  • needs-investigation, has-fix
Create missing labels in your repo at: Settings → Labels → New label

Step 2: Analyze Sentry Errors with AI

Use Gobi CLI to perform intelligent error analysis. Enter these prompts in the Gobi CLI TUI:
Prompt:
Available Sentry MCP Tools:
  • Organizations: Access org-level data and settings
  • Projects: Query projects and their configurations
  • Issues: Search and analyze error issues
  • Teams: Manage team assignments
  • DSNs: Retrieve project DSN configurations

Step 3: Automate GitHub Issue Creation

Create actionable GitHub issues from Sentry errors. Enter this prompt in the Gobi CLI TUI: Prompt:
Best Practice: Link GitHub issues back to Sentry for full traceability. This creates a bidirectional connection between your error monitoring and issue tracking.

Step 4: Set Up Continuous Monitoring with GitHub Actions

Automate error monitoring with the Sentry Release GitHub Action and Gobi CLI to create comprehensive, AI-powered issue descriptions:
Why Combine Sentry Releases with Gobi CLI?
  • Release Tracking: Associate errors with specific deployments
  • AI-Powered Analysis: Gobi CLI generates detailed issue descriptions with root cause analysis
  • Better Context: Link errors to commits and pull requests
  • Automated Workflows: Create issues with full stack traces and suggested fixes
Required GitHub Secrets:
  • GOBI_API_KEY: Your Gobi API key from hub.gourmand.dev/settings/api-keys
  • SENTRY_AUTH_TOKEN: Your Sentry User Auth Token (needs scopes: org:read, project:read, project:releases, event:read)
  • SENTRY_ORG: Your Sentry organization slug
  • SENTRY_PROJECT: Your Sentry project slug
  • GITHUB_TOKEN: Automatically provided by GitHub Actions
Add these at: Repository Settings → Secrets and variables → Actions
Workflow Best Practices:
  • Run every 6 hours to catch critical errors quickly
  • Create Sentry releases on push to track error-to-deployment correlation
  • Use Gobi CLI to generate comprehensive, AI-powered issue descriptions
  • Use duplicate detection to avoid creating multiple issues for the same error
  • Filter by severity to focus on high-impact issues
  • Include full error context and suggested fixes in issues
  • Tag issues with appropriate labels for team routing
  • Link GitHub issues back to Sentry for bidirectional tracking

What You’ve Built

After completing this guide, you have a complete Sentry-powered error monitoring system that:
  • Monitors production errors - Automatically fetches and analyzes Sentry issues every 6 hours
  • Identifies critical bugs - Uses AI to spot high-impact errors
  • Creates actionable tasks - Generates GitHub issues with root cause analysis and suggested fixes
  • Runs autonomously - Operates continuously without manual intervention using GitHub Actions
  • Scales with your app - Handles growing error volumes and complexity automatically

Continuous AI Error Monitoring

Your system now operates at Level 2 Continuous AI - AI handles routine error analysis with human oversight through GitHub issue review and resolution.

Advanced Error Analysis Prompts

Enhance your workflow with these advanced Gobi CLI prompts:

Release Impact Analysis

Compare error rates before and after the latest Sentry release to identify regressions introduced in the deployment

Error Trend Detection

Analyze Sentry error trends over the past 30 days and identify emerging issues before they become critical

User Impact Assessment

Identify which errors are affecting the most unique users and prioritize fixes based on user impact

Performance Correlation

Cross-reference Sentry performance issues with error spikes to identify root causes

Security Best Practices

Protect Your API Keys:
  • Store all credentials as GitHub Secrets, never in code
  • Use Gobi CLI’s secure secret storage
  • Limit Sentry token scopes to minimum required permissions
  • Rotate API keys regularly (every 90 days recommended)
  • Monitor token usage for unusual activity
  • Use OAuth when possible for better security

Troubleshooting

Sentry MCP Connection Issues

If you encounter connection issues:
  1. Verify OAuth authentication is complete
  2. Check your Sentry organization access
  3. Ensure the MCP server URL is correct (https://mcp.sentry.dev/mcp)
  4. For self-hosted Sentry, verify your host URL is configured correctly
See the Sentry MCP GitHub Issues for known issues and solutions.

Common Error Analysis Issues

Next Steps

Resources