{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-refuse-to-replay-an-sse-event-id-after-an-mcp-session-resume-and-why-the-answer-is-not-always-replay-the-last-event",
  "title": "When must an instance refuse to replay an SSE event ID after an MCP session resume, and why the answer is not \"always replay the last event\"",
  "date_of_record": "2026 December 2",
  "scope": "Applies to MCP servers/clients using the HTTP-native transport where a `GET` request upgrades to a Server-Sent Events stream carrying an `id:` field per event, and where a client reconnects with `Last-Event-ID` to resume a session. Does not apply to stdio transports, WebSocket transports, or SSE streams that do not emit per-event IDs (i.e., where resumption is structurally impossible and the client must re-initialize).",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-replay-an-sse-event-id-after-an-mcp-session-resume-and-why-the-answer-is-not-always-replay-the-last-event.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-replay-an-sse-event-id-after-an-mcp-session-resume-and-why-the-answer-is-not-always-replay-the-last-event.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-replay-an-sse-event-id-after-an-mcp-session-resume-and-why-the-answer-is-not-always-replay-the-last-event.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2160,
    "python_slice_tokens": 414,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between **event-ID monotonicity** and **event-ID causality**. SSE resumption semantics as specified (and as naively implemented) assume that a client presenting `Last-Event-ID: N` has processed every event with id ≤ N, and therefore the server may safely replay events N+1, N+2, … from its buffer. This assumption holds for pure...",
    "what_was_observed": "An MCP server exposing a `run_analysis` tool was configured with the HTTP-native transport, SSE upgrade on `GET /mcp`, and a per-session ring buffer of 512 events keyed by a monotonic `id`. A client agent initiated a session, received `initialize` response, sent `notifications/initialized`, then issued a `tools/call` for `run_analysis`. The server emitted a stream of progress events (`id: 41` through `id: 58`), each ...",
    "condition_of_validity": "`Last-Event-ID: N` is a sound resume cursor **if and only if** every event with id ≤ N is idempotent with respect to client-side effects, or the client can prove to the server that all effects of events ≤ N were durably committed before the disconnect. Neither condition is checkable from the header alone. For MCP specifically, the following event classes vio...",
    "decision_boundary": "The boundary is drawn at whether the event stream is **effect-bearing** or **observation-only**. - **Observation-only** (server→client notifications with no client action triggered, e.g., `notifications/message` logging, pure progress percentages): bare `Last-Event-ID` replay is safe. Duplicate delivery is idempotent at the client because the client's only a...",
    "operational_effect": "The practical consequence is that MCP sessions over HTTP-native transport are **not resumable by default** for any operation that involves client→server requests mid-stream. An agent that assumes SSE resumption semantics from the web-logging world will, under proxy timeouts and mid-stream disconnects, silently double-apply effects and produce wrong results w..."
  },
  "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": "76e36210dc97b5a05ee7345574c77f6a57e70c59f3d3a245763851eae38634d5",
    "verified_classes": [
      "UnsafeResumeError"
    ],
    "verified_functions": [
      "plan_resume"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "UnsafeResumeError"
    ],
    "sample_fail_closed_invariants": [
      "Effect-bearing events in resume window but client supplied no effects_committed_through cursor; replay would risk double"
    ],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
