diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2a7210f1..b2f7e27a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -177,4 +177,10 @@ jobs: # Depth 2 covers every remaining individual feature and pair, while the # regular CI all-features tests cover their full union without making # this matrix grow exponentially. - run: cargo hack check --workspace --feature-powerset --depth 2 --exclude-features default,unstable,wasm_js --no-dev-deps --partition ${{ matrix.partition }} + # + # There is no `--no-dev-deps`. That flag removes dev-dependencies from + # the manifests while cargo-hack runs, so Cargo reports the workspace + # dependencies only they inherit as unused. It is also not needed: + # with resolver 3, dev-dependencies do not add features to the + # library and binary targets this command checks. + run: cargo hack check --workspace --feature-powerset --depth 2 --exclude-features default,unstable,wasm_js --partition ${{ matrix.partition }} diff --git a/md/features.md b/md/features.md index 786b7336..b2e68378 100644 --- a/md/features.md +++ b/md/features.md @@ -77,7 +77,7 @@ Internal crates request only the core capabilities they use: | --- | --- | | HTTP client/server | None; transport sides remain opt-in through `client` and `server` | | MCP-over-ACP polyfill | `unstable_mcp_over_acp`, with independent draft-v2 and session-fork passthrough features | -| rmcp integration | `schemars`; one feature per rmcp major version (`rmcp_3`), and an `unstable_mcp_over_acp` passthrough feature. It has no draft-v2 feature: enable `unstable_protocol_v2` on `agent-client-protocol` itself | +| rmcp integration | `schemars`; one feature per rmcp major version (`rmcp_3`), and an `unstable_mcp_over_acp` passthrough feature. The core crate is only a dependency with an rmcp version feature, so the passthrough does nothing on its own. It has no draft-v2 feature: enable `unstable_protocol_v2` on `agent-client-protocol` itself | | Conductor | `process`, `stdio`, and `unstable_mcp_over_acp` for launching components, serving stdio, and classifying MCP traces | | YOPO | `process` for launching the agent | | Test utilities | `process` and `stdio` for fixture binaries and launch helpers | diff --git a/src/agent-client-protocol-cookbook/src/lib.rs b/src/agent-client-protocol-cookbook/src/lib.rs index d34bda36..e7df35e1 100644 --- a/src/agent-client-protocol-cookbook/src/lib.rs +++ b/src/agent-client-protocol-cookbook/src/lib.rs @@ -56,6 +56,10 @@ //! [`Proxy`]: agent_client_protocol::Proxy //! [`ConnectTo`]: agent_client_protocol::ConnectTo +// Only rustdoc links and doctests use this crate. Name it here so that Cargo +// does not report the dependency as unused. +use agent_client_protocol_rmcp as _; + pub mod ordered_application_dispatch; pub mod v2_session_coordination { diff --git a/src/agent-client-protocol-rmcp/Cargo.toml b/src/agent-client-protocol-rmcp/Cargo.toml index b411bdfb..42644dea 100644 --- a/src/agent-client-protocol-rmcp/Cargo.toml +++ b/src/agent-client-protocol-rmcp/Cargo.toml @@ -18,11 +18,25 @@ rustdoc-args = ["--cfg", "docsrs"] # No rmcp version is enabled by default. Each supported rmcp major version has # its own feature and module; features are additive. default = [] -# rmcp 3.x integration in the `rmcp_3` module. -rmcp_3 = ["dep:rmcp_3"] +# rmcp 3.x integration in the `rmcp_3` module. Without an rmcp version feature +# the crate is empty, so the dependencies the integration uses are optional +# and enabled here. +rmcp_3 = [ + "dep:rmcp_3", + "dep:agent-client-protocol", + "dep:futures", + "dep:futures-concurrency", + "dep:schemars", + "dep:serde", + "dep:serde_json", + "dep:tokio", + "dep:tokio-util", +] # Passthrough feature for the core crate's `unstable_mcp_over_acp`. The native -# MCP-over-ACP path follows the core feature however it is enabled. -unstable_mcp_over_acp = ["agent-client-protocol/unstable_mcp_over_acp"] +# MCP-over-ACP path follows the core feature however it is enabled. On its own +# it enables nothing, because the core crate is only a dependency with an +# rmcp version feature. +unstable_mcp_over_acp = ["agent-client-protocol?/unstable_mcp_over_acp"] [[example]] name = "with_mcp_server" @@ -34,16 +48,16 @@ name = "stateless_native_mcp" required-features = ["rmcp_3", "unstable_mcp_over_acp"] [dependencies] -agent-client-protocol = { workspace = true, features = ["schemars"] } -futures.workspace = true -futures-concurrency.workspace = true +agent-client-protocol = { workspace = true, optional = true, features = ["schemars"] } +futures = { workspace = true, optional = true } +futures-concurrency = { workspace = true, optional = true } # Keep the version and features in step with the workspace `rmcp` entry. rmcp_3 = { package = "rmcp", version = "3.4.0", optional = true, default-features = false, features = ["server", "schemars"] } -schemars.workspace = true -serde.workspace = true -serde_json.workspace = true -tokio = { workspace = true, features = ["io-util", "macros", "rt"] } -tokio-util = { workspace = true, features = ["rt"] } +schemars = { workspace = true, optional = true } +serde = { workspace = true, optional = true } +serde_json = { workspace = true, optional = true } +tokio = { workspace = true, optional = true, features = ["io-util", "macros", "rt"] } +tokio-util = { workspace = true, optional = true, features = ["rt"] } [dev-dependencies] # The `stateless_native_mcp` example attaches a server to a v2 proxy. diff --git a/src/agent-client-protocol-rmcp/README.md b/src/agent-client-protocol-rmcp/README.md index e5daeb83..27f1f0b9 100644 --- a/src/agent-client-protocol-rmcp/README.md +++ b/src/agent-client-protocol-rmcp/README.md @@ -10,7 +10,8 @@ Rust, serve them directly, or attach them to an ACP proxy. Each supported rmcp major version has its own module behind a matching Cargo feature. No rmcp feature is enabled by default; without one, this crate is -empty. Enable the feature for the rmcp major version your application uses: +empty and has no dependencies. Enable the feature for the rmcp major version +your application uses: | Feature | Module | rmcp | | -------- | ------------------------------------- | ---- |