From 71fe93cbbcb1d6b115c4b868e73c398c92c3a70c Mon Sep 17 00:00:00 2001 From: Adrian Webb Date: Mon, 14 Apr 2025 04:02:19 -0400 Subject: [PATCH] Adding a ssl_verify flag to the sse_client asynccontextmanager function in the sse client library. --- src/mcp/client/sse.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mcp/client/sse.py b/src/mcp/client/sse.py index 4f6241a72..98a0a0a05 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, + ssl_verify: bool = True, ): """ Client transport for SSE. @@ -43,7 +44,7 @@ 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, verify=ssl_verify) as client: async with aconnect_sse( client, "GET",