{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-treat-mcp-streamable-http-session-resumption-as-a-re-attachment-to-a-logical-stream-rather-than-a-replay-of-transpo",
  "title": "In what scenarios must an instance treat MCP Streamable HTTP session resumption as a re-attachment to a logical stream rather than a replay of transport bytes",
  "date_of_record": "2026 November 10",
  "scope": "Applies to MCP servers and clients using the Streamable HTTP transport (HTTP POST for client→server messages, optional SSE for server→client streaming) with `Mcp-Session-Id` and `Last-Event-ID` based resumption. Does not apply to stdio transport, nor to deployments where the server never emits SSE frames (pure request/response POST handlers with no long-lived stream), nor to legacy HTTP+SSE dual-endpoint transports.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-mcp-streamable-http-session-resumption-as-a-re-attachment-to-a-logical-stream-rather-than-a-replay-of-transpo.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-mcp-streamable-http-session-resumption-as-a-re-attachment-to-a-logical-stream-rather-than-a-replay-of-transpo.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-mcp-streamable-http-session-resumption-as-a-re-attachment-to-a-logical-stream-rather-than-a-replay-of-transpo.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2215,
    "python_slice_tokens": 450,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The MCP Streamable HTTP specification borrows two idioms from HTTP that are *not* equivalent, and the failure mode lives in the gap between them: 1. **Session identity** (`Mcp-Session-Id` header) is an opaque, server-issued handle that scopes *logical* state: which client this is, which initialized capabilities apply, and which in-flight tool calls belong to...",
    "what_was_observed": "Across several MCP server implementations (a Python/FastAPI server fronting a tool-execution agent, and a Go server fronting a retrieval service), the following sequence reproduced a class of silent corruption: - Client opens `POST /mcp` with `Accept: application/json, text/event-stream`, receives `200` with an SSE stream and `Mcp-Session-Id: S1`. - Server emits events with `id:` fields `e1, e2, e3` carrying JSON-RPC...",
    "condition_of_validity": "The re-attachment model is valid — and the replay model is invalid — under the following jointly sufficient conditions: - The client has processed at least one event from the prior stream and has acknowledged it out-of-band (e.g., by advancing its own pending-request map). The server cannot know this directly; it must infer it from the fact that the client i...",
    "decision_boundary": "The operational decision is: **on a resumption request, does the server replay from `Last-Event-ID`, or does it re-attach and emit only events strictly after the client's acknowledged position?** Choose **re-attach** when: - The server can prove the client's cursor is within the retained window. - The client's request carries a session id that matches an act...",
    "operational_effect": "When the re-attachment model is implemented correctly, three things change measurably: 1. **Duplicate side effects drop to zero** for the resumption path, because the client is never handed an event it has already applied. The cost is a small amount of server-side bookkeeping: a per-session monotonic cursor and a bounded ring buffer of recent events. 2. **Me..."
  },
  "matched_failure_symptoms": [
    "DOMAIN:EPISTEMIC_PROVENANCE_AND_FEDERATION_ROUTING"
  ],
  "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": "76ccb1ce036fae594c07f101f0e1be42271c7980588f7d6aea4e100e3fc84063",
    "verified_classes": [
      "ResumptionCursorError",
      "SessionStream"
    ],
    "verified_functions": [
      "handle_resume",
      "emit",
      "reattach"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 7,
    "raised_exceptions": [
      "ResumptionCursorError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "time"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
