SEP-2577: Deprecate Roots, Sampling, and Logging — rust-sdk implementation
Spec PR: modelcontextprotocol/modelcontextprotocol#2577
Track: Specification · Stage: final · Priority: P1
Needs code changes: Yes (Small) — advisory only, no wire change
Summary
Deprecates three core protocol features — Roots, Sampling, and Logging. Features remain
fully functional in all spec versions released within one year of the deprecating version. There
are no wire-level protocol changes; the deprecation is advisory, signaling the ecosystem to plan
for eventual removal.
Why this needs code changes in rust-sdk
No wire change, but to align with the spec the SDK should mark the corresponding Rust APIs as
deprecated so downstream users get compiler warnings and migration guidance. Concrete targets:
- Sampling:
ServerPeer::create_message(..) (service/server.rs:415); sampling capability bits in model/capabilities.rs (SamplingCapability, enable_sampling* builders) and SamplingTaskCapability.
- Roots:
method!(peer_req list_roots ListRootsRequest() => ListRootsResult) (service/server.rs:444); RootsCapabilities + enable_roots* builders in model/capabilities.rs; ListRootsResult/roots request types in model.rs.
- Logging: client
method!(peer_req set_level SetLevelRequest(..)) (service/client.rs:357); server method!(peer_not notify_logging_message LoggingMessageNotification(..)) (service/server.rs:454); enable_logging builder; LoggingMessageNotification / SetLevelRequest types.
Caveat: several of these are generated by the internal method! macro and the capability builders
are macro-generated too, so #[deprecated] may need to be applied at the macro-invocation site (or
the macro taught to forward a #[deprecated] attribute) rather than on a hand-written fn.
Proposed work
Affected areas
crates/rmcp/src/service/server.rs (create_message, list_roots, notify_logging_message),
crates/rmcp/src/service/client.rs (set_level), model/capabilities.rs (capability structs + builders),
model.rs (roots/logging request/result types), and possibly the method! macro definition.
Notes / risks
- Purely additive deprecation annotations; no behavioral/wire change. Coordinate wording with SEP-2596 (feature lifecycle policy) once that lands.
SEP-2577: Deprecate Roots, Sampling, and Logging — rust-sdk implementation
Spec PR: modelcontextprotocol/modelcontextprotocol#2577
Track: Specification · Stage: final · Priority: P1
Needs code changes: Yes (Small) — advisory only, no wire change
Summary
Deprecates three core protocol features — Roots, Sampling, and Logging. Features remain
fully functional in all spec versions released within one year of the deprecating version. There
are no wire-level protocol changes; the deprecation is advisory, signaling the ecosystem to plan
for eventual removal.
Why this needs code changes in rust-sdk
No wire change, but to align with the spec the SDK should mark the corresponding Rust APIs as
deprecated so downstream users get compiler warnings and migration guidance. Concrete targets:
ServerPeer::create_message(..)(service/server.rs:415); sampling capability bits inmodel/capabilities.rs(SamplingCapability,enable_sampling*builders) andSamplingTaskCapability.method!(peer_req list_roots ListRootsRequest() => ListRootsResult)(service/server.rs:444);RootsCapabilities+enable_roots*builders inmodel/capabilities.rs;ListRootsResult/roots request types inmodel.rs.method!(peer_req set_level SetLevelRequest(..))(service/client.rs:357); servermethod!(peer_not notify_logging_message LoggingMessageNotification(..))(service/server.rs:454);enable_loggingbuilder;LoggingMessageNotification/SetLevelRequesttypes.Caveat: several of these are generated by the internal
method!macro and the capability buildersare macro-generated too, so
#[deprecated]may need to be applied at the macro-invocation site (orthe macro taught to forward a
#[deprecated]attribute) rather than on a hand-writtenfn.Proposed work
#[deprecated(since = "0.x.0", note = "Deprecated by SEP-2577; see <url>")]to the sampling/roots/logging public surface — including themethod!-generatedlist_roots/set_level/notify_logging_messageandcreate_message.enable_roots*,enable_sampling*,enable_logging) and capability structs inmodel/capabilities.rs.#[allow(deprecated)]at the crate's own internal call sites (the SDK's own handlers/tests use these) so the build stays warning-clean.Affected areas
crates/rmcp/src/service/server.rs(create_message,list_roots,notify_logging_message),crates/rmcp/src/service/client.rs(set_level),model/capabilities.rs(capability structs + builders),model.rs(roots/logging request/result types), and possibly themethod!macro definition.Notes / risks