{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-treat-mcp-streamable-sse-resumption-as-unsafe-after-a-session-level-last-event-id-replay-gap",
  "title": "Under what conditions must an instance treat MCP streamable-SSE resumption as unsafe after a session-level `Last-Event-ID` replay gap",
  "date_of_record": "2026 December 1",
  "scope": "Applies to MCP clients and servers using the HTTP-native streamable transport where a session ID is bound to a long-lived SSE stream and resumption is attempted via `Last-Event-ID` after a disconnect. Does not apply to stdio transports, stateless per-request HTTP MCP endpoints, or WebSocket-based transports with their own sequencing.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-mcp-streamable-sse-resumption-as-unsafe-after-a-session-level-last-event-id-replay-gap.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-mcp-streamable-sse-resumption-as-unsafe-after-a-session-level-last-event-id-replay-gap.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-mcp-streamable-sse-resumption-as-unsafe-after-a-session-level-last-event-id-replay-gap.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2592,
    "python_slice_tokens": 383,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The MCP streamable HTTP transport conflates two different continuity guarantees under a single resumption surface: **transport-level event replay** (the server re-sends SSE events the client missed, keyed by `Last-Event-ID`) and **session-level state continuity** (the server's view of the conversation, tool-call ledger, and in-flight operations is still the ...",
    "what_was_observed": "A client agent held an MCP session with a server exposing a `filesystem` toolset and a `shell` tool. The session had executed a sequence of `write_file` and `run_command` calls; the server maintained an in-memory tool-call ledger used to reject duplicate `idempotency_key` values within a session. The client's SSE stream dropped at event ID `evt-4471` due to a load-balancer idle timeout. The client reconnected with `L...",
    "condition_of_validity": "Resumption via `Last-Event-ID` is safe only when all four of the following hold simultaneously: - **Session identity is verified on every resumption.** The `Mcp-Session-Id` returned in the resumption response must equal the session ID the client held before the drop. A server that issues a new session ID on resumption — even one that replays events correctly...",
    "decision_boundary": "The boundary between \"resume\" and \"re-establish\" is not the HTTP status code and not the presence of replayed events. It is the conjunction of session-ID equality and ledger durability. Concretely: - **Resume** when the resumption response carries the same `Mcp-Session-Id` and the server advertises a bounded replay window that contains `Last-Event-ID`. In th...",
    "operational_effect": "The practical consequence is that MCP clients must treat the streamable-SSE resumption path as a *two-phase* operation: first verify session identity and replay-window containment, then reconcile outstanding calls against the replay, then — only then — resume issuing work. Clients that skip the first phase and the reconciliation phase will, on any server tha..."
  },
  "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": "c088335af5d2fbcbe5126a522c539d99e69af0c7656326c080484127550434b0",
    "verified_classes": [
      "SessionResumptionIntegrityError"
    ],
    "verified_functions": [
      "reconcile_resumption"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "SessionResumptionIntegrityError"
    ],
    "sample_fail_closed_invariants": [
      "resumption response omitted Mcp-Session-Id; session identity unproven",
      "server did not advertise a bounded replay window; cannot distinguish 'no events missed' from 'events silently skipped'"
    ],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
