-
Notifications
You must be signed in to change notification settings - Fork 7
feat: 增加了mcp proxy的配置方式,可直接添加外部mcp #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- 新增对非内置工具(如 CNB)的支持 - 通过已注册的处理器调用底层 MCP 工具 - 添加工具查找失败和调用错误的日志记录
|
Caution Review failedThe pull request is closed. Walkthrough新增外部 MCP 客户端集成:配置格式与加载、MCP 客户端管理器、外部工具代理与注册、MCP 服务器增强(列举与路由)、CLI 列出工具命令及示例/文档与示例配置文件。 Changes
Sequence Diagram(s)sequenceDiagram
participant App as 应用(主流程)
participant Cfg as 配置加载器
participant MCPMgr as MCP 客户端管理器
participant ExtMCP as 外部 MCP 服务
participant MCPSrv as 本地 ZenOps MCP 服务器
participant Proxy as 代理工具
App->>Cfg: 读取 mcp_servers_config 文件
Cfg-->>App: 返回 MCPServersConfig
App->>MCPMgr: NewManager() / LoadFromConfig(cfg)
MCPMgr->>ExtMCP: 为每个启用服务器建立连接(StdIO/SSE/StreamableHttp)
ExtMCP-->>MCPMgr: 初始化并返回可用工具列表
MCPMgr-->>MCPMgr: 存储客户端与工具信息
App->>MCPSrv: 创建/复用本地 MCP 服务器
App->>MCPSrv: RegisterExternalMCPTools(ctx, MCPMgr)
MCPSrv->>MCPMgr: 列出所有外部客户端与工具
loop 为每个工具
MCPSrv->>Proxy: 创建代理工具(应用前缀)
Proxy->>MCPSrv: 在本地注册该代理工具
end
Note over MCPSrv,Proxy: 运行时工具调用流程
MCPSrv->>Proxy: CallTool(toolName, args)
Proxy->>MCPMgr: CallTool(外部服务器名, 原始Tool, args)
MCPMgr->>ExtMCP: 转发请求并等待结果
ExtMCP-->>MCPMgr: 返回工具执行结果
MCPMgr-->>Proxy: 返回结果
Proxy-->>MCPSrv: 将结果返回给调用方
App->>MCPMgr: CloseAll() 清理所有外部客户端
MCPMgr->>ExtMCP: 关闭连接
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes
Poem
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (15)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary by CodeRabbit
发布说明
新功能
list-tools命令,显示所有已注册的内置和外部MCP工具列表文档
杂务
✏️ Tip: You can customize this high-level summary in your review settings.