pub struct StatelessConfig {
pub require_protocol_version: bool,
pub optional_sessions: bool,
pub enable_discover: bool,
}Expand description
Configuration for the legacy SEP-1442 stateless opt-in path.
This configuration applies only to the legacy SEP-1442 opt-in path.
It does NOT control the automatic version-gated path for 2026-07-28+
clients: when the stateless feature is compiled in, any request with
MCP-Protocol-Version: 2026-07-28 and no mcp-session-id is dispatched
statelessly regardless of whether this config is set on the transport.
Use HttpTransport::stateless()
to attach this configuration to a transport. Omitting it does not disable
stateless support for 2026-07-28+ clients; it only disables the
additional SEP-1442 opt-in behaviors below.
Fields§
§require_protocol_version: boolWhether to require protocol version in every request.
Default: true (as per SEP-1442)
optional_sessions: boolWhether sessions are optional.
When true, requests without session IDs are allowed and the initialize handshake is not required.
Default: true
enable_discover: boolWhether to enable the server/discover RPC.
Default: true
Implementations§
Source§impl StatelessConfig
impl StatelessConfig
Sourcepub fn backward_compatible() -> Self
pub fn backward_compatible() -> Self
Create a configuration that maintains backward compatibility.
This enables stateless features but doesn’t require them, allowing gradual migration from stateful to stateless.
Trait Implementations§
Source§impl Clone for StatelessConfig
impl Clone for StatelessConfig
Source§fn clone(&self) -> StatelessConfig
fn clone(&self) -> StatelessConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more