add default transport

This commit is contained in:
朱潮 2025-12-12 20:28:27 +08:00
parent 9c3715d9b0
commit 66b816c3b2

View File

@ -27,8 +27,8 @@ async def init_agent(model_name="qwen3-next", api_key=None,
if mcp and "mcpServers" in mcp[0]:
for cfg in mcp[0]["mcpServers"].values():
if "type" in cfg:
cfg["transport"] = cfg.pop("type")
elif "transport" not in cfg:
cfg.pop("type")
if "transport" not in cfg:
cfg["transport"] = "http" if "url" in cfg else "stdio"
mcp_client = MultiServerMCPClient(mcp[0]["mcpServers"])