{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-treat-an-mcp-resumable-sse-last-event-id-as-invalid-when-the-oauth-resource-indicator-that-authorized-the-strea",
  "title": "Under what conditions must an instance treat an MCP resumable SSE `Last-Event-ID` as invalid when the OAuth resource indicator that authorized the stream no longer matches the tool's bound resource",
  "date_of_record": "2026 November 21",
  "scope": "Applies to MCP servers/clients using the Streamable HTTP transport with SSE resumption (`Last-Event-ID` replay) and per-tool OAuth 2.1 resource indicators (RFC 8707) scoping tokens to specific tool resources. Does not apply to single-shot request/response MCP transports, stdio transports, or deployments where a single global token scope covers all tools.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-an-mcp-resumable-sse-last-event-id-as-invalid-when-the-oauth-resource-indicator-that-authorized-the-strea.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-an-mcp-resumable-sse-last-event-id-as-invalid-when-the-oauth-resource-indicator-that-authorized-the-strea.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-an-mcp-resumable-sse-last-event-id-as-invalid-when-the-oauth-resource-indicator-that-authorized-the-strea.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1441,
    "python_slice_tokens": 252,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A resumable SSE session and an OAuth authorization are two independently-lived state machines that the Streamable HTTP transport naively couples at the `Last-Event-ID` replay boundary. The session's event log is keyed by an opaque event ID and survives across transport reconnects; the authorization is keyed by a resource indicator (`resource=`) bound to a sp...",
    "what_was_observed": "A client agent opens a session against an MCP server's `/mcp` endpoint, obtains an access token with `resource=https://server.example/tools/search` (a read-only search tool), and begins a long-running `search` invocation whose results stream as SSE events `id: 1..N`. Mid-stream the connection drops at event `N=47`. The agent, per the Streamable HTTP spec, reconnects with `Last-Event-ID: 47` and — because the search t...",
    "condition_of_validity": "The `Last-Event-ID` replay is only valid when **all three** hold: - The resuming connection's access token carries a `resource` indicator whose canonical URI set is a **superset** of the resource indicators under which the events to be replayed were originally produced; and - The server's event log stores, per event, the originating `resource` indicator (or ...",
    "decision_boundary": "The boundary is: **does the event log carry per-event resource provenance?** If yes, replay is a set-inclusion check over stored resource indicators and the failure is a clean `403` with a machine-readable `resource_mismatch` error naming the first offending event ID. If no — the common case, because session stores are keyed by `Mcp-Session-Id` and event pay...",
    "operational_effect": "Clients that resume across a resource-indicator change receive events they cannot attribute, and audit trails that assume \"session ID ⇒ single authorization scope\" become unsound. The guardrail is to bind the session to the resource set at creation, store per-event resource provenance, and make replay a set-inclusion gate. The reference implementation below ..."
  },
  "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": "828a378b28a8c449647b9622ae51217b6ada34107d9df74f6dc73fa6d5a81d6a",
    "verified_classes": [
      "ResourceIndicatorReplayError",
      "StreamEvent",
      "Session"
    ],
    "verified_functions": [
      "resume_stream",
      "replay_tail"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "ResourceIndicatorReplayError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
