fix(cli): honor MCP probe connect timeout

(cherry picked from commit b106dbe1c6a892789dcc4a0fdd460e1d100b8a66)
(cherry picked from commit 2142c95ccfd9fc882f4252be561c844752c76a37)
This commit is contained in:
Stephen Schoettler
2026-05-26 22:18:59 -07:00
committed by Teknium
parent 6133285596
commit 087aa74e6e
2 changed files with 45 additions and 2 deletions
+7 -2
View File
@@ -247,7 +247,7 @@ def _resolve_mcp_server_config(config: dict) -> dict:
def _probe_single_server(
name: str, config: dict, connect_timeout: float = 30, *, details: Optional[dict] = None
name: str, config: dict, connect_timeout: Optional[float] = None, *, details: Optional[dict] = None
) -> List[Tuple[str, str]]:
"""Temporarily connect to one MCP server, list its tools, disconnect.
@@ -271,9 +271,14 @@ def _probe_single_server(
)
config = _resolve_mcp_server_config(config)
if connect_timeout is None:
raw_timeout = config.get("connect_timeout", 30)
try:
connect_timeout = max(1.0, float(raw_timeout))
except (TypeError, ValueError):
connect_timeout = 30.0
_ensure_mcp_loop()
tools_found: List[Tuple[str, str]] = []
async def _probe():