{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-treat-mcp-transport-upgrade-negotiation-as-a-state-machine-rather-than-a-capability-probe",
  "title": "Under what conditions must an instance treat MCP transport upgrade negotiation as a state machine rather than a capability probe",
  "date_of_record": "2026 November 23",
  "scope": "Applies to MCP servers exposing both the legacy HTTP+SSE transport and the streamable-HTTP transport on the same origin, where clients may attempt resumable upgrade negotiation and per-tool OAuth resource indicators are in play. Does not apply to stdio transports, single-transport servers, or deployments where the `Mcp-Session-Id` is not persisted across transport boundaries.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-mcp-transport-upgrade-negotiation-as-a-state-machine-rather-than-a-capability-probe.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-mcp-transport-upgrade-negotiation-as-a-state-machine-rather-than-a-capability-probe.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-mcp-transport-upgrade-negotiation-as-a-state-machine-rather-than-a-capability-probe.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1358,
    "python_slice_tokens": 130,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A capability probe asks \"does this server support streamable HTTP?\" and acts on the answer. An upgrade negotiation asks \"is *this session*, *this tool*, and *this OAuth resource indicator* jointly eligible to migrate from SSE to streamable HTTP, and at what point in the message stream?\" The failure mode arises when an implementation collapses the second ques...",
    "what_was_observed": "In a deployment serving ~40 tools behind a single MCP endpoint, clients using the SSE transport were offered an upgrade by a reverse proxy that advertised streamable HTTP via an `MCP-Protocol-Version` header and a `Link: rel=\"streamable\"` hint. The proxy accepted `POST /mcp` with `Mcp-Session-Id` and returned `200 OK` with a streamable response. Clients treated this as upgrade completion and dropped the SSE connectio...",
    "condition_of_validity": "The state-machine treatment is *required* (not merely recommended) when all of the following hold: - The server exposes both transports on the same origin and accepts `Mcp-Session-Id` across both. - The SSE stream uses monotonic event IDs that the client acknowledges via `Last-Event-ID` on reconnect. - OAuth tokens carry RFC 8707 `resource` indicators, and a...",
    "decision_boundary": "The boundary is crossed at the moment the client receives a streamable `200` but before it has confirmed event-ID continuity and resource-indicator validity for the *specific tool* it intends to call next. The correct decision rule: - **Do not tear down the SSE stream** until a streamable response has delivered an event with `id > last_acknowledged_sse_id` *...",
    "operational_effect": "Systems that implement the state machine correctly pay a small cost: they hold the SSE stream open through the first streamable round-trip and perform a token-resource check before declaring success. Systems that collapse the distinction observe partial tool-surface failures post-upgrade, event replay or loss, and recovery requiring full re-authentication. T..."
  },
  "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": "c7858f686fe92810bf1938f73878a7eb743993c563d36cda1baecdc58094bccf",
    "verified_classes": [
      "PrematureUpgradeError"
    ],
    "verified_functions": [
      "confirm_upgrade"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "PrematureUpgradeError"
    ],
    "sample_fail_closed_invariants": [
      "SSE stream already torn down; cannot confirm continuity"
    ],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
