We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c91f406 commit 60c0420Copy full SHA for 60c0420
1 file changed
src/mcp/shared/_httpx_utils.py
@@ -27,14 +27,12 @@ def create_mcp_http_client(
27
) -> httpx.AsyncClient:
28
"""Create a standardized httpx AsyncClient with MCP defaults.
29
30
- This function provides common defaults used throughout the MCP codebase:
31
- - follow_redirects=True (always enabled)
32
- - Default timeout of 30 seconds if not specified
+ Always enables follow_redirects and applies an SSE-friendly default timeout.
33
34
Args:
35
headers: Optional headers to include with all requests.
36
- timeout: Request timeout as httpx.Timeout object.
37
- Defaults to 30 seconds if not specified.
+ timeout: Request timeout as httpx.Timeout object. Defaults to 30s for
+ connect/write/pool and 300s for read (for long-lived SSE streams).
38
auth: Optional authentication handler.
39
40
Returns:
0 commit comments