Skip to content

Your lightweight open-source personal agent.

fix: set httpx timeout for streamableHttp transport to prevent event loop blocking

Luc Nguyend7abf39169f9
diff --git a/nanobot/agent/tools/mcp.py b/nanobot/agent/tools/mcp.py
index 2fb7da895..d31aa6767 100644
--- a/nanobot/agent/tools/mcp.py
+++ b/nanobot/agent/tools/mcp.py
@@ -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(