pub enum TransportKind {
Stdio,
LegacySse,
StreamableHttp,
StatelessHttp,
}Expand description
A transport the specification defines.
Ordered by the revision that introduced it, so the declaration order is
chronological and Ord is derived rather than written. See
tests::derived_ordering_agrees_in_both_directions.
Variants§
Stdio
Newline-delimited JSON over a child process’s standard streams.
Defined by every revision, 2024-11-05 through the newest. It predates
the HTTP transports and is not a lifecycle the protocol version changes.
LegacySse
HTTP+SSE as defined for 2024-11-05, where the client opened a GET
stream and the server held a single POST endpoint.
Removed in 2025-03-26. Kept as a distinct variant rather than folded
into StreamableHttp because a bridge that receives a message from
one of these has to be able to say so, and because it is the only
revision that can require this branch to exist.
StreamableHttp
The stateful Streamable HTTP transport introduced in 2025-03-26: a
single endpoint that upgrades to SSE, with an Mcp-Session-Id header
tying calls together.
StatelessHttp
The stateless lifecycle introduced in 2026-07-28.
Distinct from StreamableHttp rather than a mode of it, because the
two differ in what the session tracks: this one has no protocol-level
session at all, every request carries its version and capabilities in
_meta, and there is no initialize handshake. Code that caches per
session cannot treat them alike.
Implementations§
Source§impl TransportKind
impl TransportKind
Sourcepub const fn as_str(self) -> &'static str
pub const fn as_str(self) -> &'static str
The transport’s short name, for logs, errors and CLI arguments.
These are this project’s own vocabulary rather than the specification’s
— the spec never names its transports in a versioned field — so
StreamableHttp is http and StatelessHttp is http-stateless. The
CLI surfaces the same spellings, and changing one means changing both.