diff --git a/tui_gateway/server.py b/tui_gateway/server.py index 7f7109d1012..76a10c61206 100644 --- a/tui_gateway/server.py +++ b/tui_gateway/server.py @@ -3526,7 +3526,8 @@ def _schedule_mcp_late_refresh(sid: str, agent) -> None: The agent snapshots ``agent.tools`` once at build time and never re-reads the registry (run_agent/agent_init). ``_make_agent`` briefly joins the - background MCP discovery thread (``wait_for_mcp_discovery``, ~0.75s) so + background MCP discovery thread (``wait_for_mcp_discovery``, bounded by the + ``mcp_discovery_timeout`` config value, default 1.5s) so already-spawning servers land in that snapshot — but a server that takes longer than the bound to connect (common for an HTTP MCP server on first connect) lands *after* the agent is built. Its tools are then absent from