From 9c0ed96ff90da7ea2564c6da58d08faecca1f1ae Mon Sep 17 00:00:00 2001 From: jefflower <406618805@qq.com> Date: Sun, 5 Apr 2026 11:47:53 +0800 Subject: [PATCH] fix: use builder API for StreamableHttpClientTransportConfig MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `StreamableHttpClientTransportConfig` is marked `#[non_exhaustive]` in rmcp 1.3.0, which forbids struct literal construction outside the defining crate — even with `..Default::default()` fill syntax. Replace the struct literal with the provided builder API: `StreamableHttpClientTransportConfig::with_uri(url).custom_headers(headers)` Also drop the now-unused `use std::sync::Arc` import. Co-Authored-By: Claude Sonnet 4.6 --- crates/openfang-runtime/src/mcp.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/crates/openfang-runtime/src/mcp.rs b/crates/openfang-runtime/src/mcp.rs index b9f5f3819f..345c37a856 100644 --- a/crates/openfang-runtime/src/mcp.rs +++ b/crates/openfang-runtime/src/mcp.rs @@ -14,7 +14,6 @@ use rmcp::service::RunningService; use rmcp::{RoleClient, ServiceExt}; use serde::{Deserialize, Serialize}; use std::collections::HashMap; -use std::sync::Arc; use tracing::{debug, info}; // --------------------------------------------------------------------------- @@ -307,11 +306,8 @@ impl McpConnection { } } - let config = StreamableHttpClientTransportConfig { - uri: Arc::from(url), - custom_headers, - ..Default::default() - }; + let config = StreamableHttpClientTransportConfig::with_uri(url) + .custom_headers(custom_headers); let transport = StreamableHttpClientTransport::from_config(config);