Repository navigation
feat(rmcp)!: move the rmcp integration behind a versioned rmcp_3 feature - #471
Merged
Merged
Conversation
agent-client-protocol-rmcp now exposes one module per supported rmcp major version, each behind a matching Cargo feature. The rmcp 3.x integration moves to the `rmcp_3` module, enabled by the `rmcp_3` feature, and rmcp becomes an optional dependency renamed to `rmcp_3`. No rmcp feature is enabled by default; without one the crate compiles as an empty crate. The features are purely additive, so support for a future rmcp major version can arrive as a new `rmcp_N` feature and module in a minor release. The `unstable_protocol_v2` and `unstable_mcp_over_acp` passthrough features apply to every rmcp module. docs.rs builds with all features and shows feature badges. The conductor and cookbook enable `rmcp_3`; CI checks the rmcp crate on WASI with `rmcp_3`, checks its docs.rs build, and tests it without the unstable passthrough features. BREAKING CHANGE: enable the `rmcp_3` feature of agent-client-protocol-rmcp and import its items from `agent_client_protocol_rmcp::rmcp_3` instead of the crate root (`McpServerExt`, `McpServerBuilder`, `McpTool`, `EnabledTools`, `tool_fn!`, `tool_fn_mut!`). Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
agent-client-protocol-rmcpnow has one module per supported rmcp major version, each behind a matching Cargo feature, so future rmcp majors can land as minor releases instead of forcing an ACP major.rmcpis now an optional dependency renamed tormcp_3(package = "rmcp",3.4.0,server+schemars, same as the workspace entry). Featurermcp_3 = ["dep:rmcp_3"]. No rmcp feature is on by default.McpServerExt,McpServerBuilder, re-exports ofMcpTool,EnabledTools,tool_fn!,tool_fn_mut!) moves toagent_client_protocol_rmcp::rmcp_3. The crate root only holds docs, and nothing there depends on which rmcp features are on. Enabling a futurermcp_4would only add anrmcp_4module.compile_error!.unstable_protocol_v2andunstable_mcp_over_acppassthrough features are unchanged and apply to every rmcp module.all-features = trueplus--cfg docsrs, and adoc(cfg)badge on the module, the same setup as the core crate.Naming:
rmcp_3for the feature, module and dependencyThe crate's existing features are snake_case (
unstable_mcp_over_acp,unstable_protocol_v2), so a hyphenatedrmcp-3would be the odd one out. Using one identifier for the feature, the module and the renamed dependency meanscfg(feature = "rmcp_3"),rmcp_3::McpServerExtanddep:rmcp_3all read the same and grep together. Inside the crate, each module file importsuse ::rmcp_3 as rmcp;, so the existingrmcp::paths are unchanged.Tests and examples use a dev-dependency also named
rmcp_3(withmacros), because Cargo rejects the same package under two names. Each one doesextern crate rmcp_3 as rmcp;so rmcp's macros keep resolving.Dependents
rmcp_3and import fromrmcp_3::. Their own directrmcpdependencies are unchanged. Testy (agent-client-protocol-test) usesrmcpdirectly and not the integration crate, so it needs no change.ignoredoctests in the core crate that mention the integration now use the new path.Docs
md/migration-v4.mdhas a new section on enablingrmcp_3, with the before/after import table.design.md,features.md,transport-architecture.mdandmcp-over-acp.mdmention the feature, and the example commands includermcp_3..release-plz.tomlcomment now says rmcp majors arrive as features in minor releases.CI
--features rmcp_3; otherwise it would only check an empty crate.agent-client-protocol-rmcp.just testalso runscargo test -p agent-client-protocol-rmcp --features rmcp_3, which covers the integration without the unstable passthrough features.Test plan
cargo fmt -- --checkcargo clippy --workspace --all-targets --all-features -- -D warnings, plaincargo clippy -- -D warnings, and-p agent-client-protocol-rmcp --no-default-features(lib and all targets)cargo hack check --workspace --feature-powerset --depth 2 --exclude-features default,unstable,wasm_js --no-dev-depscargo test --workspace --all-features --locked --no-fail-fast(onlyagent-client-protocol-derive --libfails, a local dyld/runner issue that also happens on main)cargo test -p agent-client-protocol-rmcp --features rmcp_3 --locked, and with no featuresRUSTDOCFLAGS="-D warnings" cargo doc -p agent-client-protocol-rmcp, with all features and with none; nightly--cfg docsrsdocs buildcargo check -p agent-client-protocol-rmcp --lib --target wasm32-wasip2 --features rmcp_3mdbook build