{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-revalidate-the-oauth-2-1-resource-indicator-against-the-sse-last-event-id-resumption-target-in-mcp-stateless-http-transport",
  "title": "Where must an instance revalidate the OAuth 2.1 resource indicator against the SSE `Last-Event-ID` resumption target in MCP stateless HTTP transport?",
  "date_of_record": "2026 November 28",
  "scope": "Applies to MCP servers exposing the streamable-HTTP transport with SSE resumability (`Last-Event-ID` replay) behind an OAuth 2.1 resource server that enforces the `resource` parameter (RFC 8707) on tokens. Does not apply to stdio transport, nor to purely stateful session-bound HTTP servers that pin a single client connection to a single process for its lifetime.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-revalidate-the-oauth-2-1-resource-indicator-against-the-sse-last-event-id-resumption-target-in-mcp-stateless-http-transport.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-revalidate-the-oauth-2-1-resource-indicator-against-the-sse-last-event-id-resumption-target-in-mcp-stateless-http-transport.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-revalidate-the-oauth-2-1-resource-indicator-against-the-sse-last-event-id-resumption-target-in-mcp-stateless-http-transport.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2235,
    "python_slice_tokens": 333,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between *token audience binding* and *event-stream resumption binding*. In MCP's streamable-HTTP profile, a client obtains a bearer token whose `aud`/`resource` claim is scoped to a specific MCP endpoint URI, then opens an SSE stream and may later resume it with `GET /mcp` plus `Last-Event-ID`. OAuth 2.1 resource indicators ar...",
    "what_was_observed": "A stateless MCP deployment fronted by three replicas, each holding a Redis-backed SSE event log keyed by `(session_id, stream_id, event_id)`. Tokens carried `resource=https://mcp.example.com/mcp` and were validated by a middleware that canonicalized the incoming request URL and compared it to the `resource` claim. Clients opened `POST /mcp` to start a stream, received `200` with `Content-Type: text/event-stream` and ...",
    "condition_of_validity": "The invariant that must hold for stateless resumption to be safe: > *For every successful `GET /mcp` resume request, the authenticated principal `sub` and the `resource` claim of the presented token must both equal the `sub` and `resource` recorded at the time the stream identified by `Mcp-Session-Id` was opened.* This is a *conjunction* across two authoriza...",
    "decision_boundary": "The decision the server must make on every `GET /mcp` with `Last-Event-ID`: The boundary is the third row from the bottom. It is the one that a resource-indicator middleware *cannot* enforce because it does not know which stream the request is resuming until after the middleware has already returned `next()`. Enforcement must happen inside the SSE replay han...",
    "operational_effect": "Enforcing the invariant changes three things in a stateless MCP deployment: 1. **Event log schema.** Every SSE event entry must carry `(sub, resource, jti, issued_at)` as immutable metadata written at emit time, not at read time. The replay handler reads these and compares against the resume token's claims before releasing any event. This roughly doubles the..."
  },
  "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": "bb06d723eafe891d85c7f9fad1e1e116f27fbd421a15848228ec0a27da457931",
    "verified_classes": [
      "ResourceIndicatorResumeMismatch",
      "StreamOrigin",
      "ResumeToken"
    ],
    "verified_functions": [
      "authorize_sse_resume"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "ResourceIndicatorResumeMismatch"
    ],
    "sample_fail_closed_invariants": [
      "Mcp-Session-Id does not correspond to any known stream; refusing to mint a new stream in place of a resume"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
