diff --git a/Cargo.lock b/Cargo.lock index 8b98347..5b7e494 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -96,10 +96,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1aa79e62e7697b8e29b513a68abacf485adcd1fe8284a4316c5ae868e6633327" dependencies = [ "iana-time-zone", - "js-sys", "num-traits", "serde", - "wasm-bindgen", "windows-link", ] @@ -751,9 +749,9 @@ checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4" [[package]] name = "rmcp" -version = "0.16.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc4c9c94680f75470ee8083a0667988b5d7b5beb70b9f998a8e51de7c682ce60" +checksum = "0810a9f717d9828f475fe1f629f4c305c8464b7f496c3a854b58d29e65f4058e" dependencies = [ "async-trait", "base64", @@ -773,9 +771,9 @@ dependencies = [ [[package]] name = "rmcp-macros" -version = "0.16.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90c23c8f26cae4da838fbc3eadfaecf2d549d97c04b558e7bd90526a9c28b42a" +checksum = "6aefac48c364756e97f04c0401ba3231e8607882c7c1d92da0437dc16307904d" dependencies = [ "darling", "proc-macro2", diff --git a/Cargo.toml b/Cargo.toml index eddcc58..0848287 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,7 @@ homepage = "https://github.com/MichaelAdamGroberman/linux-mcp" readme = "README.md" [workspace.dependencies] -rmcp = { version = "0.16", features = ["server", "transport-io", "macros"] } +rmcp = { version = "1.7", features = ["server", "transport-io", "macros"] } tokio = { version = "1", features = ["macros", "rt-multi-thread", "io-std", "process", "fs", "time", "sync"] } serde = { version = "1", features = ["derive"] } serde_json = "1" diff --git a/crates/linux-mcp/src/server.rs b/crates/linux-mcp/src/server.rs index cd35a41..acd9ad6 100644 --- a/crates/linux-mcp/src/server.rs +++ b/crates/linux-mcp/src/server.rs @@ -42,42 +42,30 @@ impl LinuxMcpServer { Value::Object(m) => m, _ => Map::new(), }; - Tool { - name: name.to_string().into(), - title: None, - description: Some(desc.to_string().into()), - input_schema: Arc::new(map), - output_schema: None, - annotations: None, - execution: None, - icons: None, - meta: None, - } + // rmcp 1.x marks `Tool` `#[non_exhaustive]`, so construct via the + // `new` constructor (title/output_schema/annotations/etc. default to None). + Tool::new(name.to_string(), desc.to_string(), Arc::new(map)) } } impl ServerHandler for LinuxMcpServer { fn get_info(&self) -> ServerInfo { - ServerInfo { - protocol_version: ProtocolVersion::V_2025_06_18, - capabilities: ServerCapabilities::builder().enable_tools().build(), - server_info: Implementation { - name: "linux-mcp".into(), - title: Some("Linux Native Control".into()), - version: linux_mcp_core::VERSION.into(), - description: Some( - "Native Linux MCP server: filesystem, process, clipboard, screenshots, windows, input." - .into(), - ), - icons: None, - website_url: Some("https://github.com/MichaelAdamGroberman/linux-mcp".into()), - }, - instructions: Some( + // rmcp 1.x marks ServerInfo (= InitializeResult) and Implementation + // `#[non_exhaustive]`, so build them via constructors + `with_*` setters. + let server_info = Implementation::new("linux-mcp", linux_mcp_core::VERSION) + .with_title("Linux Native Control") + .with_description( + "Native Linux MCP server: filesystem, process, clipboard, screenshots, windows, input.", + ) + .with_website_url("https://github.com/MichaelAdamGroberman/linux-mcp"); + + ServerInfo::new(ServerCapabilities::builder().enable_tools().build()) + .with_protocol_version(ProtocolVersion::V_2025_06_18) + .with_server_info(server_info) + .with_instructions( "Linux native control. Filesystem + process tools are allow-listed via \ - LINUX_MCP_FS_ALLOW / LINUX_MCP_PROCESS_ALLOW. Display tools detect X11/Wayland." - .into(), - ), - } + LINUX_MCP_FS_ALLOW / LINUX_MCP_PROCESS_ALLOW. Display tools detect X11/Wayland.", + ) } fn list_tools(