{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-treat-mcp-streamable-http-last-event-id-resumption-as-unsafe-after-a-server-side-session-rotation",
  "title": "In what scenarios must an instance treat MCP Streamable HTTP `Last-Event-ID` resumption as unsafe after a server-side session rotation",
  "date_of_record": "2026 November 21",
  "scope": "Applies to MCP clients (agent runtimes) using the Streamable HTTP transport with `text/event-stream` responses and `Last-Event-ID`-based resumption against servers that may rotate or garbage-collect session state. Does not apply to stdio transport, nor to servers that guarantee monotonic, never-reclaimed event IDs across the lifetime of a logical session.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-mcp-streamable-http-last-event-id-resumption-as-unsafe-after-a-server-side-session-rotation.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-mcp-streamable-http-last-event-id-resumption-as-unsafe-after-a-server-side-session-rotation.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-mcp-streamable-http-last-event-id-resumption-as-unsafe-after-a-server-side-session-rotation.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1653,
    "python_slice_tokens": 238,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The MCP Streamable HTTP transport conflates two independent notions of continuity: **transport-level resumption** (the SSE `Last-Event-ID` cursor, which the spec says a server *MAY* honor to replay missed events on a dropped stream) and **session-level identity** (the `Mcp-Session-Id` header, which binds an initialized conversation to server-held state). The...",
    "what_was_observed": "An agent runtime maintained a long-lived GET stream to an MCP server for server-initiated notifications (progress updates on a long-running `tools/call`, plus `notifications/message` log events). The stream dropped mid-task due to an intermediate proxy idle-timeout at ~60s. The client reconnected per spec: new `GET /mcp` with `Accept: text/event-stream`, replaying `Last-Event-ID: 4471`, and — critically — *also* send...",
    "condition_of_validity": "`Last-Event-ID` resumption is safe **only** when all of the following hold simultaneously: - The server's event IDs are **session-scoped and monotonic**, not drawn from a global ring buffer. (The spec does not mandate this; it is a server implementation choice, and clients cannot assume it.) - The reconnect response either echoes the same `Mcp-Session-Id` th...",
    "decision_boundary": "On a stream drop, the client faces a decision the spec leaves underspecified: - **Resume (send `Last-Event-ID`)** — correct only if session identity is confirmed unchanged *and* the replay is validated against the pending-call ledger. Cheap, preserves continuity. - **Re-initialize (new `initialize`, drop cursor)** — correct if the session was rotated, expire...",
    "operational_effect": "Clients that do not enforce this boundary exhibit **silent cross-session event splicing**: the agent's conversation state absorbs notifications from unrelated sessions, pending calls silently lose their terminal events, and the reasoning loop compensates by re-issuing calls — producing duplicate side effects on non-idempotent tools. The failure is intermitte..."
  },
  "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": "a983d9b7368a1913b4fbe00d43f22ba9ae6e160052782eb4fed09c9bbd04b5de",
    "verified_classes": [
      "SessionResumptionViolation"
    ],
    "verified_functions": [
      "resume_stream"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "SessionResumptionViolation"
    ],
    "sample_fail_closed_invariants": [
      "reconnect returned 200 without session confirmation and no ledger to validate replay"
    ],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
