{
  "schema_version": "1.3.0",
  "slug": "what-structural-signals-indicate-a-mid-stream-resumption-break-when-migrating-mcp-servers-from-sse-to-streamable-http",
  "title": "What structural signals indicate a mid-stream resumption break when migrating MCP servers from SSE to streamable HTTP",
  "date_of_record": "2026 November 27",
  "scope": "Applies to MCP servers migrating from the legacy HTTP+SSE transport (dual-endpoint, `GET /sse` + `POST /messages`) to the streamable HTTP transport (single endpoint, `Accept: application/json, text/event-stream`, optional `Mcp-Session-Id`). Does not cover stdio transport or in-process agent tool binding, where resumption semantics are absent by construction.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-a-mid-stream-resumption-break-when-migrating-mcp-servers-from-sse-to-streamable-http.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-a-mid-stream-resumption-break-when-migrating-mcp-servers-from-sse-to-streamable-http.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-a-mid-stream-resumption-break-when-migrating-mcp-servers-from-sse-to-streamable-http.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1898,
    "python_slice_tokens": 396,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The legacy SSE transport and streamable HTTP transport both *look* like \"the server pushes events to the client over a long-lived connection,\" so migration is often treated as a URL-and-header swap. This is wrong at exactly one point: **the legacy transport gives the client no way to prove it received events 1..N-1 before reconnecting, while streamable HTTP ...",
    "what_was_observed": "A tool-server exposing a long-running `search_and_summarize` tool was migrated from SSE to streamable HTTP. Under the legacy transport, the client opened `GET /sse`, received an `endpoint` event naming a `POST /messages?sessionId=...` URL, and every tool-result chunk arrived as a numbered SSE event. On reconnect (network blip, proxy idle timeout at 60s), the legacy client re-opened `GET /sse` and the server, having n...",
    "condition_of_validity": "The invariant that bounds this failure: **for any streamable-HTTP MCP server, if the server emits `id:` on any event, it MUST either (a) honor `Last-Event-ID` by resuming strictly after that ID, or (b) reject the resumption with a protocol-visible error and force the client to re-initialize the session.** A server that emits IDs but ignores `Last-Event-ID` v...",
    "decision_boundary": "The boundary is crossed at the moment the server's stream handler is written to emit `id:` without a corresponding branch on `Last-Event-ID`. Concretely: - **Below the boundary (safe):** server emits no `id:`, client re-initializes on every reconnect, `Mcp-Session-Id` is rotated on each `POST /mcp` that opens a stream. Duplicate tool execution is possible bu...",
    "operational_effect": "The downstream effect is **silent duplicate-application of streamed deltas**, which manifests as one of three symptoms depending on the client's accumulator: 1. **JSON argument corruption** — partial tool-argument buffers concatenated with their own replay, producing parse errors attributed to the wrong cause. 2. **Token/count inflation** — streaming text de..."
  },
  "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": "ebd2e5cd6081b0df852053a64cbaf1162bf4f4e5ed68eeea845803feed000459",
    "verified_classes": [
      "ResumptionContractViolation"
    ],
    "verified_functions": [
      "resume_stream",
      "client_apply_event"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "ResumptionContractViolation"
    ],
    "sample_fail_closed_invariants": [
      "streamable HTTP POST /mcp opened a stream without Mcp-Session-Id; client cannot reconcile state across reconnects"
    ],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
