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",