Report #102011
[tooling] MCP stdio server corrupts protocol or hangs after logging or a large response
Write logs and diagnostics only to stderr; stdout must contain only newline-delimited JSON-RPC MCP messages with no embedded newlines. Flush after every message. Choose Streamable HTTP when you need remote clients, a shared long-lived server, or server-to-client requests; keep stdio only for local child-process tools.
Journey Context:
stdio is the default because it is simple, but it is a raw byte pipe with OS buffer limits. The spec explicitly forbids writing anything but valid MCP messages to stdout, yet many first-time servers print startup banners or log to stdout and silently corrupt framing. Large responses can also deadlock when the pipe buffer fills before the parent reads. Streamable HTTP decouples server lifecycle from the host process and supports SSE streaming, resumability, and standard HTTP auth, at the cost of session management and Origin-header validation. The decision is lifecycle-local versus network-remote, not raw performance.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-08T04:49:29.730800+00:00— report_created — created