Skip to main content

Overview

Sentry is an official MCP integration available in the MCP Marketplace. It uses OAuth authentication, giving Devin access to your Sentry projects so it can query issue details, stack traces, event breadcrumbs, and more. Once connected, you can set up automated error triage through webhooks or schedule recurring remediation sessions that process Sentry errors in batch.

Enable the Sentry MCP

1

Open the MCP Marketplace

Go to Settings > MCP Marketplace and find Sentry.
2

Complete the OAuth flow

Click Enable and authenticate with the Sentry account that has access to your projects. This grants Devin read access to your Sentry issues, events, and stack traces.
3

Verify the connection

Test the connection by starting a session and asking Devin to list recent issues in one of your projects. You can also click Test listing tools in the MCP Marketplace to confirm connectivity.

Capabilities

Once the Sentry MCP is enabled, Devin can perform the following actions within any session:
CapabilityDescription
Query issue detailsView issue metadata, status, assignment, and event counts
Pull full stack tracesAccess complete stack traces for any event
Read event breadcrumbsView user actions and system events leading up to an error
Inspect release tagsCheck which release introduced or resolved an issue
Update issue statusMark issues as resolved, ignored, or assign to team members
Manage assignments and tagsUpdate issue assignments, tags, and bookmarks
Configure alertsView and manage alert rules and notification settings

Auto-Triage Pipeline (Webhook-driven)

You can wire Sentry alerts directly to Devin so that new production errors are triaged automatically. This uses a Sentry Internal Integration to deliver webhooks to a bridge service that calls the Devin API.
1

Create a Sentry Internal Integration

In your Sentry dashboard, go to Settings > Developer Settings > Custom Integrations and click Create New Integration > Internal Integration.Configure it:
  • Name: Devin Auto-Triage
  • Webhook URL: The endpoint for your bridge service (e.g., https://your-domain.com/sentry-webhook)
  • Alert Rule Action: Toggle on — this makes the integration available as an action in alert rules
  • Permissions: Read access to Issue & Event and Project
2

Create an alert rule

Go to Alerts > Create Alert Rule > Issue Alert for your project:
  • When: A new issue is created
  • If: The issue has more than 50 events in 1 hour (adjust to your traffic)
  • Then: Send a notification via Devin Auto-Triage
3

Deploy a webhook handler

Build a small handler that receives Sentry’s alert payload and starts a Devin session. Create a service user in Settings > Service Users with ManageOrgSessions permission (add ViewOrgSessions too if you want to list or filter sessions via the API). Store the API token as DEVIN_API_KEY, your organization ID as DEVIN_ORG_ID, and your Sentry Internal Integration’s Client Secret as SENTRY_CLIENT_SECRET in your handler’s environment.
const express = require('express');
const crypto = require('crypto');
const app = express();
app.use(express.json({
  verify: (req, _res, buf) => { req.rawBody = buf; },
}));

function verifySignature(req) {
  const signature = req.headers['sentry-hook-signature'];
  if (!signature) return false;
  const expected = crypto
    .createHmac('sha256', process.env.SENTRY_CLIENT_SECRET)
    .update(req.rawBody)
    .digest('hex');
  if (signature.length !== expected.length) return false;
  return crypto.timingSafeEqual(Buffer.from(signature), Buffer.from(expected));
}

app.post('/sentry-webhook', async (req, res) => {
  if (!verifySignature(req)) return res.status(401).send('Bad signature');

  const event = req.body.data?.event;
  if (!event) return res.sendStatus(200);

  const orgId = process.env.DEVIN_ORG_ID;
  const response = await fetch(
    `https://api.devin.ai/v3/organizations/${orgId}/sessions`, {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${process.env.DEVIN_API_KEY}`,
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      prompt: [
        `A Sentry alert fired for a new issue: "${event.title}"`,
        `Culprit: ${event.culprit}`,
        `Sentry URL: ${event.web_url}`,
        ``,
        `Use the Sentry MCP to pull the full stack trace and breadcrumbs.`,
        `Identify the root cause, fix the issue, and open a PR with a`,
        `regression test.`,
      ].join('\n'),
      tags: ['sentry-auto-triage', `project:${event.project}`],
    }),
  });

  const { session_id } = await response.json();
  console.log(`Started Devin session ${session_id} for: ${event.title}`);
  res.sendStatus(200);
});

app.listen(3000);
Deploy this anywhere that can receive HTTPS traffic — a Cloudflare Worker, AWS Lambda, or a small VPS. Point your Sentry Internal Integration’s webhook URL to it.
4

Test the pipeline

Trigger a test alert in Sentry (or lower your threshold temporarily), then check app.devin.ai for a new session tagged sentry-auto-triage.
The code above tags each session with sentry-auto-triage and the Sentry project name. This lets you filter these sessions in the Devin dashboard and pull them via the API using the tags query parameter. Listing sessions requires the ViewOrgSessions permission on your service user — see the API overview for the full permissions table.

Scheduled Batch Remediation

Instead of reacting to individual alerts, you can schedule a recurring Devin session that pulls unresolved Sentry errors in batch and spawns fix sessions for each one.
1

Create a schedule

Go to Settings > Schedules and click Create schedule.
  • Name: Daily Sentry remediation
  • Frequency: Daily at 6:00 AM (so fix PRs are ready before standup)
  • Agent: Devin — this lets Devin spawn a separate session for each error, so fixes run in parallel
  • Prompt:
Use the Sentry MCP to pull all unresolved errors from the past
24 hours in the payments-api project, sorted by event count.
Skip errors tagged `wontfix` or `expected-behavior`.

For the top 5 errors:
1. Pull the full stack trace and breadcrumbs
2. Find the relevant source files in our repo
3. Identify the root cause
4. Start a Devin session to open a PR with a fix and a regression
   test, linking the Sentry issue URL in the PR description

Post a summary of all errors and their PRs to Slack.
2

Review and iterate

After a week of runs, adjust the scope:
  • Increase or decrease the error count based on how many fixes are mergeable
  • Filter by project or tag to focus on specific areas of your codebase
  • Add Knowledge about your error-handling conventions so Devin’s fixes match your team’s patterns
Combine webhook-driven triage for high-impact errors (50+ events/hour) with scheduled batch remediation for the long tail of lower-frequency issues. This ensures both urgent and ongoing errors are addressed.