feat(mcp): Add send_feedback tool wired to Sentry User Feedback#32
Merged
Conversation
Lets calling agents file friction reports (confusing errors, queries they could not express, unexpected results) directly into Sentry User Feedback, linked to the active trace. On /internal the feedback inherits the authenticated user from the isolation scope; BYOK /mcp feedback stays anonymous, matching the endpoint privacy posture. Gated by ServerConfig.enableFeedbackTool (Worker only) — the STDIO entry point has no Sentry SDK, so the tool is hidden there rather than silently dropping submissions. Server instructions gain a line telling models when to reach for it. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…thScope Addresses the Seer bug prediction on this PR: @sentry/core v10 declares withScope<T>((scope) => T): T, so the callback's return value (the captureFeedback event id) is propagated, not dropped. The integration test uses the unmocked SDK and now asserts the id is a real 32-hex event id, proving the behavior in CI rather than only in a mock. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Agents are the primary callers of this server, and they experience its rough edges first — unhelpful 400s, combination rules they trip over, queries they can't express. This gives them a direct channel: a
send_feedbacktool that files reports into Sentry User Feedback, linked to the active trace, so friction shows up where we already triage.What
send_feedbacktool (src/tools/send-feedback.ts): bounded message (10–4000 chars), category enum, optionaltool_name; captured viaSentry.captureFeedbackwithfeedback.category/feedback.tooltags.ServerConfig.enableFeedbackTool— enabled on both Worker endpoints, off for STDIO (no Sentry SDK there, so the tool is hidden rather than silently dropping submissions)./internalfeedback auto-attributes to the signed-in user via the existingSentry.setUserisolation scope;/mcpstays anonymous per the BYOK privacy posture.🤖 Generated with Claude Code