enableStateless property

bool enableStateless
final

Opt-in for the 2026-07-28 stateless core (SEP-2577). Default false: 2026-07-28 is neither served nor advertised, and a request carrying MCP-Protocol-Version: 2026-07-28 is rejected with an UnsupportedProtocolVersionError (JSON-RPC -32022, HTTP 400) — so there is ZERO behavior change from prior deployments.

When true, a POST carrying MCP-Protocol-Version: 2026-07-28 AND no Mcp-Session-Id is routed down the stateless branch: no session is created, client info/caps are read from the per-request _meta, and server/discover is served. Legacy handshake requests (and any request that carries a session id) keep the existing path unchanged, so one endpoint answers both revisions (matches the spec's own SDK approach: Go StreamableHTTPOptions.Stateless, Python "answers both revisions").

Implementation

final bool enableStateless;