From c10e172c748c9c14273b1b735afb4a15938e8e1a Mon Sep 17 00:00:00 2001 From: Gautam Korlam Date: Wed, 26 Aug 2026 15:42:28 -0700 Subject: [PATCH] [Deps] Put clap behind an optional cli feature --- Cargo.toml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index fb828e5..3f9297e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,7 +28,9 @@ async-stream = "0.3" mime_guess = "2" tracing-subscriber = { version = "0.3", features = ["env-filter"] } config = "0.15" -clap = { version = "4", features = ["derive"] } +# Optional: the two binaries below are the only clap users, and a library consumer that +# never builds them was compiling clap plus its 12-crate subtree for nothing. +clap = { version = "4", features = ["derive"], optional = true } reqwest = { version = "0.12", features = ["json"] } reqwest-eventsource = "0.6" mime = "0.3" @@ -38,13 +40,21 @@ tracing-core = "0.1" async-recursion = "1" http = "1.1" +# Off by default so `mcp_rs` as a dependency carries no CLI parser. `required-features` +# makes cargo skip the binaries rather than fail when it is off, so `cargo build` on a +# checkout still succeeds and `--all-features` (what CI runs) still builds and lints them. +[features] +cli = ["dep:clap"] + [[bin]] name = "server" path = "bin/server.rs" +required-features = ["cli"] [[bin]] name = "client" path = "bin/client.rs" +required-features = ["cli"] [lib] name = "mcp_rs"