From 5a6e979a778977ae2bb6c1052fc32df7632e1245 Mon Sep 17 00:00:00 2001 From: Jean Mertz Date: Tue, 10 Mar 2026 20:09:55 +0100 Subject: [PATCH] build(cargo): update `rmcp` dependency This commit updates the `rmcp` dependency to the latest version from the official Model Context Protocol Rust SDK repository. The update requires several changes in the `jp_mcp` crate to align with the new API, including: - Switching from `CallToolRequestParam` and `ReadResourceRequestParam` to the new `CallToolRequestParams` and `ReadResourceRequestParams` structs. - Updating `TokioChildProcess` initialization to use the new builder pattern. - Refactoring error handling to accommodate changes in the `rmcp` error types and service initialization flow. Signed-off-by: Jean Mertz --- .clippy.toml | 4 + .config/supply-chain/audits.toml | 45 +++++++ .config/supply-chain/config.toml | 22 ---- .config/supply-chain/imports.lock | 164 ++++++++++++++++------- Cargo.lock | 209 +++++++++++++++++++++--------- Cargo.toml | 4 +- crates/jp_conversation/src/lib.rs | 4 - crates/jp_llm/src/tool.rs | 2 +- crates/jp_mcp/Cargo.toml | 2 +- crates/jp_mcp/src/client.rs | 33 ++--- crates/jp_mcp/src/error.rs | 11 +- deny.toml | 1 - 12 files changed, 340 insertions(+), 161 deletions(-) diff --git a/.clippy.toml b/.clippy.toml index 275165b1..68dbbb23 100644 --- a/.clippy.toml +++ b/.clippy.toml @@ -7,7 +7,11 @@ doc-valid-idents = ["OpenAI", "OpenRouter", "CommonMark", "LlamaCPP", ".."] allow-unwrap-in-tests = true allow-print-in-tests = true allowed-duplicate-crates = [ + "windows-core", + "windows-implement", + "windows-interface", "windows-link", + "windows-result", "windows-targets", "windows_aarch64_gnullvm", "windows_aarch64_msvc", diff --git a/.config/supply-chain/audits.toml b/.config/supply-chain/audits.toml index 43d29cef..d68dc5f8 100644 --- a/.config/supply-chain/audits.toml +++ b/.config/supply-chain/audits.toml @@ -31,11 +31,21 @@ who = "Jean Mertz " criteria = "safe-to-deploy" delta = "0.35.0 -> 0.36.0" +[[audits.nix]] +who = "Jean Mertz " +criteria = "safe-to-deploy" +version = "0.15.0" + [[audits.ollama-rs]] who = "Jean Mertz " criteria = "safe-to-deploy" delta = "0.3.3 -> 0.3.4" +[[audits.process-wrap]] +who = "Jean Mertz " +criteria = "safe-to-deploy" +version = "9.0.0" + [[audits.quick-xml]] who = "Jean Mertz " criteria = "safe-to-deploy" @@ -51,6 +61,11 @@ who = "Jean Mertz " criteria = "safe-to-deploy" delta = "0.3.0 -> 0.4.0" +[[audits.rmcp]] +who = "Jean Mertz " +criteria = "safe-to-deploy" +version = "1.1.1" + [[audits.rsqlite-vfs]] who = "Jean Mertz " criteria = "safe-to-deploy" @@ -907,12 +922,24 @@ user-id = 64539 # Kenny Kerr (kennykerr) start = "2021-01-15" end = "2027-02-13" +[[trusted.windows-collections]] +criteria = "safe-to-deploy" +user-id = 64539 # Kenny Kerr (kennykerr) +start = "2025-02-06" +end = "2027-03-10" + [[trusted.windows-core]] criteria = "safe-to-deploy" user-id = 64539 # Kenny Kerr (kennykerr) start = "2021-11-15" end = "2027-02-13" +[[trusted.windows-future]] +criteria = "safe-to-deploy" +user-id = 64539 # Kenny Kerr (kennykerr) +start = "2025-02-10" +end = "2027-03-10" + [[trusted.windows-implement]] criteria = "safe-to-deploy" user-id = 64539 # Kenny Kerr (kennykerr) @@ -925,12 +952,24 @@ user-id = 64539 # Kenny Kerr (kennykerr) start = "2022-02-18" end = "2027-02-13" +[[trusted.windows-numerics]] +criteria = "safe-to-deploy" +user-id = 64539 # Kenny Kerr (kennykerr) +start = "2023-05-15" +end = "2027-03-10" + [[trusted.windows-result]] criteria = "safe-to-deploy" user-id = 64539 # Kenny Kerr (kennykerr) start = "2024-02-02" end = "2027-02-13" +[[trusted.windows-strings]] +criteria = "safe-to-deploy" +user-id = 64539 # Kenny Kerr (kennykerr) +start = "2024-02-02" +end = "2027-03-10" + [[trusted.windows-sys]] criteria = "safe-to-deploy" user-id = 64539 # Kenny Kerr (kennykerr) @@ -943,6 +982,12 @@ user-id = 64539 # Kenny Kerr (kennykerr) start = "2022-09-09" end = "2027-02-13" +[[trusted.windows-threading]] +criteria = "safe-to-deploy" +user-id = 64539 # Kenny Kerr (kennykerr) +start = "2025-04-29" +end = "2027-03-10" + [[trusted.windows_aarch64_gnullvm]] criteria = "safe-to-deploy" user-id = 64539 # Kenny Kerr (kennykerr) diff --git a/.config/supply-chain/config.toml b/.config/supply-chain/config.toml index 68b3152f..d4b6608d 100644 --- a/.config/supply-chain/config.toml +++ b/.config/supply-chain/config.toml @@ -46,12 +46,6 @@ audit-as-crates-io = true [policy.openai_responses] audit-as-crates-io = true -[policy.rmcp] -audit-as-crates-io = true - -[policy.rmcp-macros] -audit-as-crates-io = true - [policy.saphyr] audit-as-crates-io = true @@ -531,14 +525,6 @@ criteria = "safe-to-deploy" version = "0.17.14" criteria = "safe-to-deploy" -[[exemptions.rmcp]] -version = "0.1.5@git:18346b94e4e71463a06d93852cfc26c683ca5b83" -criteria = "safe-to-deploy" - -[[exemptions.rmcp-macros]] -version = "0.1.5@git:18346b94e4e71463a06d93852cfc26c683ca5b83" -criteria = "safe-to-deploy" - [[exemptions.rusqlite]] version = "0.37.0" criteria = "safe-to-deploy" @@ -575,14 +561,6 @@ criteria = "safe-to-run" version = "0.1.28" criteria = "safe-to-deploy" -[[exemptions.schemars]] -version = "0.8.22" -criteria = "safe-to-deploy" - -[[exemptions.schemars_derive]] -version = "0.8.22" -criteria = "safe-to-deploy" - [[exemptions.schemars_derive]] version = "1.0.4" criteria = "safe-to-deploy" diff --git a/.config/supply-chain/imports.lock b/.config/supply-chain/imports.lock index cb835ae0..d4bb975d 100644 --- a/.config/supply-chain/imports.lock +++ b/.config/supply-chain/imports.lock @@ -798,6 +798,20 @@ user-id = 189 user-login = "BurntSushi" user-name = "Andrew Gallant" +[[publisher.windows]] +version = "0.61.3" +when = "2025-06-12" +user-id = 64539 +user-login = "kennykerr" +user-name = "Kenny Kerr" + +[[publisher.windows-collections]] +version = "0.2.0" +when = "2025-03-18" +user-id = 64539 +user-login = "kennykerr" +user-name = "Kenny Kerr" + [[publisher.windows-core]] version = "0.56.0" when = "2024-04-12" @@ -805,6 +819,20 @@ user-id = 64539 user-login = "kennykerr" user-name = "Kenny Kerr" +[[publisher.windows-core]] +version = "0.61.2" +when = "2025-05-19" +user-id = 64539 +user-login = "kennykerr" +user-name = "Kenny Kerr" + +[[publisher.windows-future]] +version = "0.2.1" +when = "2025-05-15" +user-id = 64539 +user-login = "kennykerr" +user-name = "Kenny Kerr" + [[publisher.windows-implement]] version = "0.56.0" when = "2024-04-12" @@ -812,6 +840,13 @@ user-id = 64539 user-login = "kennykerr" user-name = "Kenny Kerr" +[[publisher.windows-implement]] +version = "0.60.2" +when = "2025-10-06" +user-id = 64539 +user-login = "kennykerr" +user-name = "Kenny Kerr" + [[publisher.windows-interface]] version = "0.56.0" when = "2024-04-12" @@ -819,6 +854,20 @@ user-id = 64539 user-login = "kennykerr" user-name = "Kenny Kerr" +[[publisher.windows-interface]] +version = "0.59.3" +when = "2025-10-06" +user-id = 64539 +user-login = "kennykerr" +user-name = "Kenny Kerr" + +[[publisher.windows-numerics]] +version = "0.2.0" +when = "2025-03-18" +user-id = 64539 +user-login = "kennykerr" +user-name = "Kenny Kerr" + [[publisher.windows-result]] version = "0.1.2" when = "2024-06-07" @@ -826,6 +875,20 @@ user-id = 64539 user-login = "kennykerr" user-name = "Kenny Kerr" +[[publisher.windows-result]] +version = "0.3.4" +when = "2025-05-19" +user-id = 64539 +user-login = "kennykerr" +user-name = "Kenny Kerr" + +[[publisher.windows-strings]] +version = "0.4.2" +when = "2025-05-19" +user-id = 64539 +user-login = "kennykerr" +user-name = "Kenny Kerr" + [[publisher.windows-sys]] version = "0.52.0" when = "2023-11-15" @@ -868,6 +931,13 @@ user-id = 64539 user-login = "kennykerr" user-name = "Kenny Kerr" +[[publisher.windows-threading]] +version = "0.1.0" +when = "2025-05-15" +user-id = 64539 +user-login = "kennykerr" +user-name = "Kenny Kerr" + [[publisher.windows_aarch64_gnullvm]] version = "0.52.6" when = "2024-07-03" @@ -1040,12 +1110,6 @@ criteria = "safe-to-deploy" version = "1.1.2" notes = "Contains `unsafe` code but it's well-documented and scoped to what it's intended to be doing. Otherwise a well-focused and straightforward crate." -[[audits.bytecode-alliance.audits.base64]] -who = "Pat Hickey " -criteria = "safe-to-deploy" -version = "0.21.0" -notes = "This crate has no dependencies, no build.rs, and contains no unsafe code." - [[audits.bytecode-alliance.audits.bitflags]] who = "Jamey Sharp " criteria = "safe-to-deploy" @@ -2408,21 +2472,6 @@ See https://crrev.com/c/6323349 for more audit notes. """ aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT" -[[audits.isrg.audits.base64]] -who = "Tim Geoghegan " -criteria = "safe-to-deploy" -delta = "0.21.0 -> 0.21.1" - -[[audits.isrg.audits.base64]] -who = "Brandon Pitman " -criteria = "safe-to-deploy" -delta = "0.21.1 -> 0.21.2" - -[[audits.isrg.audits.base64]] -who = "David Cook " -criteria = "safe-to-deploy" -delta = "0.21.2 -> 0.21.3" - [[audits.isrg.audits.block-buffer]] who = "David Cook " criteria = "safe-to-deploy" @@ -2976,6 +3025,54 @@ criteria = "safe-to-deploy" delta = "0.7.5 -> 0.8.0" aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" +[[audits.mozilla.audits.nix]] +who = "Gabriele Svelto " +criteria = "safe-to-deploy" +delta = "0.15.0 -> 0.25.0" +notes = "Plenty of new bindings but also several important bug fixes (including buffer overflows). New unsafe sections are restricted to wrappers and are no more dangerous than calling the C functions." +aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" + +[[audits.mozilla.audits.nix]] +who = "Mike Hommey " +criteria = "safe-to-deploy" +delta = "0.25.0 -> 0.25.1" +aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" + +[[audits.mozilla.audits.nix]] +who = "Mike Hommey " +criteria = "safe-to-deploy" +delta = "0.25.1 -> 0.26.2" +aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" + +[[audits.mozilla.audits.nix]] +who = "Gabriele Svelto " +criteria = "safe-to-deploy" +delta = "0.26.2 -> 0.27.1" +aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" + +[[audits.mozilla.audits.nix]] +who = "Alex Franchuk " +criteria = "safe-to-deploy" +delta = "0.27.1 -> 0.28.0" +notes = """ +Many new features and bugfixes. Obviously there's a lot of unsafe code calling +libc, but the usage looks correct. +""" +aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" + +[[audits.mozilla.audits.nix]] +who = "Alex Franchuk " +criteria = "safe-to-deploy" +delta = "0.28.0 -> 0.29.0" +aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" + +[[audits.mozilla.audits.nix]] +who = "Gabriele Svelto " +criteria = "safe-to-deploy" +delta = "0.29.0 -> 0.30.1" +notes = "Some new wrappers, support for minor platforms and lots of work around type safety that reduces the unsafe surafce." +aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" + [[audits.mozilla.audits.option-ext]] who = "Nika Layzell " criteria = "safe-to-deploy" @@ -3455,24 +3552,6 @@ delta = "1.4.0 -> 1.5.0" notes = "Filesystem change is to remove the generated LLVM IR output file after probing." aggregated-from = "https://raw.githubusercontent.com/zcash/zcash/master/qa/supply-chain/audits.toml" -[[audits.zcash.audits.base64]] -who = "Jack Grigg " -criteria = "safe-to-deploy" -delta = "0.21.3 -> 0.21.4" -aggregated-from = "https://raw.githubusercontent.com/zcash/zcash/master/qa/supply-chain/audits.toml" - -[[audits.zcash.audits.base64]] -who = "Jack Grigg " -criteria = "safe-to-deploy" -delta = "0.21.4 -> 0.21.5" -aggregated-from = "https://raw.githubusercontent.com/zcash/zcash/master/qa/supply-chain/audits.toml" - -[[audits.zcash.audits.base64]] -who = "Daira-Emma Hopwood " -criteria = "safe-to-deploy" -delta = "0.21.5 -> 0.21.7" -aggregated-from = "https://raw.githubusercontent.com/zcash/zcash/master/qa/supply-chain/audits.toml" - [[audits.zcash.audits.block-buffer]] who = "Jack Grigg " criteria = "safe-to-deploy" @@ -3640,10 +3719,3 @@ who = "Jack Grigg " criteria = "safe-to-deploy" delta = "0.1.1 -> 0.1.3" aggregated-from = "https://raw.githubusercontent.com/zcash/librustzcash/main/supply-chain/audits.toml" - -[[audits.zcash.audits.windows-link]] -who = "Jack Grigg " -criteria = "safe-to-deploy" -delta = "0.2.0 -> 0.2.1" -notes = "No code changes at all." -aggregated-from = "https://raw.githubusercontent.com/zcash/librustzcash/main/supply-chain/audits.toml" diff --git a/Cargo.lock b/Cargo.lock index 27afb7c0..59d20d06 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -270,12 +270,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "base64" -version = "0.21.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" - [[package]] name = "base64" version = "0.22.1" @@ -1417,7 +1411,7 @@ dependencies = [ "assert-json-diff", "async-object-pool", "async-trait", - "base64 0.22.1", + "base64", "bytes", "crossbeam-utils", "form_urlencoded", @@ -1498,7 +1492,7 @@ version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c6995591a8f1380fcb4ba966a252a4b29188d51d2b89e3a252f5305be65aea8" dependencies = [ - "base64 0.22.1", + "base64", "bytes", "futures-channel", "futures-core", @@ -1528,7 +1522,7 @@ dependencies = [ "js-sys", "log", "wasm-bindgen", - "windows-core", + "windows-core 0.56.0", ] [[package]] @@ -1926,7 +1920,7 @@ dependencies = [ "quick-xml", "relative-path", "reqwest", - "schemars 1.2.1", + "schemars", "schematic", "serde", "serde_json", @@ -1983,7 +1977,7 @@ name = "jp_conversation" version = "0.1.0" dependencies = [ "assert_matches", - "base64 0.22.1", + "base64", "chrono", "indexmap", "insta", @@ -2047,7 +2041,7 @@ dependencies = [ "async-anthropic", "async-stream", "async-trait", - "base64 0.22.1", + "base64", "camino", "chrono", "futures", @@ -2472,6 +2466,18 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "nix" +version = "0.30.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74523f3a35e05aba87a1d978330aef40f67b0304ac79c1c00b294c9830543db6" +dependencies = [ + "bitflags", + "cfg-if", + "cfg_aliases", + "libc", +] + [[package]] name = "nom" version = "7.1.3" @@ -2518,7 +2524,7 @@ dependencies = [ "async-stream", "log", "reqwest", - "schemars 1.2.1", + "schemars", "serde", "serde_json", "static_assertions", @@ -2784,6 +2790,20 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "process-wrap" +version = "9.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e5fd83ab7fa55fd06f5e665e3fc52b8bca451c0486b8ea60ad649cd1c10a5da" +dependencies = [ + "futures", + "indexmap", + "nix", + "tokio", + "tracing", + "windows", +] + [[package]] name = "proptest" version = "1.9.0" @@ -3022,7 +3042,7 @@ version = "0.12.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eddd3ca559203180a307f12d114c268abf583f59b03cb906fd0b3ff8646c1147" dependencies = [ - "base64 0.22.1", + "base64", "bytes", "encoding_rs", "futures-core", @@ -3092,34 +3112,24 @@ dependencies = [ [[package]] name = "rmcp" -version = "0.1.5" -source = "git+https://github.com/modelcontextprotocol/rust-sdk?rev=18346b94e4e71463a06d93852cfc26c683ca5b83#18346b94e4e71463a06d93852cfc26c683ca5b83" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee4950422f87cf98fffc36946ad672c3024750b3c301491599715b7d6497dfbc" dependencies = [ - "base64 0.21.7", + "async-trait", "chrono", "futures", - "paste", "pin-project-lite", - "rmcp-macros", - "schemars 0.8.22", + "process-wrap", "serde", "serde_json", "thiserror 2.0.18", "tokio", + "tokio-stream", "tokio-util", "tracing", ] -[[package]] -name = "rmcp-macros" -version = "0.1.5" -source = "git+https://github.com/modelcontextprotocol/rust-sdk?rev=18346b94e4e71463a06d93852cfc26c683ca5b83#18346b94e4e71463a06d93852cfc26c683ca5b83" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "rsqlite-vfs" version = "0.1.0" @@ -3283,18 +3293,6 @@ dependencies = [ "windows-sys 0.61.0", ] -[[package]] -name = "schemars" -version = "0.8.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fbf2ae1b8bc8e02df939598064d22402220cd5bbcca1c76f7d6a310974d5615" -dependencies = [ - "dyn-clone", - "schemars_derive 0.8.22", - "serde", - "serde_json", -] - [[package]] name = "schemars" version = "1.2.1" @@ -3303,23 +3301,11 @@ checksum = "a2b42f36aa1cd011945615b92222f6bf73c599a102a300334cd7f8dbeec726cc" dependencies = [ "dyn-clone", "ref-cast", - "schemars_derive 1.2.1", + "schemars_derive", "serde", "serde_json", ] -[[package]] -name = "schemars_derive" -version = "0.8.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32e265784ad618884abaea0600a9adf15393368d840e0222d101a072f3f7534d" -dependencies = [ - "proc-macro2", - "quote", - "serde_derive_internals", - "syn", -] - [[package]] name = "schemars_derive" version = "1.2.1" @@ -4079,7 +4065,7 @@ name = "tools" version = "0.1.0" dependencies = [ "assert_matches", - "base64 0.22.1", + "base64", "camino", "camino-tempfile", "chrono", @@ -4604,18 +4590,64 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows" +version = "0.61.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9babd3a767a4c1aef6900409f85f5d53ce2544ccdfaa86dad48c91782c6d6893" +dependencies = [ + "windows-collections", + "windows-core 0.61.2", + "windows-future", + "windows-link 0.1.3", + "windows-numerics", +] + +[[package]] +name = "windows-collections" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3beeceb5e5cfd9eb1d76b381630e82c4241ccd0d27f1a39ed41b2760b255c5e8" +dependencies = [ + "windows-core 0.61.2", +] + [[package]] name = "windows-core" version = "0.56.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4698e52ed2d08f8658ab0c39512a7c00ee5fe2688c65f8c0a4f06750d729f2a6" dependencies = [ - "windows-implement", - "windows-interface", - "windows-result", + "windows-implement 0.56.0", + "windows-interface 0.56.0", + "windows-result 0.1.2", "windows-targets 0.52.6", ] +[[package]] +name = "windows-core" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3" +dependencies = [ + "windows-implement 0.60.2", + "windows-interface 0.59.3", + "windows-link 0.1.3", + "windows-result 0.3.4", + "windows-strings", +] + +[[package]] +name = "windows-future" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc6a41e98427b19fe4b73c550f060b59fa592d7d686537eebf9385621bfbad8e" +dependencies = [ + "windows-core 0.61.2", + "windows-link 0.1.3", + "windows-threading", +] + [[package]] name = "windows-implement" version = "0.56.0" @@ -4627,6 +4659,17 @@ dependencies = [ "syn", ] +[[package]] +name = "windows-implement" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "windows-interface" version = "0.56.0" @@ -4638,6 +4681,17 @@ dependencies = [ "syn", ] +[[package]] +name = "windows-interface" +version = "0.59.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "windows-link" version = "0.1.3" @@ -4650,6 +4704,16 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "45e46c0661abb7180e7b9c281db115305d49ca1709ab8242adf09666d2173c65" +[[package]] +name = "windows-numerics" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9150af68066c4c5c07ddc0ce30421554771e528bde427614c61038bc2c92c2b1" +dependencies = [ + "windows-core 0.61.2", + "windows-link 0.1.3", +] + [[package]] name = "windows-result" version = "0.1.2" @@ -4659,6 +4723,24 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows-result" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" +dependencies = [ + "windows-link 0.1.3", +] + +[[package]] +name = "windows-strings" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57" +dependencies = [ + "windows-link 0.1.3", +] + [[package]] name = "windows-sys" version = "0.52.0" @@ -4728,6 +4810,15 @@ dependencies = [ "windows_x86_64_msvc 0.53.0", ] +[[package]] +name = "windows-threading" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b66463ad2e0ea3bbf808b7f1d371311c80e115c0b71d60efc142cafbcfb057a6" +dependencies = [ + "windows-link 0.1.3", +] + [[package]] name = "windows_aarch64_gnullvm" version = "0.52.6" diff --git a/Cargo.toml b/Cargo.toml index 80b9530c..633d3473 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -63,9 +63,9 @@ grep-searcher = { version = "0.1", default-features = false } httpmock = { git = "https://github.com/JeanMertz/httpmock", branch = "tweaks", default-features = false } humantime = { version = "2", default-features = false } ignore = { version = "0.4", default-features = false } -infer = { version = "0.19", default-features = false } indexmap = { version = "2", default-features = false } indoc = { version = "2", default-features = false } +infer = { version = "0.19", default-features = false } inquire = { git = "https://github.com/JeanMertz/inquire", branch = "merged", default-features = false } # insta = { version = "1", default-features = false } linkme = { version = "0.3", default-features = false } @@ -83,7 +83,7 @@ rayon = { version = "1", default-features = false } relative-path = { version = "2", default-features = false } reqwest = { version = "0.12", default-features = false } reqwest-eventsource = { version = "0.6", default-features = false } -rmcp = { git = "https://github.com/modelcontextprotocol/rust-sdk", rev = "18346b94e4e71463a06d93852cfc26c683ca5b83" } +rmcp = { version = "1.1", default-features = false } rusqlite = { version = "0.38", default-features = false } saphyr = { git = "https://github.com/JeanMertz/saphyr", branch = "jean/fix-multinewline-endings", default-features = false } # schemars = { version = "1.0.0-alpha.17", default-features = false } diff --git a/crates/jp_conversation/src/lib.rs b/crates/jp_conversation/src/lib.rs index c488a652..9e4438a8 100644 --- a/crates/jp_conversation/src/lib.rs +++ b/crates/jp_conversation/src/lib.rs @@ -22,10 +22,6 @@ rustdoc::all, unused_doc_comments )] -#![expect( - clippy::multiple_crate_versions, - reason = "we need to update rmcp to update base64" -)] pub mod conversation; pub mod error; diff --git a/crates/jp_llm/src/tool.rs b/crates/jp_llm/src/tool.rs index 617ee5f0..e6493025 100644 --- a/crates/jp_llm/src/tool.rs +++ b/crates/jp_llm/src/tool.rs @@ -669,7 +669,7 @@ impl ToolDefinition { ResourceContents::TextResourceContents { text, .. } => Some(text), ResourceContents::BlobResourceContents { blob, .. } => Some(blob), }, - RawContent::Image(_) | RawContent::Audio(_) => None, + RawContent::Image(_) | RawContent::Audio(_) | RawContent::ResourceLink(_) => None, }) .collect::>() .join("\n\n"); diff --git a/crates/jp_mcp/Cargo.toml b/crates/jp_mcp/Cargo.toml index 1aa91d0e..1a982bd2 100644 --- a/crates/jp_mcp/Cargo.toml +++ b/crates/jp_mcp/Cargo.toml @@ -16,7 +16,7 @@ version.workspace = true jp_config = { workspace = true } indexmap = { workspace = true } -rmcp = { workspace = true, features = ["client", "transport-child-process"] } +rmcp = { workspace = true, features = ["client", "transport-child-process", "transport-io"] } serde = { workspace = true } serde_json = { workspace = true, features = ["preserve_order"] } sha1 = { workspace = true } diff --git a/crates/jp_mcp/src/client.rs b/crates/jp_mcp/src/client.rs index ffab2261..444c1500 100644 --- a/crates/jp_mcp/src/client.rs +++ b/crates/jp_mcp/src/client.rs @@ -11,8 +11,8 @@ use indexmap::IndexMap; use jp_config::providers::mcp::{AlgorithmConfig, McpProviderConfig}; use rmcp::{ model::{ - CallToolRequestParam, CallToolResult, ReadResourceRequestParam, Resource, ResourceContents, - Tool, + CallToolRequestParams, CallToolResult, ReadResourceRequestParams, Resource, + ResourceContents, Tool, }, service::{RoleClient, RunningService, ServiceExt}, transport::TokioChildProcess, @@ -135,12 +135,12 @@ impl Client { continue; } + let mut call_params = CallToolRequestParams::new(tool_name.to_owned()); + call_params.arguments = params.as_object().cloned(); + return client .peer() - .call_tool(CallToolRequestParam { - name: tool_name.to_owned().into(), - arguments: params.as_object().cloned(), - }) + .call_tool(call_params) .await .map_err(Into::into); } @@ -174,7 +174,7 @@ impl Client { Ok(client .peer() - .read_resource(ReadResourceRequestParam { uri: uri.into() }) + .read_resource(ReadResourceRequestParams::new(uri)) .await? .contents) } @@ -264,7 +264,6 @@ impl Client { // Create command let mut cmd = Command::new(&config.command); - cmd.stderr(Stdio::null()); cmd.args(&config.arguments); // Add environment variables @@ -273,12 +272,14 @@ impl Client { } // Create the child process transport - let child_process = TokioChildProcess::new(&mut cmd).map_err(|error| { - Error::CannotSpawnProcess { - cmd: cmd.as_std().get_program().to_string_lossy().to_string(), + let cmd_name = cmd.as_std().get_program().to_string_lossy().to_string(); + let (child_process, _stderr) = TokioChildProcess::builder(cmd) + .stderr(Stdio::null()) + .spawn() + .map_err(|error| Error::CannotSpawnProcess { + cmd: cmd_name.clone(), error, - } - })?; + })?; // Create a timeout for the connection let timeout = Duration::from_mins(1); @@ -286,9 +287,9 @@ impl Client { // Serve the client with timeout let client = tokio::time::timeout(timeout, async { ().serve(child_process).await }) .await? - .map_err(|error| Error::ProcessError { - cmd: cmd.as_std().get_program().to_string_lossy().to_string(), - error, + .map_err(|error| Error::InitializeError { + cmd: cmd_name, + error: error.to_string(), })?; Ok(client) diff --git a/crates/jp_mcp/src/error.rs b/crates/jp_mcp/src/error.rs index 77f99847..9fe6dbe5 100644 --- a/crates/jp_mcp/src/error.rs +++ b/crates/jp_mcp/src/error.rs @@ -9,9 +9,6 @@ pub enum Error { #[error("Service error: {0}")] Service(#[from] rmcp::ServiceError), - #[error("MCP error: {0}")] - Mcp(#[from] rmcp::Error), - #[error("Timeout error: {0}")] Timeout(#[from] tokio::time::error::Elapsed), @@ -45,12 +42,8 @@ pub enum Error { error: std::io::Error, }, - #[error("Process error: {cmd}, error: {error}")] - ProcessError { - cmd: String, - #[source] - error: std::io::Error, - }, + #[error("Server initialization error: {cmd}, error: {error}")] + InitializeError { cmd: String, error: String }, #[error("Cannot read file: {path}, error: {error}")] CannotReadFile { diff --git a/deny.toml b/deny.toml index 9cc4ce6a..23ae1ce9 100644 --- a/deny.toml +++ b/deny.toml @@ -34,6 +34,5 @@ allow-git = [ "https://github.com/JeanMertz/openai-responses-rs", "https://github.com/JeanMertz/saphyr?branch=jean/fix-valid-literal-block-scalar-check", "https://github.com/JeanMertz/schematic?branch=merged", - "https://github.com/modelcontextprotocol/rust-sdk", "https://github.com/zkat/miette", ]