Skip to content

Commit 252917f

Browse files
author
aryanmotgi
committed
docs: correct create_mcp_http_client default timeout docstring
The docstring claimed the default timeout is 30 seconds, but the implementation sets httpx.Timeout(30, read=300) so the read timeout is actually 5 minutes to accommodate long-lived SSE streams. Update the docstring to reflect the real defaults.
1 parent e8e6484 commit 252917f

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/mcp/shared/_httpx_utils.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,14 @@ def create_mcp_http_client(
2929
3030
This function provides common defaults used throughout the MCP codebase:
3131
- follow_redirects=True (always enabled)
32-
- Default timeout of 30 seconds if not specified
32+
- Default timeout of 30 seconds for connect/write/pool and 300 seconds for read (to
33+
accommodate long-lived SSE streams) if not specified
3334
3435
Args:
3536
headers: Optional headers to include with all requests.
3637
timeout: Request timeout as httpx.Timeout object.
37-
Defaults to 30 seconds if not specified.
38+
Defaults to 30 seconds for connect/write/pool and 300 seconds for read if
39+
not specified.
3840
auth: Optional authentication handler.
3941
4042
Returns:

0 commit comments

Comments
 (0)