Kubernetes 的 MCP 服务器工具
一个为 Kubernetes 提供的 Model Context Protocol (MCP) 服务器,支持通过自然语言与集群交互。
快速入门
安装
确保已安装 Python 3.9+ 和 kubectl CLI,并配置好 Kubernetes 集群。
通过 pip 安装最新版本:
pip install kubectl-mcp-tool
或从 GitHub 安装开发版本:
pip install git+https://github.com/rohitg00/kubectl-mcp-server.git
验证安装是否成功:
kubectl-mcp --help
使用
启动 MCP 服务器:
kubectl-mcp serve
配置 AI 助手
Claude Desktop
编辑 ~/.config/claude/mcp.json
文件,添加以下内容:
{
"mcpServers": {
"kubernetes": {
"command": "python",
"args": ["-m", "kubectl_mcp_tool.minimal_wrapper"],
"env": {
"KUBECONFIG": "/path/to/your/.kube/config"
}
}
}
}
Cursor AI
在设置中添加全局 MCP 服务器:
{
"mcpServers": {
"kubernetes": {
"command": "python",
"args": ["-m", "kubectl_mcp_tool.minimal_wrapper"],
"env": {
"KUBECONFIG": "/path/to/your/.kube/config"
}
}
}
}
保存至 ~/.cursor/mcp.json
。
更多详细配置和示例,请参考 README。