MCP代理服务器
MCP 代理服务器通过单一接口聚合并服务于多个 MCP 资源服务器。该服务器充当中央枢纽,可以:
- 连接和管理多个 MCP 资源服务器
- 通过统一的界面展示其综合能力
- 将请求路由到适当的后端服务器
- 汇总来自多个来源的回复
特征
资源管理
- 发现并连接多个 MCP 资源服务器
- 聚合所有连接服务器的资源
- 维护跨服务器的一致 URI 方案
- 处理资源路由和解析
工具聚合
- 公开所有连接服务器的工具
- 将工具调用路由到适当的后端服务器
- 维护工具状态并处理响应
及时处理
- 汇总所有已连接服务器的提示
- 将提示请求路由到适当的后端
- 处理多服务器提示响应
配置
该服务器需要一个 JSON 配置文件,用于指定要连接的 MCP 服务器。复制示例配置并根据你的需要进行修改:
配置结构示例:
运行服务器时必须提供配置文件:
发展
安装依赖项:
构建服务器:
对于使用自动重建的开发:
对于连续运行的开发:
安装
要与 Claude Desktop 一起使用,请添加服务器配置:
在 MacOS 上: ~/Library/Application Support/Claude/claude_desktop_config.json
在 Windows 上: %APPDATA%/Claude/claude_desktop_config.json
KEEP_SERVER_OPEN
即使客户端断开连接,SSE 仍会保持运行。当多个客户端连接到 MCP 代理时非常有用。
调试
由于 MCP 服务器通过 stdio 进行通信,调试起来可能比较困难。我们推荐使用MCP Inspector ,它以包脚本的形式提供:
检查器将提供一个 URL 来访问浏览器中的调试工具。
You must be authenticated.
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
一个中央枢纽,将多个 MCP 资源服务器聚合到单个统一的界面,使用户能够通过一个连接点访问来自多个后端服务器的工具和功能。
Related Resources
Related MCP Servers
- -securityAlicense-qualityA middleware server that enables multiple isolated instances of the same MCP servers to coexist independently with unique namespaces and configurations.Last updated -19056TypeScriptMIT License
- -securityFlicense-qualityAn MCP server that connects to the Resource Hub, allowing centralized configuration and management of tools and resources across different MCP environments.Last updated -2JavaScript
- -securityAlicense-qualityAn MCP server implementation that standardizes how AI applications access tools and context, providing a central hub that manages tool discovery, execution, and context management with a simplified configuration system.Last updated -9PythonMIT License
- -security-license-qualityAn MCP server that enables Claude and other MCP clients to interact with Mattermost workspaces, providing channel management, messaging capabilities, and topic monitoring functionality.Last updated -TypeScript