pub enum McpClientTransport {
StreamableHttp {
url: String,
headers: Option<HashMap<String, String>>,
},
Sse {
url: String,
headers: Option<HashMap<String, String>>,
},
}Expand description
Client-side transport configuration for connecting to an MCP server.
Mirrors the variants the rmcp crate supports. headers is always optional
— most public servers don’t need extra headers, and OAuth bearers are
injected by the connection resolver at pool-connect time rather than being
stored here.
The Stdio variant is intentionally absent: connections are workspace
resources that must be portable across hosts, so spawning a local child
process is not user-configurable. In-process A2A servers use the separate
TransportType enum on McpServerMetadata.
Variants§
StreamableHttp
Streamable HTTP transport (MCP 2025-03-26+ spec). One bidirectional endpoint that may upgrade individual responses to SSE.
Sse
Legacy SSE-only transport (MCP 2024-11-05 spec). Kept for servers that haven’t migrated yet; prefer Streamable HTTP for new connections.
Implementations§
Trait Implementations§
Source§impl Clone for McpClientTransport
impl Clone for McpClientTransport
Source§fn clone(&self) -> McpClientTransport
fn clone(&self) -> McpClientTransport
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl ComposeSchema for McpClientTransport
impl ComposeSchema for McpClientTransport
Source§impl Debug for McpClientTransport
impl Debug for McpClientTransport
Source§impl<'de> Deserialize<'de> for McpClientTransport
impl<'de> Deserialize<'de> for McpClientTransport
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for McpClientTransport
impl JsonSchema for McpClientTransport
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more