get_event_attachment inlines files up to 30 MiB, which can drop the transport

Offen
#2,508 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
48/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
typescript

Rechercherichtung

Start with packages/mcp-core/src/api-client/client.ts around the inline attachment size cap and download handling, then read tools/catalog/get-event-attachment.ts for the tool schema and response. Check how the tool can return a link without buffering a large file and how its tests cover inline and oversized attachments. Done means callers can get a usable result for large attachments without the transport closing; the reported client limit and memory impact are still unverified.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

MCP mcp-feedback-pattern

Pattern: get_event_attachment returns any attachment up to 30 MiB inline as a base64 blob in one JSON-RPC result, and a caller has no way to ask for a link instead. For a ~22 MiB file the client's transport closed before it got a usable result.

Reports: 1 (MCP user feedback MCP-SERVER-GW8, get_event_attachment, server 0.42.0, Codex over HTTP, kind=broken, impact=blocked). Customer identifiers are left out on purpose; the internal feedback log has them.

What happened: listing an event's attachments worked. Downloading a 23,439,996-byte .tar.gz closed the transport before the client got either the embedded resource or a download link. Sampled server spans for those calls are all ok: the attachment list GET and the ?download=1 GET returned 200 and the tools/call span finished in ~1.2 s, so the handler completed and the failure came after the result left it.

Cause (code verified, transport side inferred):

  • The inline cap is DEFAULT_MAX_INLINE_ATTACHMENT_BYTES = 30 * 1024 * 1024, sized for the Worker's 128 MB isolate, not for what MCP clients accept (packages/mcp-core/src/api-client/client.ts:372-378 @ 0c6b028).
  • Only attachments over that cap skip the download and return a presigned link (client.ts:4160-4171, tools/catalog/get-event-attachment.ts:124-134). A 22.4 MiB file falls under it, so the bytes are buffered (client.ts:4192) and returned as a ~31 MB base64 EmbeddedResource (get-event-attachment.ts:147-166).
  • The input schema has only attachmentId to pick a file; nothing requests metadata or a link only (get-event-attachment.ts:91-101).
  • Sentry already answers ?download=1 for objectstore attachments with a redirect to a presigned URL (getsentry/sentry src/sentry/api/endpoints/event_attachment_details.py:124 @ 0d74e59b939), which the oversized path uses via resolveDirectDownloadUrl.

Not checked: the client-side error and the client's maximum message size, so it's inferred, not confirmed, that the result size closed the transport. I also didn't check whether the Worker came close to its memory limit while serializing the result. Related but different: the "hosted MCP connection dropped mid-call" reports were transient and worked on retry; this one is size-dependent.

via automation evt_905b9c478746fd9deeb853f85ad7441b · Run ID dispatch_18245721458ab109a53742963df57e13.

--

View Session [Sentry]

Vorherrschende Sprache
TypeScript
Sterne
975
Forks
189
Ø Merge
19 Std. 57 Min.
Gemergte PRs (30 T.)
542

Entwicklungsumgebung

Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus getsentry/toolkit

Alle Issues in getsentry/toolkit

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.