Three layers of streaming support:
chunk) – for large or indefinite response bodies.text/event-stream.Every streamed call emits a start followed by zero or more progress and/or chunk events, then a final (or error). progress conveys semantic milestones (e.g. bytes read, parse steps) separate from raw body chunking.
Trigger: --stream-mode chunk AND (no content-length OR size > threshold) OR explicit force via per-call argument. Non-streamed responses still return full body (subject to size limits).
Events (toolName prefix omitted):
| Event | Payload |
| —– | ——- |
| start | { streamId, totalBytes? } |
| progress | { streamId, receivedBytes, totalBytes? } |
| chunk | { streamId, index, base64, size } |
| final | { streamId, totalBytes, digest? } |
| error | { streamId, message } |
Final tool response returns metadata (not full body) if streamed.
Upstream server-sent events are buffered logically (line-based) and surfaced as an array of { event?, data } objects in the final result. Body streaming still applies if size/threshold conditions met.
Adjust with --stream-threshold <bytes> (default 64KB). --stream-mode options may include auto (default), always, never.
When --sse-fallback is enabled, non-MCP clients can subscribe to an SSE endpoint to receive the same progressive events (serialized JSON per line) – useful for thin HTTP tooling.
In stateless HTTP mode the same progression semantics apply, but no cross-request stream registry is retained after completion.
Next: Metrics and Sampling Helpers.