Connects to Kubernetes clusters to manage pods, deployments and services, with kubectl operations and Helm.
接入配置
选择客户端,复制配置,再按项目文档补齐环境变量。
claude mcp add kubernetes --env ALLOW_ONLY_NON_DESTRUCTIVE_TOOLS='<ALLOW_ONLY_NON_DESTRUCTIVE_TOOLS>' -- npx mcp-server-kubernetes~/.codex/config.toml
[mcp_servers.kubernetes]
command = "npx"
args = ["mcp-server-kubernetes"]
env = { ALLOW_ONLY_NON_DESTRUCTIVE_TOOLS = "<ALLOW_ONLY_NON_DESTRUCTIVE_TOOLS>" }
# codex mcp add kubernetes --env ALLOW_ONLY_NON_DESTRUCTIVE_TOOLS='<ALLOW_ONLY_NON_DESTRUCTIVE_TOOLS>' -- npx mcp-server-kubernetes~/.cursor/mcp.json
{
"mcpServers": {
"kubernetes": {
"command": "npx",
"args": [
"mcp-server-kubernetes"
],
"env": {
"ALLOW_ONLY_NON_DESTRUCTIVE_TOOLS": "<ALLOW_ONLY_NON_DESTRUCTIVE_TOOLS>"
}
}
}
}.vscode/mcp.json
{
"servers": {
"kubernetes": {
"type": "stdio",
"command": "npx",
"args": [
"mcp-server-kubernetes"
],
"env": {
"ALLOW_ONLY_NON_DESTRUCTIVE_TOOLS": "<ALLOW_ONLY_NON_DESTRUCTIVE_TOOLS>"
}
}
}
}~/.gemini/settings.json
{
"mcpServers": {
"kubernetes": {
"command": "npx",
"args": [
"mcp-server-kubernetes"
],
"env": {
"ALLOW_ONLY_NON_DESTRUCTIVE_TOOLS": "<ALLOW_ONLY_NON_DESTRUCTIVE_TOOLS>"
}
}
}
}claude_desktop_config.json
{
"mcpServers": {
"kubernetes": {
"command": "npx",
"args": [
"mcp-server-kubernetes"
],
"env": {
"ALLOW_ONLY_NON_DESTRUCTIVE_TOOLS": "<ALLOW_ONLY_NON_DESTRUCTIVE_TOOLS>"
}
}
}
}.trae/mcp.json
{
"mcpServers": {
"kubernetes": {
"command": "npx",
"args": [
"mcp-server-kubernetes"
],
"env": {
"ALLOW_ONLY_NON_DESTRUCTIVE_TOOLS": "<ALLOW_ONLY_NON_DESTRUCTIVE_TOOLS>"
}
}
}
}需要的环境变量
ALLOW_ONLY_NON_DESTRUCTIVE_TOOLS
把占位值换成你自己的密钥;不要把密钥提交到代码仓库。