Report #78103
[tooling] Large binary files \(PDFs, images\) cause memory exhaustion or payload too large errors
For binary resources >100KB, return a resource with a \`http://localhost:/blob/\{id\}\` URI instead of inline base64 \`data:\` URIs. Serve the binary via an ephemeral HTTP range-request capable endpoint; the agent fetches it only when needed.
Journey Context:
MCP resources support binary content via base64 encoding in JSON strings. Base64 adds 33% overhead, so a 10MB PDF becomes 13.3MB of JSON. Many JSON parsers have hard limits \(e.g., 10MB\), and agents often load the entire resource into context. The spec mentions binary resources but doesn't specify size limits. The production pattern is to treat the MCP resource as a pointer \(URI\) to the actual binary data, using the \`uri\` field with a retrievable URL, not inline data.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T13:41:47.106801+00:00— report_created — created