🧠 MCP服务器Helm图表
此Helm chart动态部署 MCP(模型上下文协议) 服务器,可通过以下方式远程访问 服务器发送事件(SSE)它允许你 轻松公开任何现有的REST API 从您的应用程序作为MCP环境中的工具,使智能代理或外部客户端能够查询和使用它们。
______________________________________________________________________
🚀 特性
- 在Kubernetes集群中部署MCP服务器
- 通过SSE启用远程交互
- 动态注册API端点并将其公开为
tools - 通过以下方式实现轻量级配置
values.yaml - 与FastAPI、Express、Flask和任何REST服务兼容
______________________________________________________________________
📦 图表结构
mcp-server/
├── Chart.yaml
├── values.yaml
└── templates/
├── deployment.yaml
├── service.yaml
├── ingressroute.yaml
└── configmap.yaml______________________________________________________________________
⚙️ 动态配置
您可以在您的 values.yaml 文件使用 config.tools 部分。以下是一个配置示例:
config:
tools: |
tools:
get_api_status:
endpoint: https://api-users.dev.example.com/
description: Get root message to verify the API is running.
fetch_user_by_id:
endpoint: https://api-users.dev.example.com/users/1
description: Fetch a specific user by ID from the API.
get_random_user:
endpoint: https://api-users.dev.example.com/users/random
description: Retrieve a randomly selected user (for testing/demo).🔒 确保更换 *.dev.example.com 使用您的实际域名。______________________________________________________________________
🧪 安装图表
helm install mcp-server ./mcp-server \
--values values.yaml______________________________________________________________________
🔌 MCP客户端配置
部署后,客户端可以使用以下配置连接到MCP服务器:
{
"mcp": {
"servers": {
"users-api": {
"url": "https://mcp-server.dev.example.com/sse"
}
}
}
}🔁 MCP服务器使用SSE(/sse)实时流式传输消息。______________________________________________________________________
🧹 卸载
helm uninstall mcp-server______________________________________________________________________
🧠 关于MCP
MCP(模型上下文协议)是一个轻量级交互层,使智能代理或应用程序能够使用自然语言接口或直接API查询来访问特定领域的工具。
______________________________________________________________________
📬 问题/贡献
请随时打开问题或提交拉取请求。欢迎投稿!
