From 8fd41d24aa330125586a0678aefa68edd1a1cb82 Mon Sep 17 00:00:00 2001 From: Pavan Kumar <66913595+ascender1729@users.noreply.github.com> Date: Sun, 20 Apr 2025 17:43:07 +0000 Subject: [PATCH] fix(mcp): update server parameters to resolve SSE connection error --- examples/mcp_example/mcp_client.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/examples/mcp_example/mcp_client.py b/examples/mcp_example/mcp_client.py index 33b8f297..92ac08fe 100644 --- a/examples/mcp_example/mcp_client.py +++ b/examples/mcp_example/mcp_client.py @@ -21,16 +21,13 @@ logger.add(sys.stdout, def get_server_params(): """Get the MCP server connection parameters.""" return MCPServerSseParams( - url="http://0.0.0.0:8000", # Using 0.0.0.0 to be accessible - sse_path="/sse", # Specify SSE endpoint - messages_path="/messages", # Specify messages endpoint + url="http://0.0.0.0:8000", # Use 0.0.0.0 to be accessible headers={ "Content-Type": "application/json", "Accept": "text/event-stream" }, - timeout=15.0, # Longer timeout - sse_read_timeout=60.0, # Longer read timeout - require_session_id=False # Match server configuration + timeout=15.0, # Longer timeout + sse_read_timeout=60.0 # Longer read timeout )