feat(transport): add which_command for cross-platform executable resolution (#774)
* feat(transport): add which_command for cross-platform executable resolution Adds a `which_command()` helper that resolves executable paths via the `which` crate before constructing a `tokio::process::Command`. This fixes Windows failures where `.cmd` shim scripts (e.g. `npx.cmd`) are not found by `Command::new()` without a fully-qualified path. Closes #456 * refactor(transport): move which_command behind opt-in feature flag Address review feedback: the `which` dependency is now gated behind a separate `which-command` feature flag instead of being bundled into `transport-child-process`. Users on Linux/macOS who don't need cross-platform executable resolution no longer pull in the extra crate. Also fixes the doc example import path to use the re-exported `rmcp::transport::which_command`.
This commit is contained in:
parent
8e22aa2de2
commit
cabf71aa74
1 changed files with 59 additions and 0 deletions
|
|
@ -81,6 +81,9 @@ tower-service = { version = "0.3", optional = true }
|
|||
# for child process transport
|
||||
process-wrap = { version = "9.0", features = ["tokio1"], optional = true }
|
||||
|
||||
# for cross-platform executable path resolution
|
||||
which = { version = "7", optional = true }
|
||||
|
||||
# for ws transport
|
||||
# tokio-tungstenite ={ version = "0.26", optional = true }
|
||||
|
||||
|
|
@ -163,6 +166,10 @@ transport-child-process = [
|
|||
"tokio/process",
|
||||
"dep:process-wrap",
|
||||
]
|
||||
which-command = [
|
||||
"transport-child-process",
|
||||
"dep:which",
|
||||
]
|
||||
transport-streamable-http-server = [
|
||||
"transport-streamable-http-server-session",
|
||||
"server-side-http",
|
||||
|
|
|
|||
Loading…
Reference in a new issue