feat: deprecate roots, sampling, and logging (SEP-2577) (#884)
SEP-2577 deprecates the Roots, Sampling, and Logging features. The deprecation is advisory: the features stay fully functional and there is no wire-level change. Mark the corresponding Rust APIs as deprecated so downstream users get compiler warnings and migration guidance. - Forward attributes through the service `method!` macros and deprecate `Peer::create_message`, `Peer::list_roots`, `Peer::set_level`, and `Peer::notify_logging_message`. - Forward per-field attributes through the capability `builder!` macro and deprecate the generated `enable_roots`, `enable_sampling`, and `enable_logging` builders, plus the hand-written `enable_roots_list_changed`, `enable_sampling_tools`, and `enable_sampling_context`. - Document the deprecation on the capability types and fields, and in the README feature sections. - Allow `deprecated` at the crate's own call sites so the build stays warning-clean, and refresh the message schema snapshots.
This commit is contained in:
parent
254f04a764
commit
82b04a31f5
1 changed files with 132 additions and 38 deletions
|
|
@ -471,6 +471,8 @@ context.peer.notify_prompt_list_changed().await?;
|
|||
|
||||
## Sampling
|
||||
|
||||
> **Deprecated (SEP-2577):** Sampling is deprecated and will be removed in a future release. It remains fully functional for now. See [SEP-2577](https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2577).
|
||||
|
||||
Sampling flips the usual direction: the server asks the client to run an LLM completion. The server sends a `create_message` request, the client processes it through its LLM, and returns the result.
|
||||
|
||||
**MCP Spec:** [Sampling](https://modelcontextprotocol.io/specification/2025-11-25/client/sampling)
|
||||
|
|
@ -544,6 +546,8 @@ impl ClientHandler for MyClient {
|
|||
|
||||
## Roots
|
||||
|
||||
> **Deprecated (SEP-2577):** Roots is deprecated and will be removed in a future release. It remains fully functional for now. See [SEP-2577](https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2577).
|
||||
|
||||
Roots tell servers which directories or projects the client is working in. A root is a URI (typically `file://`) pointing to a workspace or repository. Servers can query roots to know where to look for files and how to scope their work.
|
||||
|
||||
**MCP Spec:** [Roots](https://modelcontextprotocol.io/specification/2025-11-25/client/roots)
|
||||
|
|
@ -612,6 +616,8 @@ client.notify_roots_list_changed().await?;
|
|||
|
||||
## Logging
|
||||
|
||||
> **Deprecated (SEP-2577):** Logging is deprecated and will be removed in a future release. It remains fully functional for now. See [SEP-2577](https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2577).
|
||||
|
||||
Servers can send structured log messages to clients. The client sets a minimum severity level, and the server sends messages through the peer notification interface.
|
||||
|
||||
**MCP Spec:** [Logging](https://modelcontextprotocol.io/specification/2025-11-25/server/utilities/logging)
|
||||
|
|
|
|||
Loading…
Reference in a new issue