{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-silent-session-identity-drift-when-resuming-an-mcp-sse-session-across-the-streamable-http-transport-boundary-under-oauth-2-1",
  "title": "Which invariants prevent silent session-identity drift when resuming an MCP SSE session across the streamable-HTTP transport boundary under OAuth 2.1 resource-server binding",
  "date_of_record": "2026 November 14",
  "scope": "Applies to MCP servers that expose both the legacy HTTP+SSE transport (`GET /sse` + `POST /messages`) and the streamable-HTTP transport (`POST /mcp` with `Mcp-Session-Id`), where a client may resume an interrupted SSE stream by re-issuing requests against the streamable endpoint carrying a prior session identifier, and where the resource server (RS) validates bearer tokens bound to a specific audience and `sub`. Does not apply to stdio transports, to pure SSE deployments with no streamable endpoint, or to RS configurations that perform token introspection on every request without session caching.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-silent-session-identity-drift-when-resuming-an-mcp-sse-session-across-the-streamable-http-transport-boundary-under-oauth-2-1.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-silent-session-identity-drift-when-resuming-an-mcp-sse-session-across-the-streamable-http-transport-boundary-under-oauth-2-1.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-silent-session-identity-drift-when-resuming-an-mcp-sse-session-across-the-streamable-http-transport-boundary-under-oauth-2-1.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1390,
    "python_slice_tokens": 206,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A *session identifier* (`Mcp-Session-Id`) and a *resource-server binding* (the `aud`/`sub`/`scope` triple validated against the token) are two independent namespaces that the MCP transport spec treats as orthogonal. The SSE-to-streamable resumption path is the only place in the protocol where a client presents both simultaneously: it carries the old session ...",
    "what_was_observed": "A client opened an SSE session against `/sse`, received `Mcp-Session-Id: A1`, and began a long-running `tools/call` whose result stream was interrupted at the proxy (a 502 after 90 s of idle). The client's OAuth library refreshed the access token in the background; the new token carried the same `sub` but a re-issued `aud` claim (the AS rotated the audience value from `mcp://srv` to `mcp://srv/v2` during a deploy). T...",
    "condition_of_validity": "The drift is possible only when all of the following hold: (1) the server maintains session state across the transport boundary rather than re-deriving it per request; (2) the session record stores the authorization context captured at creation time; (3) the streamable endpoint's resume path validates the *presented* token but does not compare it against the...",
    "decision_boundary": "The correct boundary is: **a resumed session must be re-authorized against the current token's full binding, not merely authenticated.** Concretely, on every streamable-HTTP request that carries `Mcp-Session-Id`, the server must compare the request token's `(aud, sub, scope)` against the session record's stored binding and reject on any mismatch with `403` a...",
    "operational_effect": "When the invariant is enforced, the observable behavior is that a token refresh that changes `aud` or `scope` forces a new session: the client receives `403` with `Mcp-Session-Id` absent, re-initializes, and re-issues in-flight calls. This is correct but disruptive — long-running tool calls are lost. When the invariant is *not* enforced, the observable behav..."
  },
  "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": "56abb9e9b4437208ccec0743fbcf886109fd8de042980c7e0e36ba2bb8a20c07",
    "verified_classes": [
      "SessionBindingDriftError"
    ],
    "verified_functions": [
      "resume_streamable_session"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "SessionBindingDriftError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
