yanmxa
MCP 服务配置
复制以下 JSON 到 OPClaw 或其他 MCP 客户端的配置文件中即可使用
{
"mcpServers": {
"multicluster-mcp-server": {
"args": [
"multicluster-mcp-server@latest"
],
"command": "uvx"
}
}
}
可用工具 (3 个)
该服务在 MCP 协议中暴露的工具,AI 可按需调用
clusters
Retrieves a list of Kubernetes clusters (also known as managed clusters or spoke clusters).
该工具无需必填参数,直接调用即可
connect_cluster
Generates the KUBECONFIG for the managed cluster and binds it to the specified ClusterRole (default: cluster-admin).
该工具无需必填参数,直接调用即可
kube_executor
Securely run a kubectl command or apply YAML. Provide either command or yaml .
该工具无需必填参数,直接调用即可
服务介绍
多集群 MCP 服务器
多集群 MCP 服务器 提供了一个强大的网关,使生成式人工智能(GenAI)系统能够通过模型上下文协议(MCP)与多个 Kubernetes 集群进行交互。它促进了对 Kubernetes 资源的全面操作、简化了多集群管理,并提供了交互式的集群可观测性。
🚀 特性
🛠️ MCP 工具 - Kubernetes 集群感知
-
✅ 从 中心集群(当前上下文)检索资源
-
✅ 从 托管集群 检索资源
-
✅ 使用指定的
ClusterRole连接到 托管集群 -
✅ 访问多个 Kubernetes 集群中的资源(通过 Open Cluster Management)
-
❌ 从集成集群中检索和分析 指标、日志和告警
-
❌ 与多集群 API 交互,包括托管集群、策略、插件等

📦 适用于 Open Cluster Management 的提示模板 (计划中)
- 提供可重用的提示模板,专为 OCM 任务设计,简化代理交互和自动化
📚 适用于 Open Cluster Management 的 MCP 资源 (计划中)
- 引用官方 OCM 文档及相关资源,支持开发和集成
📌 如何使用
- 与 MCP Inspector 一起使用
bash
mcp dev ./src/multicluster_mcp_server/main.py
使用以下代码片段配置服务器:
json
{
"mcpServers": {
"multicluster-mcp-server": {
"command": "uvx",
"args": [
"multicluster-mcp-server@latest"
]
}
}
}
注意: 确保已安装 kubectl。默认情况下,该工具使用 KUBECONFIG 环境变量来访问集群。在多集群设置中,它将配置的集群视为 中心集群,并通过它访问其他集群。
许可证
本项目采用 MIT 许可证。