mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-26 00:53:54 +08:00
update:智控台增加mcp接入点的配置
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user