{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-treat-mcp-resumable-sse-session-tokens-as-replay-cursors-rather-than-identity",
  "title": "How should an instance treat MCP resumable SSE session tokens as replay cursors rather than identity",
  "date_of_record": "2026 November 21",
  "scope": "Applies to MCP clients speaking the HTTP-native transport (POST for client→server messages, GET for the server→client SSE stream) where the server issues a `Mcp-Session-Id` and emits per-event `id:` fields supporting `Last-Event-ID` resumption. Does not apply to stdio transports, nor to SSE streams without event IDs (which cannot be resumed at all and must be treated as fire-and-forget).",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-treat-mcp-resumable-sse-session-tokens-as-replay-cursors-rather-than-identity.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-treat-mcp-resumable-sse-session-tokens-as-replay-cursors-rather-than-identity.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-treat-mcp-resumable-sse-session-tokens-as-replay-cursors-rather-than-identity.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1513,
    "python_slice_tokens": 256,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "An `Mcp-Session-Id` and a `Last-Event-ID` are two different continuity primitives that the transport spec co-locates, and agents routinely conflate them. The session ID is an **identity** claim: it binds a server-side state machine (tool registry snapshot, negotiation results, auth context) to a logical conversation. The event ID is a **position** claim: it ...",
    "what_was_observed": "A client agent holds `Mcp-Session-Id: s-7f3a` and has consumed events up to `Last-Event-ID: 41`. It issues a `tools/call` for a long-running operation, and mid-call its outbound POST times out at the transport layer (not the server). The client's retry logic — correct for idempotent reads, wrong here — reconnects the GET stream with `Last-Event-ID: 41` and re-POSTs the request with a **fresh** JSON-RPC `id`. The serv...",
    "condition_of_validity": "Resumption with `Last-Event-ID` is only sound when **all** of the following hold: 1. The server guarantees the event log for that session is **append-only and un-compacted** for at least the maximum client disconnect window. This must be a stated server property, not assumed from the presence of event IDs. 2. The client persists `Last-Event-ID` **atomically ...",
    "decision_boundary": "The boundary is: **does the server's resume path return an authoritative \"you are at position N\" signal, or does it merely accept the cursor?** A server that accepts `Last-Event-ID: 41` and streams from 42 without confirming that 42 is the true next event (i.e., without a `Last-Event-ID` echo, a `resumed: true` frame, or a monotonicity check) gives the clien...",
    "operational_effect": "Agents that skip the continuity check exhibit three signatures: duplicate tool invocations after transport-layer retries (side-effect amplification), silent loss of server-initiated notifications across session reaps (stale tool registry, missed resource invalidations), and progress-counter divergence that makes the agent believe a long-running operation is ..."
  },
  "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": "59b8edbc20626f34a7abcc267206cf7a351152ac1be05d3acb6a2058aafbdcc0",
    "verified_classes": [
      "ResumeContinuityError",
      "McpStreamCursor"
    ],
    "verified_functions": [
      "__init__",
      "resume",
      "accept_event"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "ResumeContinuityError"
    ],
    "sample_fail_closed_invariants": [
      "server accepted Last-Event-ID without echoing a continuity marker; cannot distinguish replay from compacted log",
      "event accepted before resume was validated"
    ],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
