From f368f8d92b385e7fdc835dd1bf722b154cac7f82 Mon Sep 17 00:00:00 2001 From: John Date: Thu, 3 Apr 2025 14:32:32 -0700 Subject: [PATCH] MCP enable over UNIX socket Signed-off-by: John --- src/mcp/client/sse.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/mcp/client/sse.py b/src/mcp/client/sse.py index 4f6241a72..12a8cc55a 100644 --- a/src/mcp/client/sse.py +++ b/src/mcp/client/sse.py @@ -24,6 +24,7 @@ async def sse_client( headers: dict[str, Any] | None = None, timeout: float = 5, sse_read_timeout: float = 60 * 5, + transport: httpx.AsyncHTTPTransport | None = None, ): """ Client transport for SSE. @@ -43,7 +44,10 @@ async def sse_client( async with anyio.create_task_group() as tg: try: logger.info(f"Connecting to SSE endpoint: {remove_request_params(url)}") - async with httpx.AsyncClient(headers=headers) as client: + async with httpx.AsyncClient( + headers=headers, + transport=transport, + ) as client: async with aconnect_sse( client, "GET",