MCP服务器部署工具

该Helm chart用于动态部署MCP(Model Context Protocol)服务器,支持通过Server-Sent Events(SSE)进行远程交互,可将现有REST API作为工具暴露在MCP环境中。

  • by lgiuppone
  • Python
  • 云端部署
  • 更新于
在 GitHub 查看 lgiuppone/mcp-auto-tools-ms

使用说明

🧠 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查询来访问特定领域的工具。


📬 问题/贡献

请随时打开问题或提交拉取请求。欢迎投稿!