update:智控台增加mcp接入点的配置

This commit is contained in:
hrz
2025-06-26 16:54:26 +08:00
parent 6812c5ac40
commit 1d293244d3
5 changed files with 17 additions and 5 deletions
@@ -15,8 +15,7 @@ logger = setup_logging()
async def connect_mcp_endpoint(mcp_endpoint_url: str) -> MCPEndpointClient:
"""连接到MCP接入点"""
if not mcp_endpoint_url:
logger.bind(tag=TAG).warning("MCP接入点URL为空,跳过连接")
if not mcp_endpoint_url or "你的" in mcp_endpoint_url or mcp_endpoint_url == "null":
return None
try:
@@ -82,7 +82,11 @@ class UnifiedToolHandler:
# 从配置中获取MCP接入点URL
mcp_endpoint_url = self.config.get("mcp_endpoint", "")
if mcp_endpoint_url and "你的" not in mcp_endpoint_url:
if (
mcp_endpoint_url
and "你的" not in mcp_endpoint_url
and mcp_endpoint_url != "null"
):
self.logger.info(f"正在初始化MCP接入点: {mcp_endpoint_url}")
mcp_endpoint_client = await connect_mcp_endpoint(mcp_endpoint_url)