diff --git a/Cargo.lock b/Cargo.lock index b505ae0..c1294bf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2490,9 +2490,9 @@ dependencies = [ [[package]] name = "rmcp" -version = "0.17.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a0ce46f9101dc911f07e1468084c057839d15b08040d110820c5513312ef56a" +checksum = "2231b2c085b371c01bc90c0e6c1cab8834711b6394533375bdbf870b0166d419" dependencies = [ "async-trait", "base64", @@ -2525,9 +2525,9 @@ dependencies = [ [[package]] name = "rmcp-macros" -version = "0.17.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abad6f5f46e220e3bda2fc90fd1ad64c1c2a2bd716d52c845eb5c9c64cda7542" +checksum = "36ea0e100fadf81be85d7ff70f86cd805c7572601d4ab2946207f36540854b43" dependencies = [ "darling 0.23.0", "proc-macro2", diff --git a/Cargo.toml b/Cargo.toml index 29b5724..904b520 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -65,7 +65,7 @@ tokio-util.workspace = true async-trait = "0.1.89" futures-core.workspace = true futures-util.workspace = true -rmcp = { version = "0.17", features = [ +rmcp = { version = "1.3", features = [ "client", "reqwest", "transport-streamable-http-client-reqwest", diff --git a/src/mcp.rs b/src/mcp.rs index b7768df..bb7cc90 100644 --- a/src/mcp.rs +++ b/src/mcp.rs @@ -243,17 +243,12 @@ impl McpManager { }); } }; + let request = match arguments { + Some(arguments) => CallToolRequestParams::new(payload.tool).with_arguments(arguments), + None => CallToolRequestParams::new(payload.tool), + }; let result = self - .with_timeout( - server, - timeout_ms, - peer.call_tool(CallToolRequestParams { - meta: None, - name: payload.tool.into(), - arguments, - task: None, - }), - ) + .with_timeout(server, timeout_ms, peer.call_tool(request)) .await?; let value = serialize_to_json_value(result, "tool result")?; Ok(value) @@ -655,11 +650,8 @@ pub(crate) mod tests { #[tool_handler] impl ServerHandler for TestMcpServer { fn get_info(&self) -> ServerInfo { - ServerInfo { - instructions: Some("Test MCP server".to_string()), - capabilities: ServerCapabilities::builder().enable_tools().build(), - ..Default::default() - } + ServerInfo::new(ServerCapabilities::builder().enable_tools().build()) + .with_instructions("Test MCP server") } } @@ -676,13 +668,12 @@ pub(crate) mod tests { StreamableHttpService::new( || Ok(TestMcpServer::new()), session_manager, - StreamableHttpServerConfig { - stateful_mode: true, - sse_keep_alive: None, - sse_retry: None, - json_response: false, - cancellation_token: CancellationToken::new(), - }, + StreamableHttpServerConfig::default() + .with_sse_keep_alive(None) + .with_sse_retry(None) + .with_stateful_mode(true) + .with_json_response(false) + .with_cancellation_token(CancellationToken::new()), ); let listener = TcpListener::bind("127.0.0.1:0") .await