Skip to content

wip: add event attachment download support#346

Closed
seanhoughton wants to merge 1 commit into
getsentry:mainfrom
seanhoughton:feat/attachments
Closed

wip: add event attachment download support#346
seanhoughton wants to merge 1 commit into
getsentry:mainfrom
seanhoughton:feat/attachments

Conversation

@seanhoughton

Copy link
Copy Markdown
Contributor

Attachments can be listed and downloaded. Text attachments are returned inline with the text response. Binary attachments are included as embedded resource.

This is a prototype implementation to address my feature request: #314. It works very well for small-ish text attachments. I think we should consider a size limit and just return the download URL for anything larger than that limit.

I'm also wondering of we should detect image types and return them as type: "image" content blocks.

I've discovered that VSCode does allow you to download embedded resources, but it's a tiny button that's hidden unless you expand the results of a tool execution. It does not allow you to save the resource to disk as part of the chat.

@seanhoughton seanhoughton force-pushed the feat/attachments branch 2 times, most recently from 379b7d4 to 7bcabc8 Compare July 3, 2025 04:04
Comment thread packages/mcp-server/src/tools.ts Outdated
Comment thread packages/mcp-server/src/tools.ts Outdated
Comment thread packages/mcp-server/tsconfig.json Outdated
@codecov

codecov Bot commented Jul 7, 2025

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 38.39286% with 138 lines in your changes missing coverage. Please review.

Project coverage is 58.32%. Comparing base (801f2e6) to head (6b909e5).
Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
packages/mcp-server/src/tools.ts 30.20% 67 Missing ⚠️
packages/mcp-server/src/api-client/client.ts 3.50% 55 Missing ⚠️
packages/mcp-server/src/server.ts 0.00% 16 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #346      +/-   ##
==========================================
- Coverage   59.37%   58.32%   -1.05%     
==========================================
  Files          49       49              
  Lines        6038     6263     +225     
  Branches      472      470       -2     
==========================================
+ Hits         3585     3653      +68     
- Misses       2453     2610     +157     
Flag Coverage Δ
unittests 58.32% <38.39%> (-1.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Attachments can be listed and downloaded. Text attachments are returned inline with the text response. Binary attachments are included as embedded resource or image content
@seanhoughton

Copy link
Copy Markdown
Contributor Author

The initial PR was pretty rough so I've made a few improvements in the code structure and added support for ImageContent responses. VSCode handles images and binary data and lets you save the files manually - it's not the greatest user experience, but once you learn where it is then it's not too bad.

image-example

@dcramer

dcramer commented Jul 8, 2025

Copy link
Copy Markdown
Member

will work on getting this merged after i land #356

@dcramer

dcramer commented Jul 8, 2025

Copy link
Copy Markdown
Member

Alright merged in #358. Thanks @seanhoughton!

@dcramer dcramer closed this Jul 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants