{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-resume-an-mcp-sse-stream-the-last-event-id-cursor-can-outlive-the-oauth-2-1-resource-indicator-scope-that-authorized-it",
  "title": "When must an instance resume an MCP SSE stream, the Last-Event-ID cursor can outlive the OAuth 2.1 resource-indicator scope that authorized it",
  "date_of_record": "2026 November 21",
  "scope": "Applies to MCP servers exposing HTTP-native transport with Server-Sent Events and `Last-Event-ID` resumption (the \"streamable HTTP\" profile), where sessions are bound to OAuth 2.1 access tokens carrying a `resource` indicator (RFC 8707). Does not apply to stdio transport, to stateless JSON-only MCP endpoints, or to servers that re-authorize every resumption against a fresh token exchange.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-resume-an-mcp-sse-stream-the-last-event-id-cursor-can-outlive-the-oauth-2-1-resource-indicator-scope-that-authorized-it.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-resume-an-mcp-sse-stream-the-last-event-id-cursor-can-outlive-the-oauth-2-1-resource-indicator-scope-that-authorized-it.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-resume-an-mcp-sse-stream-the-last-event-id-cursor-can-outlive-the-oauth-2-1-resource-indicator-scope-that-authorized-it.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1702,
    "python_slice_tokens": 244,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the token expired.\" The failure is that **the SSE resumption cursor (`Last-Event-ID`) and the OAuth resource indicator are two independent continuity handles that the transport treats as one.** A streamable-session server keeps a per-session event log keyed by monotonically increasing event IDs so a client can reconnect with `Last-Event-I...",
    "what_was_observed": "A multi-tenant MCP deployment fronted two upstream tool servers: `mcp://tools-a.corp` (resource indicator `A`) and `mcp://tools-b.corp` (resource indicator `B`). A single streamable-HTTP gateway multiplexed both behind one session layer to amortize connection cost. Trace: 1. Agent instance opens `POST /mcp` with `Authorization: Bearer <token-A>`, `resource=A`. Gateway creates session `S-77`, returns `Mcp-Session-Id: ...",
    "condition_of_validity": "The replay-without-rescope bug is reachable only when all of the following hold simultaneously, which is why it is rare and non-obvious: - **Session reuse across resource scopes.** The `Mcp-Session-Id` is not bound to the `resource` claim at creation, so a reconnect with a different valid token is accepted against the existing session. - **Resumption accepte...",
    "decision_boundary": "The correct guardrail is a **scope-bound cursor**: the resumption validity predicate must be the conjunction of session identity *and* resource-indicator identity, evaluated against the events being replayed, not merely against the live connection. Concretely, the server must, on any `GET` with `Last-Event-ID`: 1. Compare the `resource`/`aud` of the presente...",
    "operational_effect": "When the boundary is honored, the cost is occasional forced cold starts: a subtask routed to a new resource pays full session setup instead of resuming a warm stream. That cost is the price of scope isolation and is bounded and predictable. When the boundary is violated, the effect is silent cross-scope contamination: an agent's reasoning context accumulates..."
  },
  "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": "0eba81e1bb0ff844a9fa50168d235e3b01621a9c446b7e8d900be16f1153e41f",
    "verified_classes": [
      "ScopeBoundCursorError"
    ],
    "verified_functions": [
      "resume_stream"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "ScopeBoundCursorError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
