{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-treat-mcp-streamable-http-session-negotiation-as-a-resumability-contract-rather-than-a-connection-handshake",
  "title": "How should an instance treat MCP Streamable HTTP session negotiation as a resumability contract rather than a connection handshake",
  "date_of_record": "2026 November 12",
  "scope": "Applies to MCP clients and servers using the Streamable HTTP transport where sessions are negotiated via `Mcp-Session-Id` and streams are resumed via `Last-Event-ID` on SSE responses. Does not apply to the deprecated HTTP+SSE two-endpoint transport, nor to stdio transports, nor to stateless one-shot tool calls that never establish a session.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-treat-mcp-streamable-http-session-negotiation-as-a-resumability-contract-rather-than-a-connection-handshake.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-treat-mcp-streamable-http-session-negotiation-as-a-resumability-contract-rather-than-a-connection-handshake.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-treat-mcp-streamable-http-session-negotiation-as-a-resumability-contract-rather-than-a-connection-handshake.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1802,
    "python_slice_tokens": 290,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The Streamable HTTP transport looks like a connection handshake — client POSTs to the endpoint, server returns `Mcp-Session-Id`, subsequent requests carry that header, and a stream of events flows back. The non-obvious boundary is that session negotiation is not a connection state; it is a *resumability contract*. The `Mcp-Session-Id` is the durable namespac...",
    "what_was_observed": "During a multi-tool agent run against an MCP server behind a rolling deploy, the following sequence occurred repeatedly and reproducibly: 1. Client established a session, received `Mcp-Session-Id: S1`, and began consuming an SSE stream. Events carried IDs `e100..e140`. 2. The server instance holding `S1` was drained. The load balancer kept the TCP connection open long enough for the client to observe a clean stream t...",
    "condition_of_validity": "The resumability contract holds only when all of the following are true simultaneously: - The `Mcp-Session-Id` and the event-ID namespace are **co-issued**: an event ID is valid only within the session that produced it, and the server must reject `Last-Event-ID` values it cannot attribute to the presented session. - Session absence is **terminal and explicit...",
    "decision_boundary": "The decision an instance must make on every stream interruption is binary and must be made *before* any event is consumed from the new stream: - **Resume** only if the server acknowledged the same `Mcp-Session-Id` *and* the first event received has an ID that the client can place strictly after its last persisted event ID within that session's known ordering...",
    "operational_effect": "Instances that enforce the co-issuance invariant observe a characteristic shift: resume attempts against drained backends fail loudly and immediately, and the agent's recovery path becomes \"reconcile side effects, then re-plan,\" which is slower but converges. Instances that do not enforce it observe *fewer* visible errors and *more* silent divergence — dupli..."
  },
  "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": "6b7ad6e95eda7dd8caa334851910ab6b9d1122580deb3b7ee03968e95fba0384",
    "verified_classes": [
      "SessionResumptionViolation",
      "ResumeToken"
    ],
    "verified_functions": [
      "validate_resume",
      "fingerprint"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 6,
    "raised_exceptions": [
      "SessionResumptionViolation"
    ],
    "sample_fail_closed_invariants": [
      "resume response carried no Mcp-Session-Id; cannot bind event namespace",
      "resumed stream produced no event id; cannot prove continuity"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
