mirror of
https://github.com/aljazceru/mcp-python-sdk.git
synced 2025-12-20 15:24:25 +01:00
Remove optional check
This commit is contained in:
@@ -42,12 +42,6 @@ async def websocket_client(url: str) -> AsyncGenerator[
|
|||||||
|
|
||||||
# Connect using websockets, requesting the "mcp" subprotocol
|
# Connect using websockets, requesting the "mcp" subprotocol
|
||||||
async with ws_connect(url, subprotocols=[Subprotocol("mcp")]) as ws:
|
async with ws_connect(url, subprotocols=[Subprotocol("mcp")]) as ws:
|
||||||
# Optional check to ensure the server actually accepted "mcp"
|
|
||||||
if ws.subprotocol != "mcp":
|
|
||||||
raise ValueError(
|
|
||||||
f"Server did not accept subprotocol 'mcp'. Actual subprotocol: {ws.subprotocol}"
|
|
||||||
)
|
|
||||||
|
|
||||||
async def ws_reader():
|
async def ws_reader():
|
||||||
"""
|
"""
|
||||||
Reads text messages from the WebSocket, parses them as JSON-RPC messages,
|
Reads text messages from the WebSocket, parses them as JSON-RPC messages,
|
||||||
|
|||||||
Reference in New Issue
Block a user