Skip to content

Commit 69d8985

Browse files
authored
Update rmcp to 1.5.0 (fixes #8453) (#8618)
1 parent afcdf2c commit 69d8985

6 files changed

Lines changed: 22 additions & 27 deletions

File tree

Cargo.lock

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ uninlined_format_args = "allow"
2020
string_slice = "warn"
2121

2222
[workspace.dependencies]
23-
rmcp = { version = "1.2.0", features = ["schemars", "auth"] }
23+
rmcp = { version = "1.5.0", features = ["schemars", "auth"] }
2424
agent-client-protocol-schema = { version = "0.11", features = ["unstable"] }
2525
sacp = "11.0.0"
2626
arboard = "3"

crates/goose-test-support/src/mcp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ impl McpFixtureServer {
121121
}
122122
}
123123

124-
#[tool_handler]
124+
#[tool_handler(router = self.tool_router)]
125125
impl ServerHandler for McpFixtureServer {
126126
fn get_info(&self) -> ServerInfo {
127127
InitializeResult::new(ServerCapabilities::builder().enable_tools().build())

crates/goose/src/agents/extension_manager.rs

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -443,10 +443,7 @@ async fn create_streamable_http_client(
443443

444444
let transport = StreamableHttpClientTransport::with_client(
445445
http_client,
446-
StreamableHttpClientTransportConfig {
447-
uri: uri.into(),
448-
..Default::default()
449-
},
446+
StreamableHttpClientTransportConfig::with_uri(uri),
450447
);
451448

452449
let timeout_duration = Duration::from_secs(resolve_timeout(timeout));
@@ -475,10 +472,7 @@ async fn create_streamable_http_client(
475472
let auth_client = AuthClient::new(auth_http_client, auth_manager);
476473
let transport = StreamableHttpClientTransport::with_client(
477474
auth_client,
478-
StreamableHttpClientTransportConfig {
479-
uri: uri.into(),
480-
..Default::default()
481-
},
475+
StreamableHttpClientTransportConfig::with_uri(uri),
482476
);
483477
Ok(Box::new(
484478
McpClient::connect(
@@ -2318,11 +2312,11 @@ mod tests {
23182312

23192313
fn transport_err(error: Box<dyn std::error::Error + Send + Sync>) -> ClientInitializeError {
23202314
ClientInitializeError::TransportError {
2321-
error: rmcp::transport::DynamicTransportError {
2322-
transport_name: "test".into(),
2323-
transport_type_id: std::any::TypeId::of::<()>(),
2315+
error: rmcp::transport::DynamicTransportError::from_parts(
2316+
"test",
2317+
std::any::TypeId::of::<()>(),
23242318
error,
2325-
},
2319+
),
23262320
context: "test context".into(),
23272321
}
23282322
}
@@ -2337,9 +2331,9 @@ mod tests {
23372331
fn test_oauth_fallback_on_typed_auth_required() {
23382332
let err = streamable_err(
23392333
rmcp::transport::streamable_http_client::StreamableHttpError::AuthRequired(
2340-
rmcp::transport::streamable_http_client::AuthRequiredError {
2341-
www_authenticate_header: "Bearer realm=\"test\"".to_string(),
2342-
},
2334+
rmcp::transport::streamable_http_client::AuthRequiredError::new(
2335+
"Bearer realm=\"test\"".to_string(),
2336+
),
23432337
),
23442338
);
23452339
assert!(should_attempt_oauth_fallback(&Err(err)));

crates/goose/src/agents/mcp_client.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,7 @@ impl ClientHandler for GooseClient {
330330
.map(|user_data| CreateElicitationResult {
331331
action: ElicitationAction::Accept,
332332
content: Some(user_data),
333+
meta: None,
333334
})
334335
.map_err(|e| {
335336
ErrorData::new(

crates/goose/src/oauth/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,17 +115,17 @@ pub async fn oauth_flow(
115115
.unwrap_or_default();
116116

117117
credential_store
118-
.save(StoredCredentials {
118+
.save(StoredCredentials::new(
119119
client_id,
120120
token_response,
121121
granted_scopes,
122-
token_received_at: Some(
122+
Some(
123123
std::time::SystemTime::now()
124124
.duration_since(std::time::UNIX_EPOCH)
125125
.map(|duration| duration.as_secs())
126126
.unwrap_or(0),
127127
),
128-
})
128+
))
129129
.await?;
130130

131131
auth_manager.set_credential_store(credential_store);

0 commit comments

Comments
 (0)