diff --git a/examples/rig-integration/Cargo.toml b/examples/rig-integration/Cargo.toml index 08d3c50..f3f20a0 100644 --- a/examples/rig-integration/Cargo.toml +++ b/examples/rig-integration/Cargo.toml @@ -20,6 +20,7 @@ rmcp = { workspace = true, features = [ "reqwest", "transport-child-process", "transport-sse-client", + "transport-streamable-http-client" ] } anyhow = "1.0" serde_json = "1" diff --git a/examples/rig-integration/src/config/mcp.rs b/examples/rig-integration/src/config/mcp.rs index 17663ca..d6bd31b 100644 --- a/examples/rig-integration/src/config/mcp.rs +++ b/examples/rig-integration/src/config/mcp.rs @@ -14,6 +14,9 @@ pub struct McpServerConfig { #[derive(Debug, Serialize, Deserialize, Clone)] #[serde(tag = "protocol", rename_all = "lowercase")] pub enum McpServerTransportConfig { + Streamable { + url: String, + }, Sse { url: String, }, @@ -60,6 +63,11 @@ impl McpConfig { impl McpServerTransportConfig { pub async fn start(&self) -> anyhow::Result> { let client = match self { + McpServerTransportConfig::Streamable { url } => { + let transport = + rmcp::transport::StreamableHttpClientTransport::from_uri(url.to_string()); + ().serve(transport).await? + } McpServerTransportConfig::Sse { url } => { let transport = rmcp::transport::SseClientTransport::start(url.to_string()).await?; ().serve(transport).await? diff --git a/examples/simple-chat-client/Cargo.toml b/examples/simple-chat-client/Cargo.toml index 9dc5250..6ce982e 100644 --- a/examples/simple-chat-client/Cargo.toml +++ b/examples/simple-chat-client/Cargo.toml @@ -18,6 +18,7 @@ rmcp = { workspace = true, features = [ "client", "transport-child-process", "transport-sse-client", + "transport-streamable-http-client", "reqwest" ], no-default-features = true } clap = { version = "4.0", features = ["derive"] } diff --git a/examples/simple-chat-client/src/config.rs b/examples/simple-chat-client/src/config.rs index fc15989..6f0350b 100644 --- a/examples/simple-chat-client/src/config.rs +++ b/examples/simple-chat-client/src/config.rs @@ -29,6 +29,9 @@ pub struct McpServerConfig { #[derive(Debug, Serialize, Deserialize, Clone)] #[serde(tag = "protocol", rename_all = "lowercase")] pub enum McpServerTransportConfig { + Streamable { + url: String, + }, Sse { url: String, }, @@ -44,6 +47,11 @@ pub enum McpServerTransportConfig { impl McpServerTransportConfig { pub async fn start(&self) -> Result> { let client = match self { + McpServerTransportConfig::Streamable { url } => { + let transport = + rmcp::transport::StreamableHttpClientTransport::from_uri(url.to_string()); + ().serve(transport).await? + } McpServerTransportConfig::Sse { url } => { let transport = rmcp::transport::sse_client::SseClientTransport::start(url.to_owned()).await?;