- MCP-Proxy
MCP-Proxy
Content
MCP-Proxy
MCP-Proxy 是一个基于 Rust 的 Model Context Protocol (MCP) 代理服务器实现,旨在简化与 MCP 服务器的交互,并提供一种统一的方式来访问多个 MCP 服务器的工具。
项目概述
MCP(Model Context Protocol)是一个开放标准,用于定义 AI 模型与外部工具和资源的交互方式。本项目提供了以下功能:
- MCP 代理服务器:将多个 MCP 服务器的工具整合到一起,提供统一的接口
- MCP 客户端:用于连接和管理 MCP 服务器
- 工具调用:支持调用 MCP 服务器提供的各种工具
- 配置管理:通过 JSON 配置文件管理服务器设置
- API 接口:提供 RESTful API 用于管理和监控 MCP 服务器
技术基础
本项目基于 Model Context Protocol Rust SDK 进行开发,该 SDK 提供了完整的 MCP 客户端和服务器实现框架。
核心功能
MCP 代理服务器
项目的核心是 mcp-proxy,这是一个功能完整的 MCP 代理服务器,能够:
- 连接到多个 MCP 服务器
- 收集所有服务器的工具信息
- 将这些工具作为自己的工具提供给调用者
- 将工具调用请求转发给适当的服务器
- 处理错误和重连
- 支持多实例管理
- 提供 RESTful API 用于管理和监控
MCP 客户端
除了代理服务器外,项目还提供了 mcp-client 工具,用于与 MCP 服务器交互:
配置文件
项目使用 mcp.json 配置文件来定义服务器设置。以下是配置文件的格式:
{
"mcpServers": {
"server_name": {
"kind": "stdio",
"command": "npx",
"commandPath": "./runtime/node-darwin-arm64/bin", // 可选,指定命令的路径
"args": [
"--loglevel", "verbose", // 注意:参数和值必须分开
"-y", "package-name"
],
"env": {
"ENV_VAR": "value"
}
}
}
}
配置选项说明:
kind: 服务器类型,支持 "stdio" 和 "sse"command: 要执行的命令(通常是npx)commandPath: (可选)命令的路径,如果指定,将与command拼接形成完整路径args: 命令行参数数组。重要:参数和值必须作为单独的数组元素,例如["--loglevel", "verbose"]而不是["--loglevel verbose"]env: 环境变量对象
示例
sample 目录包含了各种 MCP 工具调用的示例配置。
API 接口
MCP-Proxy 提供了 RESTful API 用于管理和监控 MCP 服务器,详见 API 接口文档
未来计划
未来,我们计划添加以下功能:
- 更多传输类型:支持 TCP 和 WebSocket 等传输类型,提供更好的稳定性和可扩展性
- 更多服务器支持:添加对更多 MCP 服务器的支持
- 更好的错误处理:提供更详细的错误信息和恢复机制
- 更好的日志记录:提供更详细的日志记录,以便于调试
- 更好的配置管理:提供更灵活的配置管理,包括环境变量和占位符支持
- Web 界面:提供 Web 界面用于管理和监控 MCP 服务器
贡献
欢迎贡献代码、报告问题或提出建议。请通过 GitHub Issues 或 Pull Requests 提交你的贡献。
Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
Tavily Mcp
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
ChatWiseThe second fastest AI chatbot™
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
DeepChatYour AI Partner on Desktop
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
Playwright McpPlaywright MCP server
CursorThe AI Code Editor
Serper MCP ServerA Serper MCP Server
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题;
Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
WindsurfThe new purpose-built IDE to harness magic
Amap Maps高德地图官方 MCP Server