You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Deprecate roots, sampling, and logging methods per SEP-2577
SEP-2577 deprecates the Roots, Sampling, and Logging features as of the
2026-07-28 spec. The deprecation is advisory only: no wire-level changes,
capability negotiation is unchanged, and every method keeps working for
sessions negotiating 2025-11-25 and earlier.
Mark the user-facing methods for these features with
`typing_extensions.deprecated` so type checkers, IDEs, and the runtime warn at
the call site: `create_message`/`sample` (sampling), `list_roots` /
`send_roots_list_changed` (roots), `send_log_message` / `set_logging_level` and
the `MCPServer` `Context` log helpers (logging). Unlike decorating the schema
types, this keeps the footprint small while still making users aware.
The advisory runtime warning is silenced via a scoped `filterwarnings` entry
since the SDK calls these methods internally (e.g. `ctx.debug` -> `log` ->
`send_log_message`) to serve older sessions.
Copy file name to clipboardExpand all lines: docs/migration.md
+11-1Lines changed: 11 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1216,7 +1216,17 @@ Tasks are expected to return as a separate MCP extension in a future release.
1216
1216
1217
1217
## Deprecations
1218
1218
1219
-
<!-- Add deprecations below -->
1219
+
### Roots, Sampling, and Logging methods deprecated (SEP-2577)
1220
+
1221
+
[SEP-2577](https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2577) deprecates the Roots, Sampling, and Logging features as of the 2026-07-28 spec. The deprecation is advisory only: there are no wire-level changes, capability negotiation is unchanged, and every method keeps working for sessions negotiating 2025-11-25 and earlier.
1222
+
1223
+
The user-facing methods for these features now carry `typing_extensions.deprecated`, so type checkers, IDEs, and the runtime surface a deprecation warning where they are called:
- Logging: `ServerSession.send_log_message()`, `ClientSession.set_logging_level()`, `Client.set_logging_level()`, and the `MCPServer``Context` helpers `log()`, `debug()`, `info()`, `warning()`, `error()`
1228
+
1229
+
No migration is required during the deprecation window. New code should avoid building on these features, since they may be removed in a future spec version.
0 commit comments