Skip to content

feat: Attach videos to issue comments from the MCP server and CLI - #2409

Open
nithinrgaddam wants to merge 5 commits into
getsentry:mainfrom
nithinrgaddam:issue-comment-video-attachments
Open

nithinrgaddam wants to merge 5 commits into
getsentry:mainfrom
nithinrgaddam:issue-comment-video-attachments

Conversation

@nithinrgaddam

@nithinrgaddam nithinrgaddam commented Nov 19, 2026 •

Copy link
Copy Markdown

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-attachments flag.

Key Changes

MCP (mcp-core)

  • add_issue_note takes an optional attachmentPaths input. Each video is uploaded to POST /organizations/{org}/issues/{issue}/comment-attachments/ and linked after the note text.
  • get_issue_activity lists each comment's attached videos (id, name, API url).
  • Local file access is a new host-injected capability, ServerContext.readLocalFile, following the overview's guidance on file uploads. sentry mcp (stdio) provides it. The hosted server doesn't, so the tool returns a UserInputError explaining it can't attach local files.
  • Both the extension and the leading bytes must be MP4/MOV, WebM or Ogg. A prompt-injected path like ~/.ssh/id_rsa.mp4 is refused before anything is uploaded.
  • sentry mcp only 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.uploadIssueCommentAttachment sends multipart through the transport directly, because the core forces a JSON Content-Type.
  • The shared helpers (type check, link building and parsing) are in @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.
  • --download rebuilds 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/comment no longer falls back to a sentry api suggestion, since the command exists now.
  • The comment routes aren't in the public API schema, so listIssueComments/createIssueComment are added to MANUAL_API_REQUEST_EXCEPTIONS.

Breaking Changes

None. attachmentPaths is optional, and the get_issue_activity output 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.

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
nithinrgaddam requested a review from a team as a code owner November 19, 2026 01:18
@vercel

vercel Bot commented Nov 19, 2026

Copy link
Copy Markdown

@nithinrgaddam is attempting to deploy a commit to the Sentry Team on Vercel.

A member of the Team first needs to authorize it.

@vercel
vercel Bot temporarily deployed to Preview – sentry-local November 19, 2026 01:18 Inactive
@vercel

vercel Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
sentry-local Skipped Skipped Nov 19, 2026 2:20am UTC

Request Review

- 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.
@vercel
vercel Bot temporarily deployed to Preview – sentry-local November 19, 2026 01:21 Inactive

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ 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.
@vercel
vercel Bot temporarily deployed to Preview – sentry-local November 19, 2026 01:37 Inactive
@vercel
vercel Bot temporarily deployed to Preview – sentry-local November 19, 2026 02:20 Inactive

This branch was previously deployed

1 inactive deployment
Preview – sentry-local — 4fd54aae Deployed Nov 19, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant