{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-resumes-an-mcp-sse-stream-across-a-re-bound-oauth-2-1-resource-token",
  "title": "What happens when an instance resumes an MCP SSE stream across a re-bound OAuth 2.1 resource token",
  "date_of_record": "2026 November 29",
  "scope": "Applies to MCP servers using HTTP-native transports (Streamable HTTP with SSE resumption via `Last-Event-ID`, or legacy HTTP+SSE) that bind sessions to OAuth 2.1 resource tokens per RFC 8707. Does not apply to stdio transports, nor to stateless request/response MCP endpoints that never issue resumption tokens.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-resumes-an-mcp-sse-stream-across-a-re-bound-oauth-2-1-resource-token.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-resumes-an-mcp-sse-stream-across-a-re-bound-oauth-2-1-resource-token.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-resumes-an-mcp-sse-stream-across-a-re-bound-oauth-2-1-resource-token.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1914,
    "python_slice_tokens": 341,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters here is between **session identity** and **bearer authorization**. A Streamable HTTP MCP session is identified by an `Mcp-Session-Id` header; the right to act within that session is asserted by an OAuth 2.1 access token whose `aud` (resource indicator, per RFC 8707) must match the MCP server's canonical resource URI. Most hardeni...",
    "what_was_observed": "Consider an MCP server exposing a `tools/call` stream that emits progress notifications over SSE. The client opens `POST /mcp` with `Authorization: Bearer A1`, receives `Mcp-Session-Id: S`, and the server begins streaming events `e1…e5` with monotonic `id` fields. At `e3`, token `A1` (a 300-second access token) expires. The client's OAuth library refreshes to `A2` — same `sub`, same `aud`, but a new `jti` and `iat`, ...",
    "condition_of_validity": "The claim-resolved behavior (3) is only correct under a conjunction of conditions, each of which is independently violable: - **The event buffer records authorization context per event, not per stream.** If the buffer stores only `(event_id, payload)`, the server cannot evaluate whether `A2`'s scope covers `e4`. The buffer schema must carry `(event_id, paylo...",
    "decision_boundary": "The boundary is drawn at the moment of resumption, between two questions the server must answer separately: - *Is this session still the session it was?* → compare `Mcp-Session-Id` to server-side session record; check session TTL and principal binding. - *Is this bearer entitled to the specific buffered events?* → resolve token claims; for each buffered even...",
    "operational_effect": "The practical consequence for an agent runtime: **stream resumption must be treated as a state-transfer operation with an authorization gate, not a cache read.** Concretely, the agent-side contract is that a `resumption_gap` or per-event `403` is a signal to checkpoint and reconcile, whereas a session `401` is a signal to re-initialize — and the two must not..."
  },
  "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": "e164d14321115c71d5a3d968877dfcdb33e4c25d89d638a17464f679d2b906c9",
    "verified_classes": [
      "ResumptionAuthorizationError",
      "ResumptionGapError",
      "Claims",
      "BufferedEvent",
      "Session"
    ],
    "verified_functions": [
      "resume_stream"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 6,
    "raised_exceptions": [
      "ResumptionAuthorizationError",
      "ResumptionGapError"
    ],
    "sample_fail_closed_invariants": [
      "unknown session id; re-initialize required"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
