Skip to content

Commit 715883a

Browse files
committed
set timeout for sse in httpx_client_factory
1 parent 20dc0fb commit 715883a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/mcp/client/sse.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ async def sse_client(
5454
async with anyio.create_task_group() as tg:
5555
try:
5656
logger.debug(f"Connecting to SSE endpoint: {remove_request_params(url)}")
57-
async with httpx_client_factory(headers=headers, auth=auth) as client:
57+
async with httpx_client_factory(
58+
headers=headers, auth=auth, timeout=httpx.Timeout(timeout, read=sse_read_timeout)
59+
) as client:
5860
async with aconnect_sse(
5961
client,
6062
"GET",

0 commit comments

Comments
 (0)