Repository navigation
feat: Attach videos to issue comments from the MCP server and CLI - #2409
Open
nithinrgaddam wants to merge 5 commits into
Open
nithinrgaddam wants to merge 5 commits into
nithinrgaddam wants to merge 5 commits into
Conversation
add_issue_note takes attachmentPaths: local videos uploaded through the issue's comment-attachments endpoint and linked after the note text. Only hosts that provide a readLocalFile reader (the CLI's stdio server) can attach; the hosted server explains that it cannot. Files must have a video extension and start with matching MP4/MOV, WebM or Ogg bytes, so a renamed key or document is never uploaded. get_issue_activity lists the videos attached to each comment with their API URL.
- sentry issue comment <issue> <text> [--attach <video>...] [--dry-run] posts a comment, uploading screen recordings first and linking them. - sentry issue comments <issue> [--download <dir>] lists comments with their videos and can save every video into a directory. - sentry mcp gives mcp-core a local file reader so add_issue_note can attach videos. - The issue/comment fallback to sentry api is gone now that the command exists.
|
@nithinrgaddam is attempting to deploy a commit to the Sentry Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
- sentry mcp reads attachments only from its working directory, after resolving symlinks, so an injected path cannot upload a private video from elsewhere on the machine. - Comment links only match slug-like org and issue segments, and issue comments --download rebuilds each URL from the issue and the numeric attachment ID instead of following the link a commenter wrote.
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 10db0f9. Configure here.
- Listed attachment URLs (issue comments, get_issue_activity, add_issue_note) now come from the issue being read and the attachment ID, the same URL --download fetches, instead of the link a commenter wrote. - issue comments follows the comments endpoint's cursor so issues with more than one page of comments list, and download, all of them.
This branch was previously deployed
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.

Summary
Adds MCP and CLI support for videos attached to issue comments, such as a screen recording of a bug. The backend is getsentry/sentry#131741 and the web UI is getsentry/sentry#131742. This PR depends on the backend endpoints, which are behind the
organizations:issue-comment-attachmentsflag.Key Changes
MCP (
mcp-core)add_issue_notetakes an optionalattachmentPathsinput. Each video is uploaded toPOST /organizations/{org}/issues/{issue}/comment-attachments/and linked after the note text.get_issue_activitylists each comment's attached videos (id,name, APIurl).ServerContext.readLocalFile, following the overview's guidance on file uploads.sentry mcp(stdio) provides it. The hosted server doesn't, so the tool returns aUserInputErrorexplaining it can't attach local files.~/.ssh/id_rsa.mp4is refused before anything is uploaded.sentry mcponly reads attachment files from the directory it was started in, after resolving symlinks. An injected path can't upload a private video from elsewhere on the machine.SentryApiService.uploadIssueCommentAttachmentsends multipart through the transport directly, because the core forces a JSONContent-Type.@sentry/mcp-core/comment-attachments, so the CLI and MCP accept and read the same files.CLI
sentry issue comment <issue> <text> [--attach <video>...] [--dry-run]posts a comment, uploading the videos first.sentry issue comments <issue> [--download <dir>]lists comments with their video URLs. It can also save every video into a directory as<id>-<name>, streamed to disk.--downloadrebuilds each URL from the issue and the numeric attachment ID, and links only match slug-like segments. A link written by another commenter can't point the authenticated download at another API route.issue/commentno longer falls back to asentry apisuggestion, since the command exists now.listIssueComments/createIssueCommentare added toMANUAL_API_REQUEST_EXCEPTIONS.Breaking Changes
None.
attachmentPathsis optional, and theget_issue_activityoutput only gains an optional field.Dependencies
getsentry/sentry#131741 (endpoints, size option and feature flag). Until it ships, uploads return 404 and listing shows no attachments.