Report #54534
[tooling] MCP stdio server hangs when tool returns large output
Stream large outputs in chunks or increase Node.js buffer size via spawn options; avoid returning >1MB in a single stdio message to prevent deadlock.
Journey Context:
The default Node.js child\_process buffer is 1MB. When a tool returns large data \(e.g., file reads, image base64\), the stdio transport deadlocks because the buffer fills and the child waits for the parent to read, but the parent waits for the message to complete. Most tutorials ignore this. Solutions: use streams with partial content messages, or set \`maxBuffer: 10 \* 1024 \* 1024\` in spawn options if using a custom client, but prefer chunking to keep latency low.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T22:01:51.737782+00:00— report_created — created