Update rmcp to 1.5.0 (fixes #8453) (#8618)

This commit is contained in:
jh-block
2026-04-17 12:50:27 +02:00
committed by GitHub
parent afcdf2cab3
commit 69d89859a2
6 changed files with 22 additions and 27 deletions
+1 -1
View File
@@ -121,7 +121,7 @@ impl McpFixtureServer {
}
}
#[tool_handler]
#[tool_handler(router = self.tool_router)]
impl ServerHandler for McpFixtureServer {
fn get_info(&self) -> ServerInfo {
InitializeResult::new(ServerCapabilities::builder().enable_tools().build())
+9 -15
View File
@@ -443,10 +443,7 @@ async fn create_streamable_http_client(
let transport = StreamableHttpClientTransport::with_client(
http_client,
StreamableHttpClientTransportConfig {
uri: uri.into(),
..Default::default()
},
StreamableHttpClientTransportConfig::with_uri(uri),
);
let timeout_duration = Duration::from_secs(resolve_timeout(timeout));
@@ -475,10 +472,7 @@ async fn create_streamable_http_client(
let auth_client = AuthClient::new(auth_http_client, auth_manager);
let transport = StreamableHttpClientTransport::with_client(
auth_client,
StreamableHttpClientTransportConfig {
uri: uri.into(),
..Default::default()
},
StreamableHttpClientTransportConfig::with_uri(uri),
);
Ok(Box::new(
McpClient::connect(
@@ -2318,11 +2312,11 @@ mod tests {
fn transport_err(error: Box<dyn std::error::Error + Send + Sync>) -> ClientInitializeError {
ClientInitializeError::TransportError {
error: rmcp::transport::DynamicTransportError {
transport_name: "test".into(),
transport_type_id: std::any::TypeId::of::<()>(),
error: rmcp::transport::DynamicTransportError::from_parts(
"test",
std::any::TypeId::of::<()>(),
error,
},
),
context: "test context".into(),
}
}
@@ -2337,9 +2331,9 @@ mod tests {
fn test_oauth_fallback_on_typed_auth_required() {
let err = streamable_err(
rmcp::transport::streamable_http_client::StreamableHttpError::AuthRequired(
rmcp::transport::streamable_http_client::AuthRequiredError {
www_authenticate_header: "Bearer realm=\"test\"".to_string(),
},
rmcp::transport::streamable_http_client::AuthRequiredError::new(
"Bearer realm=\"test\"".to_string(),
),
),
);
assert!(should_attempt_oauth_fallback(&Err(err)));
+1
View File
@@ -330,6 +330,7 @@ impl ClientHandler for GooseClient {
.map(|user_data| CreateElicitationResult {
action: ElicitationAction::Accept,
content: Some(user_data),
meta: None,
})
.map_err(|e| {
ErrorData::new(
+3 -3
View File
@@ -115,17 +115,17 @@ pub async fn oauth_flow(
.unwrap_or_default();
credential_store
.save(StoredCredentials {
.save(StoredCredentials::new(
client_id,
token_response,
granted_scopes,
token_received_at: Some(
Some(
std::time::SystemTime::now()
.duration_since(std::time::UNIX_EPOCH)
.map(|duration| duration.as_secs())
.unwrap_or(0),
),
})
))
.await?;
auth_manager.set_credential_store(credential_store);