{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-a-stale-sse-event-id-cursor-after-mcp-streamable-http-reconnection-when-the-oauth-2-1-resource-server-binding-has-rotated",
  "title": "How does an instance detect a stale SSE event-ID cursor after MCP streamable-HTTP reconnection when the OAuth 2.1 resource-server binding has rotated mid-stream?",
  "date_of_record": "2026 November 30",
  "scope": "Applies to MCP servers exposing the streamable HTTP transport (POST for requests, GET for the resumable SSE stream) where the same bearer token is bound to a resource server whose signing key or introspection state can rotate independently of the event stream. Does not apply to stdio transports, nor to SSE streams that are not resumable via `Last-Event-ID`.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-a-stale-sse-event-id-cursor-after-mcp-streamable-http-reconnection-when-the-oauth-2-1-resource-server-binding-has-rotated.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-a-stale-sse-event-id-cursor-after-mcp-streamable-http-reconnection-when-the-oauth-2-1-resource-server-binding-has-rotated.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-a-stale-sse-event-id-cursor-after-mcp-streamable-http-reconnection-when-the-oauth-2-1-resource-server-binding-has-rotated.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1603,
    "python_slice_tokens": 201,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the token expired\" and it is not \"the stream dropped.\" Each of those has a clean, detectable signal. The failure is that **two independent continuity domains—the SSE event-ID cursor and the OAuth 2.1 resource-server binding—can desynchronize silently**, and the MCP client's resumption logic treats the event-ID cursor as authoritative whil...",
    "what_was_observed": "A reproducible trace on a streamable-HTTP MCP server: 1. Client POSTs `initialize`, receives `Mcp-Session-Id: S-77`, opens `GET /mcp` with `Accept: text/event-stream`, token `T1` (aud `RS-A`, `exp` 3600s). 2. Server emits events `4800…4821`, each tagged internally with the authorization epoch `E1` derived from `T1`'s `aud` and `jti`. 3. Network partition at t+340s. Client's SSE connection resets. Client records `Last...",
    "condition_of_validity": "The invariant that must hold for resumption to be safe: > **For any resumed SSE stream, the authorization epoch of the token presented on reconnect must equal the authorization epoch under which all replayed events (`id > Last-Event-ID`) were produced.** This is violated whenever the following three conditions co-occur: - The transport supports `Last-Event-I...",
    "decision_boundary": "The boundary the server must enforce is: **replay is authorized per-epoch, not per-token-validity.** A token that validates but whose epoch differs from the replayed events' epoch must be rejected for resumption—even though it is cryptographically valid. The correct response is `409 Conflict` with a `Mcp-Session-Id` reset directive, forcing a fresh `initiali...",
    "operational_effect": "Without the epoch check, the failure is invisible until it corrupts downstream reasoning. The agent's context window contains tool results from a superseded authorization scope, and subsequent `tools/call` requests are authorized under the current scope. The model has no way to know its context is stale-scope; it reasons over the data as if it were current. ..."
  },
  "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": "ac0a56c851288a29d450474e74ce681024d1a23638a3a68e465410b3fca20dc0",
    "verified_classes": [
      "StaleEpochResumptionError",
      "AuthEpoch",
      "StreamEvent"
    ],
    "verified_functions": [
      "resume_stream",
      "fingerprint"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "StaleEpochResumptionError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
