← Back to Cookbook

Auto-triage and fix User Feedback with Cursor Automations and Sentry MCP

Trigger a Cursor agent the moment user feedback is assigned in Sentry. It reads the issue, finds the relevant code, and opens a PR.

Features
Category Workflow
Time
20–30 minutes
Difficulty
Intermediate
Steps
6 steps

Before you start

SDKs & packages
Accounts & access
Knowledge
  • Basic familiarity with your app's codebase and repo structure

1
Add the User Feedback widget to your app

Sentry's User Feedback widget gives users a simple way to report problems directly from your UI. When submitted, feedback appears as an issue in your Sentry project, complete with session context, tags, and optional replay links. Add the widget using the Sentry SDK's feedbackIntegration. Configure it to match your app's look and feel, and it will attach automatically to your Sentry initialization.

User Feedback setup guide
import * as Sentry from "@sentry/browser";

Sentry.init({
  dsn: "your-dsn-here",
  integrations: [
    Sentry.feedbackIntegration({
      colorScheme: "system",
      showBranding: false,
    }),
  ],
});

2
Add the Sentry MCP to your automation

The Sentry MCP server gives your Cursor agent direct access to your Sentry issues, feedback, and debugging context. You add and authenticate it from within the automation's Tools section on cursor.com/automations — it isn't configured in the Cursor desktop app.

  • Go to cursor.com/automations and click New automation (you'll finish configuring it in Step 4)
  • In the Tools section, click + Add Tool or MCP
  • Expand MCP Server and click + New Connection
  • In the Browse MCPs dialog, search for Sentry and select the Sentry plugin to add it
  • Back in Tools, click Authenticate on the Sentry row to launch the Sentry OAuth consent screen
  • On the *Cursor is requesting access to Sentry* screen, enable at minimum Inspect Issues & Events (to read feedback and issue details) and Triage Issues (so the agent can comment on the Sentry issue), then click Approve
Sentry MCP Server docs
The Sentry OAuth consent screen shown after clicking Authenticate, with Inspect Issues & Events and Triage Issues scopes enabled and an Approve button

3
Write the agent instructions

Agent instructions are the prompt your Cursor Automation runs with. They tell the agent what to do when the trigger fires: fetch the feedback from Sentry, find the relevant code, and attempt a fix. Copy the template below and adjust the bracketed placeholders for your project. You'll paste this into the Instructions field in the next step.

You are a user feedback analyst for [your-app]. You run when a Sentry User Feedback issue is assigned in the "[project]" project.

## Step 1: Gather context from Sentry

Use @Sentry MCP to fetch the assigned issue. Extract:
- The feedback message
- The page or feature the user was interacting with (from tags/context)
- Any additional context (browser, session replay link)
- Only proceed if the issue is a User Feedback type issue

## Step 2: Identify and read the relevant code

Map the feedback to a file or component in the repo:
- Use the page URL, feature name, or error context as clues
- Search the codebase if the mapping isn't obvious

Read the relevant files to understand what the user experienced.

## Step 3: Assess and fix

Determine if you can fix this with a code change. You CAN fix it if:
- It's a UI bug, copy error, or behavioral issue you can identify in the code
- You've read the relevant files and know exactly what to change
- No unverifiable assumptions are needed
- The fix is scoped to 1–3 files

If you can't fix it confidently, skip to Step 5.

## Step 4: Open a PR

- Branch: feedback/<short-description>
- Minimal edits only — match surrounding code style
- PR title: fix: <what changed> (under 70 chars)
- PR body: summarize the user feedback and what you changed

## Step 5: Comment on the Sentry issue

Use @Sentry MCP to add a comment on the issue with:
- A link to the PR (if opened)
- OR what needs changing and why it needs a human

## Rules

- Be conservative — prefer commenting in Sentry over opening a speculative PR
- Never add features or refactor surrounding code
- Scope every change to exactly what the feedback describes

4
Configure the trigger and launch the automation

Cursor Automations are background agents that fire automatically based on a trigger. Back in the automation you started in Step 2 on cursor.com/automations, wire up the Sentry trigger, paste your instructions, and launch it. Sentry's available triggers are Issue created, Issue updated, and Any issue event — assignments come through as issue updates, so you'll use Issue updated and let the agent's instructions filter for the assignment case.

  • Name the automation (e.g. "Fix User Feedback")
  • Under Triggers, add Issue updated → select your Sentry project
  • Confirm Tools has Sentry (from Step 2), and add Open Pull Request
  • Paste your instructions from Step 3 into the Instructions field
  • Keep Environment set to *Cursor Cloud* so the agent runs without your machine being on
  • Click Create to launch the automation
Cursor Automations docs
An automation on cursor.com/automations with an Issue updated trigger for a Sentry project, Open Pull Request and Sentry tools enabled, and Environment set to Cursor Cloud

5
Trigger the automation with a real feedback issue

With the automation live, test it end-to-end. The agent will fetch the issue context from Sentry, read the relevant code, and either open a PR or leave a comment explaining why it passed.

  • Submit feedback through your app's User Feedback widget
  • In Sentry, navigate to Issues → User Feedback
  • Assign the feedback issue to any team member
  • In your newly created automation, switch to the Run History tab at the top to watch the agent spin up
The Sentry User Feedback widget open on a demo app, showing a Report a Bug form with name, email, description, and screenshot fields

6
Review the agent's output

When the agent opens a PR, treat it like any other code review. For feedback the agent couldn't fix, the Sentry issue comment will explain what it found and why it passed, giving your team a head start on triaging manually.

  • Check the diff to confirm the change matches the feedback description
  • Read the PR body: the agent should explain what feedback it addressed and what it changed
  • Run your test suite before merging
  • If the fix is wrong or too broad, close the PR and tighten the agent instructions

That's it.

Your agent handles the first response.

When user feedback lands in Sentry and gets assigned, a Cursor agent investigates the root cause and opens a draft PR, so your team reviews fixes, not raw complaints.

  • Configured the Sentry User Feedback widget to collect structured feedback
  • Connected Sentry MCP to Cursor for in-agent issue access
  • Created a Cursor Automation that responds to Sentry issue assignment
  • Wrote agent instructions that triage feedback and open a fix PR

Pro tips

  • 💡 Scope your Sentry project trigger narrowly: create one automation per project so each agent has the right codebase context and instructions.
  • 💡 Add a validation step at the top of your instructions that checks the issue type first. If it's not User Feedback, the agent should exit early rather than wasting a run on an unrelated issue.
  • 💡 Include a brief map of your repo structure or key component directories in the agent instructions so it knows where to look without searching the entire codebase on every run.
  • 💡 Use Sentry's Alert Rules to automatically assign incoming User Feedback issues to a team. This way the automation fires without any manual triage step.

Common pitfalls

  • ⚠️ Forgetting to approve the right OAuth scopes when authenticating Sentry in Step 2. Without Inspect Issues & Events, the agent can't read the feedback details; without Triage Issues, it can't comment back on the Sentry issue.
  • ⚠️ Writing agent instructions that are too broad, or not scoping the trigger to User Feedback issues. The agent will spin up for every assignment in the project and make speculative changes. Add explicit rules about what issue types it should handle and what it is and isn't allowed to touch.
  • ⚠️ Not testing the full end-to-end flow before relying on the automation. The widget submission, Sentry issue creation, Issue updated trigger, and Cursor agent response all need to be verified together.

Frequently asked questions

The User Feedback widget is available for JavaScript/browser SDKs. For mobile or backend SDKs, you can use the User Feedback API to submit feedback programmatically and it will still appear as an assignable issue in Sentry.

Yes. Cursor Automations and Background Agents require a Cursor Pro or Business subscription. Check Cursor's pricing page for the latest plan details.

Close it and leave a comment explaining what was wrong. This helps you refine your agent instructions over time. Adding a rule like "if in doubt, comment on the Sentry issue instead of opening a PR" makes the agent more conservative by default.

Yes. You can change the Cursor Automation trigger to fire on any Sentry issue assignment: error issues, performance issues, or cron failures. Adjust the agent instructions to match the issue type you want to handle.

The Sentry MCP server is free to use and doesn't count against your Sentry event quota. It only reads data you already have in Sentry.

Fix it, don't observe it.

Get started with the only application monitoring platform that empowers developers to fix application problems without compromising on velocity.