fix: set httpx timeout for streamableHttp transport to prevent event loop blocking
timeout=None causes the httpx client to wait indefinitely when connecting to MCP servers via streamableHttp transport, blocking the entire event loop. This prevents Telegram polling and other async operations from running. Set timeout=httpx.Timeout(30.0, connect=10.0) to match the pattern used in the SSE transport's httpx_client_factory.
This commit is contained in:
@@ -740,7 +740,7 @@ async def connect_mcp_servers(
|
||||
headers=cfg.headers or None,
|
||||
event_hooks={"request": [_validate_mcp_request_url]},
|
||||
follow_redirects=True,
|
||||
timeout=None,
|
||||
timeout=httpx.Timeout(30.0, connect=10.0),
|
||||
)
|
||||
)
|
||||
read, write, _ = await server_stack.enter_async_context(
|
||||
|
||||
Reference in New Issue
Block a user