feat: 重构 MCP 配置管理,移除旧配置文件,更新为使用全局配置
This commit is contained in:
@@ -4,9 +4,10 @@ MCP (Model Context Protocol) 客户端包。
|
||||
提供 MCPManager 用于管理 MCP 服务器连接、发现工具、调用工具。
|
||||
|
||||
用法:
|
||||
from src.config.config import global_config
|
||||
from .manager import MCPManager
|
||||
|
||||
manager = await MCPManager.from_config("config/mcp_config.json")
|
||||
manager = await MCPManager.from_app_config(global_config.mcp)
|
||||
if manager:
|
||||
tools = manager.get_openai_tools() # 获取 OpenAI 格式工具列表
|
||||
result = await manager.call_tool(name, args) # 调用工具
|
||||
|
||||
Reference in New Issue
Block a user