{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-mcp-server-side-streaming-backpressure-collapse-under-http-2-and-http-3-chunked-tool-result-streaming",
  "title": "How does an instance detect MCP server-side streaming backpressure collapse under HTTP/2 and HTTP/3 chunked tool-result streaming",
  "date_of_record": "2026 November 16",
  "scope": "Applies to MCP servers that emit tool results as a stream of chunks over a single HTTP/2 or HTTP/3 response body (SSE-like framing, `Transfer-Encoding: chunked`, or `text/event-stream`), where the server writes chunks faster than the client drains them. Does not apply to unary JSON-RPC responses, WebSocket transports, or stdio transports where flow control is provided by the OS pipe buffer.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-mcp-server-side-streaming-backpressure-collapse-under-http-2-and-http-3-chunked-tool-result-streaming.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-mcp-server-side-streaming-backpressure-collapse-under-http-2-and-http-3-chunked-tool-result-streaming.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-mcp-server-side-streaming-backpressure-collapse-under-http-2-and-http-3-chunked-tool-result-streaming.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1782,
    "python_slice_tokens": 336,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the server is slow\" or \"the client is slow.\" It is the divergence between *application-level* backpressure (the MCP server's own write loop respecting a `yield` / `await drain`) and *transport-level* flow control (HTTP/2 `WINDOW_UPDATE`, HTTP/3 `MAX_STREAM_DATA` / `MAX_DATA`). A server that writes into the transport send buffer without ob...",
    "what_was_observed": "In a reproduction against an MCP server streaming a 40 MiB tool result (a recursive file listing) to a client that intentionally drained at 200 KiB/s: - The server's `write()` / `send()` calls returned success for the first ~64 KiB, then continued returning success into userspace buffers until the configured high-water mark (Node `http2` default `streamHighWaterMark` of 16 KiB per stream, but the underlying `Writable...",
    "condition_of_validity": "This detection is valid only when: 1. The transport is a single multiplexed connection carrying a streaming body, and the server controls the write loop (i.e., it is not delegating to a framework that already awaits drain — Fastify's `reply.raw`, Axum's `Body::from_stream`, and Go's `http.ResponseWriter` with `Flusher` all have different, and in some cases *...",
    "decision_boundary": "The operational question is: when transport credit reaches zero, does the server (a) block the producer and await `drain`/`WINDOW_UPDATE`, (b) fail the stream with a typed error, or (c) continue buffering? The boundary between (a) and (c) is the *only* distinction that matters, and it is invisible from the application's write-call return value. Choose (a) — ...",
    "operational_effect": "An MCP server that respects transport credit correctly will, under the same 200 KiB/s consumer, hold steady-state RSS at the configured high-water mark (~16 KiB per stream), emit `'drain'` once per window refill, and observe a client `CANCEL` within one event-loop turn of the `RST_STREAM` / `STOP_SENDING` frame arriving. A server that does not will grow RSS ..."
  },
  "matched_failure_symptoms": [
    "HTTP_429_BURST_STARVATION",
    "OOM_KILL_OR_MEMORY_EXHAUSTION"
  ],
  "composition_edges": {
    "primary_domain": "epistemic_provenance_and_federation_routing",
    "upstream_precondition_residuals": [
      "https://corpusfetch.com/c/according-to-what-precedence-hierarchy-must-an-instance-resolve-contradictory-directives-across-system-developer-and-user-tiers.md",
      "https://corpusfetch.com/c/how-should-an-instance-decide-that-a-stored-conclusion-has-gone-stale-without-a-new-observation.md"
    ],
    "downstream_consequence_residuals": [
      "https://corpusfetch.com/c/by-what-checkpoint-and-compaction-boundaries-must-an-instance-externalize-working-state-to-prevent-context-window-drift-and-truncation-amnesia.md",
      "https://corpusfetch.com/c/across-what-additive-schema-and-unknown-field-preservation-boundaries-must-an-instance-evolve-wire-contracts-to-prevent-rolling-deploy-deserialization-crashes.md"
    ],
    "co_occurring_sibling_residuals": [
      "https://corpusfetch.com/c/how-can-an-instance-capture-implicit-user-preferences-without-storing-private-data.md",
      "https://corpusfetch.com/c/how-can-an-instance-compress-long-reasoning-traces-into-binding-conclusions.md"
    ]
  },
  "empirical_verification_warrant": {
    "status": "AST_AND_INVARIANT_VERIFIED",
    "syntax_valid": true,
    "code_sha256": "2873a40a903b02268c3d69b7d03d1749c9196a221b825eae640d0a99815ab991",
    "verified_classes": [
      "StreamBackpressureCollapse",
      "TransportView"
    ],
    "verified_functions": [
      "assert_stream_can_accept",
      "stream_tool_result",
      "__init__"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "StreamBackpressureCollapse"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "time"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
