{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-treat-mcp-sse-stream-resumption-across-a-session-migration-as-invalidated-by-oauth-2-1-resource-server-audience-reb",
  "title": "In what scenarios must an instance treat MCP SSE stream resumption across a session migration as invalidated by OAuth 2.1 resource-server audience rebinding",
  "date_of_record": "2026 November 25",
  "scope": "Applies to MCP servers exposing both the legacy HTTP+SSE transport (GET event stream + POST message endpoint) and the streamable-HTTP transport, where a client resumes an interrupted SSE stream (`Last-Event-ID`) after the server has migrated the session identifier and the bearer token's `aud`/resource indicator has been rebound to a new canonical resource URI. Does not apply to pure stdio transports, nor to in-process session migration where no OAuth resource binding is present.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-mcp-sse-stream-resumption-across-a-session-migration-as-invalidated-by-oauth-2-1-resource-server-audience-reb.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-mcp-sse-stream-resumption-across-a-session-migration-as-invalidated-by-oauth-2-1-resource-server-audience-reb.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-mcp-sse-stream-resumption-across-a-session-migration-as-invalidated-by-oauth-2-1-resource-server-audience-reb.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1570,
    "python_slice_tokens": 292,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the client reconnected and lost events.\" It is subtler: the MCP session is *logically continuous* (same `Mcp-Session-Id` lineage, same `Last-Event-ID` replay cursor) while the *authorization envelope* is *discontinuous* (the resource-server binding now validates against a different `aud`). Resumable SSE semantics assume the replay cursor ...",
    "what_was_observed": "An MCP server fronted by an SSE endpoint at `GET /sse` and a message endpoint at `POST /message?sessionId=…`. The server was being migrated to streamable HTTP at `POST /mcp` with `Accept: text/event-stream`, and the OAuth 2.1 resource server was repointed from resource indicator `https://mcp.old.example/v1` to `https://mcp.new.example/v1`. The migration kept the session store and the event log shared. Sequence that b...",
    "condition_of_validity": "Resumption across migration is valid **only if** all three hold: - The event log is partitioned by resource indicator, and replay from `Last-Event-ID` is filtered to events whose originating audience equals the resuming token's `aud`. This requires the event record to carry `aud` as a first-class field, not merely the session id. - The session store treats `...",
    "decision_boundary": "The operational rule: **on any request that carries both `Last-Event-ID` and a bearer token whose `aud` differs from the audience recorded at the cursor's origin, the server MUST refuse replay and force a cold re-subscribe.** The refusal is not a `401`—the token is valid—it is a `409` with a machine-readable body instructing the client to discard its cursor ...",
    "operational_effect": "Bounding this requires three concrete guards, all cheap: - Stamp every event log record with the `aud` under which it was produced, and reject `Last-Event-ID` replay when `aud` mismatches. - Key the session store on `(sessionId, aud)` and, at migration, emit a `notifications/session_migrated` event that the client must acknowledge before any further replay i..."
  },
  "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": "beb0caef522b67b161c994b5ba337f3afe33842e3dc5fcca0263316902bef72b",
    "verified_classes": [
      "CrossAudienceReplayError",
      "EventRecord",
      "ResumeRequest"
    ],
    "verified_functions": [
      "resume_stream",
      "__init__"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "CrossAudienceReplayError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
