Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ group (spawned with `start_new_session=True`); the `getpgid()` lookup and the
per-process terminate/kill fallback are gone. The win32 utilities logger is now
named `mcp.os.win32.utilities` (was `client.stdio.win32`).

### WebSocket transport removed

The WebSocket transport has been removed: `mcp.client.websocket.websocket_client`, `mcp.server.websocket.websocket_server`, and the `ws` optional dependency extra (`mcp[ws]`) no longer exist. WebSocket was never part of the MCP specification. Use the streamable HTTP transport instead (`mcp.client.streamable_http.streamable_http_client` on the client, `streamable_http_app()` on the server), which supports bidirectional communication with server-to-client streaming over standard HTTP.

### Removed type aliases and classes

The following deprecated type aliases and classes have been removed from `mcp.types`:
Expand Down
8 changes: 2 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ dependencies = [
[project.optional-dependencies]
rich = ["rich>=13.9.4"]
cli = ["typer>=0.16.0", "python-dotenv>=1.0.0"]
ws = ["websockets>=15.0.1"]

[project.scripts]
mcp = "mcp.cli:app [cli]"
Expand Down Expand Up @@ -75,8 +74,8 @@ build-constraint-dependencies = [

[dependency-groups]
dev = [
# We add mcp[cli,ws] so `uv sync` considers the extras.
"mcp[cli,ws]",
# We add mcp[cli] so `uv sync` considers the extras.
"mcp[cli]",
"pyright>=1.1.400",
"pytest>=8.4.0",
"ruff>=0.8.5",
Expand Down Expand Up @@ -204,9 +203,6 @@ addopts = """
"""
filterwarnings = [
"error",
# This should be fixed on Uvicorn's side.
"ignore::DeprecationWarning:websockets",
"ignore:websockets.server.WebSocketServerProtocol is deprecated:DeprecationWarning",
# pywin32 internal deprecation warning
"ignore:getargs.*The 'u' format is deprecated:DeprecationWarning",
]
Expand Down
85 changes: 0 additions & 85 deletions src/mcp/client/websocket.py

This file was deleted.

52 changes: 0 additions & 52 deletions src/mcp/server/websocket.py

This file was deleted.

14 changes: 0 additions & 14 deletions tests/client/test_transport_stream_cleanup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

from mcp.client.sse import sse_client
from mcp.client.streamable_http import streamable_http_client
from mcp.client.websocket import websocket_client


@contextmanager
Expand Down Expand Up @@ -104,16 +103,3 @@ async def test_streamable_http_client_closes_all_streams_on_exit() -> None:
with _assert_no_memory_stream_leak():
async with streamable_http_client("http://127.0.0.1:1/mcp"):
pass


@pytest.mark.anyio
async def test_websocket_client_closes_all_streams_on_connection_error(free_tcp_port: int) -> None:
"""websocket_client must close all 4 stream ends when ws_connect fails.

Before the fix, there was no try/finally at all — if ws_connect raised,
all 4 streams were leaked.
"""
with _assert_no_memory_stream_leak():
with pytest.raises(OSError):
async with websocket_client(f"ws://127.0.0.1:{free_tcp_port}/ws"):
pytest.fail("should not reach here") # pragma: no cover
51 changes: 0 additions & 51 deletions tests/shared/test_ws.py

This file was deleted.

57 changes: 0 additions & 57 deletions tests/test_helpers.py

This file was deleted.

Loading
Loading