Title: Remove the unsupported WebSocket transport by maxisbey · Pull Request #2785 · modelcontextprotocol/python-sdk · GitHub
Open Graph Title: Remove the unsupported WebSocket transport by maxisbey · Pull Request #2785 · modelcontextprotocol/python-sdk
X Title: Remove the unsupported WebSocket transport by maxisbey · Pull Request #2785 · modelcontextprotocol/python-sdk
Description: Removes the WebSocket transport from the v2 SDK: mcp.client.websocket.websocket_client, mcp.server.websocket.websocket_server, the ws optional-dependency extra, and the transport's tests. Motivation and Context WebSocket has never been part of the MCP specification, and the SDK transport was unsupported. v2 is the opportunity to drop it outright rather than carry it forward. Users should use the streamable HTTP transport instead. tests/test_helpers.py (run_uvicorn_in_thread) is deleted as well: the WebSocket test was its last remaining caller after #2764/#2765/#2767 moved the other transport tests in process. How Has This Been Tested? Full test suite passes locally at 100% coverage (./scripts/test, including strict-no-cover); ruff and pyright are clean. uv.lock regenerated — the websockets package drops out of the resolution entirely. Breaking Changes Yes — the transport modules and the mcp[ws] extra no longer exist. Documented in docs/migration.md under Breaking Changes, grouped with the other transport changes. Types of changes Bug fix (non-breaking change which fixes an issue) New feature (non-breaking change which adds functionality) Breaking change (fix or feature that would cause existing functionality to change) Documentation update Checklist I have read the MCP Documentation My code follows the repository's style guidelines New and existing tests pass locally I have added appropriate error handling I have added or updated documentation as needed Additional context The {"type": "websocket"} literal remaining in tests/server/test_sse_security.py is intentional: it is a standard ASGI scope type used to verify connect_sse rejects non-HTTP scopes, unrelated to the removed transport. The two websockets filterwarnings ignores in pyproject.toml are also removed since nothing imports the package anymore. AI Disclaimer
Open Graph Description: Removes the WebSocket transport from the v2 SDK: mcp.client.websocket.websocket_client, mcp.server.websocket.websocket_server, the ws optional-dependency extra, and the transport's tests. Motiv...
X Description: Removes the WebSocket transport from the v2 SDK: mcp.client.websocket.websocket_client, mcp.server.websocket.websocket_server, the ws optional-dependency extra, and the transport's tests. M...
Opengraph URL: https://github.com/modelcontextprotocol/python-sdk/pull/2785
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:f0cbf685-301b-60d8-6ef1-79b7faf8713c |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | A75C:2047E2:97324C:D7492F:6A5A11BF |
| html-safe-nonce | 68979df86c1d23b10f82a91ebfe0e0fd8d207b9f7da57abc3e9f1cc6549b5b88 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNzVDOjIwNDdFMjo5NzMyNEM6RDc0OTJGOjZBNUExMUJGIiwidmlzaXRvcl9pZCI6Ijg5Njg3MjQxODM1NzM0Njc1ODMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 52bb2db5ac617468f3798d262340c2366a8469302a0eeaad0ddca8481ae8582f |
| hovercard-subject-tag | pull_request:3809882199 |
| 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/2785/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 | Removes the WebSocket transport from the v2 SDK: mcp.client.websocket.websocket_client, mcp.server.websocket.websocket_server, the ws optional-dependency extra, and the transport's tests. Motiv... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 8c2fe7351e4e987cb8f75e2425a0b895d807779bc4c2d3c312be0a54082219f7 |
| 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 | 501ec24a694e4933bb3d70e768b1461c0def57a2 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width