|
1 | 1 | # Deprecated features |
2 | 2 |
|
3 | | -The 2026-07-28 spec retires five things. The SDK still implements every one of them, and every one of them now carries a **deprecation warning**. |
| 3 | +The 2026-07-28 spec retires five things. The SDK still implements every one of them, and every one of them now carries a **deprecation warning**. One SDK helper is deprecated on its own account and is listed [at the end](#deprecated-sdk-helpers). |
4 | 4 |
|
5 | 5 | The table below names each deprecated feature, why it is going away, and the replacement to build on. |
6 | 6 |
|
@@ -119,22 +119,32 @@ That is the whole API. There is no per-method switch, and you don't want one: th |
119 | 119 | Run the filter the other way and you get a free regression test. Add |
120 | 120 | `"error::mcp.MCPDeprecationWarning"` to the `filterwarnings` setting in your pytest |
121 | 121 | configuration and the deprecated call **raises** instead of warning. A tool named |
122 | | - `old_log` that still calls `ctx.info()` stops passing and starts reporting: |
| 122 | + `old_log` that still calls `ctx.info()` stops passing: the call comes back `is_error=True` with |
| 123 | + `Error executing tool old_log`, and the captured server log names the culprit: |
123 | 124 |
|
124 | 125 | ```text |
125 | | - Error executing tool old_log: The logging capability is deprecated as of 2026-07-28 (SEP-2577). |
| 126 | + mcp.shared.exceptions.MCPDeprecationWarning: The logging capability is deprecated as of 2026-07-28 (SEP-2577). |
126 | 127 | ``` |
127 | 128 |
|
128 | 129 | One line of pytest configuration, and a deprecated call can never sneak back into your |
129 | 130 | codebase without failing a test. |
130 | 131 |
|
| 132 | +## Deprecated SDK helpers |
| 133 | + |
| 134 | +These are not spec changes, only SDK internals with a better replacement. They warn with the same `MCPDeprecationWarning` and will be removed in 3.0. |
| 135 | + |
| 136 | +| Deprecated | What you do instead | |
| 137 | +|---|---| |
| 138 | +| `FuncMetadata.call_fn_with_arg_validation()` | `FuncMetadata.validate_arguments()` and then `FuncMetadata.call_fn()`. Only code that drives `FuncMetadata` directly (a custom `Tool` subclass, say) ever called it. | |
| 139 | + |
131 | 140 | ## Recap |
132 | 141 |
|
133 | 142 | * The 2026-07-28 spec deprecates **roots**, server-initiated **sampling**, and protocol **logging** (all [SEP-2577](https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2577)), restricts **progress** to server-to-client, and removes **`ping`**. |
134 | 143 | * The replacement column points you onward: **[Multi-round-trip requests](handlers/multi-round-trip.md)** for sampling and roots, **[Logging](handlers/logging.md)** for logging, **[Progress](handlers/progress.md)** for progress. `ping` needs nothing at all. |
135 | 144 | * Deprecated is advisory: no wire changes, everything keeps working against pre-2026 sessions, and you get a visible `MCPDeprecationWarning` (a `UserWarning`, so it is on by default). |
136 | 145 | * Sampling and roots additionally need a back-channel that a 2026-07-28 session does not have. On a modern connection they warn and then they raise. |
137 | 146 | * `warnings.filterwarnings("ignore", category=MCPDeprecationWarning)` silences the whole category; `"error::mcp.MCPDeprecationWarning"` in pytest turns it into a test failure. |
| 147 | +* One SDK helper, `FuncMetadata.call_fn_with_arg_validation()`, is deprecated separately for removal in 3.0. |
138 | 148 | * New code should not be built on any of these. |
139 | 149 |
|
140 | 150 | Every other page in these docs teaches the current API. |
0 commit comments