Title: [v1.x] Deprecate the WebSocket transport and the experimental tasks entry points by maxisbey · Pull Request #2828 · modelcontextprotocol/python-sdk · GitHub
Open Graph Title: [v1.x] Deprecate the WebSocket transport and the experimental tasks entry points by maxisbey · Pull Request #2828 · modelcontextprotocol/python-sdk
X Title: [v1.x] Deprecate the WebSocket transport and the experimental tasks entry points by maxisbey · Pull Request #2828 · modelcontextprotocol/python-sdk
Description: Summary Marks two API surfaces as deprecated on the v1.x line. Both are already removed on main (v2): the WebSocket transport in #2785 and experimental tasks support in #2714. This change gives 1.x users advance notice before they upgrade to 2.0. WebSocket transport — websocket_client and websocket_server now carry typing_extensions.deprecated markers and emit a DeprecationWarning when called. WebSocket was never part of the MCP specification; the streamable HTTP transport is the replacement. Experimental tasks entry points — ClientSession.experimental, the experimental_task_handlers constructor kwarg, ServerSession.experimental, and Server.experimental warn the same way. Tasks (SEP-1686) were removed from the MCP specification and are expected to return as a separate MCP extension in the future. Design notes Warnings fire only on use. There are no import-time warnings, so libraries that import these modules at top level (without calling them) are unaffected at runtime. Library internals never trigger the warning. Internal callers now go through a private ServerSession._experimental accessor, and a regression test asserts that a plain client/server round trip emits zero deprecation warnings. @deprecated is applied outside @asynccontextmanager so the warning points at the caller's frame rather than contextlib internals. The type-checker signal is intentional. Editors and type checkers that flag deprecated symbols (pyright's reportDeprecated, ty's deprecated rule) will now surface these usages downstream — that static channel reaches maintainers more reliably than runtime warnings, which Python hides by default. Test-suite warning policy preserved. The suites that intentionally exercise these APIs get scoped filterwarnings ignores (a conftest for the tasks suite, a pytestmark for the websocket suite) instead of repo-global ignores, so the global filterwarnings = ["error"] net still catches any accidental warning from SDK internals elsewhere. The experimental tasks docs pages now show a deprecation banner. Deliberately not in this PR: the task types in mcp.types and the experimental module classes are untouched. Runtime warnings there would fire from inside libraries that build on these types and spam their users; a follow-up can add static-only markers (@deprecated(..., category=None)) for those. Testing New tests assert each entry point emits the warning, and that plain (non-tasks, non-websocket) usage stays warning-free. Full suite passes with 100% coverage; pyright strict is clean. AI Disclaimer
Open Graph Description: Summary Marks two API surfaces as deprecated on the v1.x line. Both are already removed on main (v2): the WebSocket transport in #2785 and experimental tasks support in #2714. This change gives 1.x...
X Description: Summary Marks two API surfaces as deprecated on the v1.x line. Both are already removed on main (v2): the WebSocket transport in #2785 and experimental tasks support in #2714. This change gives 1.x...
Opengraph URL: https://github.com/modelcontextprotocol/python-sdk/pull/2828
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:a477a200-0e91-a383-b096-abaa884cf4ff |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | C29A:DD525:1E29627:28B724F:6A5994D8 |
| html-safe-nonce | d783218dae58661eb6797f48e4548e541f2a2314f5f9a9e50fb6eb41fe34c03d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMjlBOkRENTI1OjFFMjk2Mjc6MjhCNzI0Rjo2QTU5OTREOCIsInZpc2l0b3JfaWQiOiI5MjIxOTMyNDc3MjcwNTYyMDA4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 6d0d9ff7d7e4fd96c4a1c23f39fd3363fcc0f720591b04dde55c11aa1611b321 |
| hovercard-subject-tag | pull_request:3840544036 |
| 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/2828/files |
| twitter:image | https://avatars.githubusercontent.com/u/224885523?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/224885523?s=400&v=4 |
| og:image:alt | Summary Marks two API surfaces as deprecated on the v1.x line. Both are already removed on main (v2): the WebSocket transport in #2785 and experimental tasks support in #2714. This change gives 1.x... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | a540949572872b935b393b36db38922db390ae71c859537d741b8f3eb7e545b5 |
| 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 | 624bb50a7497aa346bef8cc3743af408a9ea10ca |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width