Title: Deprecate roots, sampling, and logging per SEP-2577 by Kludex · Pull Request #2922 · modelcontextprotocol/python-sdk · GitHub
Open Graph Title: Deprecate roots, sampling, and logging per SEP-2577 by Kludex · Pull Request #2922 · modelcontextprotocol/python-sdk
X Title: Deprecate roots, sampling, and logging per SEP-2577 by Kludex · Pull Request #2922 · modelcontextprotocol/python-sdk
Description: Closes #2805. Implements SEP-2577 for the 2026-07-28 spec. Summary The deprecation is advisory only - no wire-level changes, capability negotiation is unchanged, and every type stays fully functional for sessions negotiating 2025-11-25 and earlier. 4 capability fields (ClientCapabilities.roots, .sampling, .tasks.requests.sampling, ServerCapabilities.logging) marked with Annotated[T, deprecated(...)] - warns on attribute access (not on construction/validation) and sets the JSON-schema deprecated flag. 17 type classes (the Roots/Sampling/Logging request/result/notification/param types) marked with a class-level @deprecated. SamplingMessageContentBlock and LoggingLevel are type aliases, so they carry docstring notes only. The SEP's *ResultResponse wrappers have no counterpart in this SDK. Keeping the build green A scoped filterwarnings entry in pyproject.toml silences the advisory runtime DeprecationWarning, since the SDK still builds these types internally to serve older sessions. The SDK's own references carry # pyright: ignore[reportDeprecated]. Rather than decorate user-facing docs with suppressions, the sampling-specific example snippet and its README section are dropped, and the incidental sampling callback is trimmed from the general stdio client example. Conformance SEP-2577 is advisory only with no observable wire behavior, so there is nothing for the conformance suite to assert - this is the expected "no matching test" case rather than a gap. AI Disclaimer This PR was developed with the assistance of either Claude or Codex. I've reviewed and verified the changes.
Open Graph Description: Closes #2805. Implements SEP-2577 for the 2026-07-28 spec. Summary The deprecation is advisory only - no wire-level changes, capability negotiation is unchanged, and every type stays fully function...
X Description: Closes #2805. Implements SEP-2577 for the 2026-07-28 spec. Summary The deprecation is advisory only - no wire-level changes, capability negotiation is unchanged, and every type stays fully function...
Opengraph URL: https://github.com/modelcontextprotocol/python-sdk/pull/2922
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:c1a86f04-8fd4-f429-5ab1-f8cf8aa4ab48 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 93E8:F8C9C:10B5DA:17E8A9:6A59D175 |
| html-safe-nonce | 927fbafc003c67fc68e163b47a1b8d927f743a130cee3bce837067ad54e1f943 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5M0U4OkY4QzlDOjEwQjVEQToxN0U4QTk6NkE1OUQxNzUiLCJ2aXNpdG9yX2lkIjoiMzMzMTUyODY3Nzg1MTI1NTE1NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 12a3d91ceca9e17478ada53fba7d75365f0afda9b226feaeb0afaa8556e85f76 |
| hovercard-subject-tag | pull_request:3904069309 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/modelcontextprotocol/python-sdk/pull/2922/files |
| twitter:image | https://avatars.githubusercontent.com/u/7353520?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/7353520?s=400&v=4 |
| og:image:alt | Closes #2805. Implements SEP-2577 for the 2026-07-28 spec. Summary The deprecation is advisory only - no wire-level changes, capability negotiation is unchanged, and every type stays fully function... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | ba3976babb66479b1c943a8edc0777d96157da48fadc0161f9ddb219deee8353 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/modelcontextprotocol/python-sdk git https://github.com/modelcontextprotocol/python-sdk.git |
| octolytics-dimension-user_id | 182288589 |
| octolytics-dimension-user_login | modelcontextprotocol |
| octolytics-dimension-repository_id | 862584018 |
| octolytics-dimension-repository_nwo | modelcontextprotocol/python-sdk |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 862584018 |
| octolytics-dimension-repository_network_root_nwo | modelcontextprotocol/python-sdk |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | bfacf98c3b7ad151665d6ddd216469389872b251 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width