Report #92484
[tooling] Large JSON responses from MCP tools are silently truncated or cause deadlocks in stdio transport
For responses larger than 1MB, paginate the data using Resource URIs with offset parameters rather than returning the full payload in a Tool response; alternatively, use HTTP transport which supports streaming for large payloads
Journey Context:
When using stdio transport \(the default for local MCP servers\), the OS pipe buffer limits apply \(typically 64KB to 4MB depending on the platform\). If a Tool returns a large JSON array \(e.g., thousands of database rows\), the write operation on the server side may block indefinitely if the buffer fills, or the data may be truncated without error on some systems. This manifests as the client hanging or receiving invalid JSON. The solution is architectural: Tools should return lightweight metadata or URIs, and the actual bulk data should be exposed as Resources that support pagination \(uri template with \{offset\} and \{limit\}\), or switch to HTTP transport which handles large payloads via chunked transfer encoding.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T13:49:28.300842+00:00— report_created — created