A Model Context Protocol (MCP) server that enables AI assistants to interact with Kubernetes clusters. It serves as a bridge between AI tools (like Claude, Cursor, and GitHub Copilot) and Kubernetes
Setup
Choose your client, copy the config, then fill in any required environment variables.
claude mcp add kubernetes --env KUBECONFIG='<KUBECONFIG>' -- docker run -i --rm --mount 'type=bind,src={{config.KUBECONFIG}},dst=/home/mcp/.kube/config' ghcr.io/azure/mcp-kubernetes~/.codex/config.toml
[mcp_servers.kubernetes]
command = "docker"
args = ["run", "-i", "--rm", "--mount", "type=bind,src={{config.KUBECONFIG}},dst=/home/mcp/.kube/config", "ghcr.io/azure/mcp-kubernetes"]
env = { KUBECONFIG = "<KUBECONFIG>" }
# codex mcp add kubernetes --env KUBECONFIG='<KUBECONFIG>' -- docker run -i --rm --mount 'type=bind,src={{config.KUBECONFIG}},dst=/home/mcp/.kube/config' ghcr.io/azure/mcp-kubernetes~/.cursor/mcp.json
{
"mcpServers": {
"kubernetes": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"--mount",
"type=bind,src={{config.KUBECONFIG}},dst=/home/mcp/.kube/config",
"ghcr.io/azure/mcp-kubernetes"
],
"env": {
"KUBECONFIG": "<KUBECONFIG>"
}
}
}
}.vscode/mcp.json
{
"servers": {
"kubernetes": {
"type": "stdio",
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"--mount",
"type=bind,src={{config.KUBECONFIG}},dst=/home/mcp/.kube/config",
"ghcr.io/azure/mcp-kubernetes"
],
"env": {
"KUBECONFIG": "<KUBECONFIG>"
}
}
}
}~/.gemini/settings.json
{
"mcpServers": {
"kubernetes": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"--mount",
"type=bind,src={{config.KUBECONFIG}},dst=/home/mcp/.kube/config",
"ghcr.io/azure/mcp-kubernetes"
],
"env": {
"KUBECONFIG": "<KUBECONFIG>"
}
}
}
}claude_desktop_config.json
{
"mcpServers": {
"kubernetes": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"--mount",
"type=bind,src={{config.KUBECONFIG}},dst=/home/mcp/.kube/config",
"ghcr.io/azure/mcp-kubernetes"
],
"env": {
"KUBECONFIG": "<KUBECONFIG>"
}
}
}
}.trae/mcp.json
{
"mcpServers": {
"kubernetes": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"--mount",
"type=bind,src={{config.KUBECONFIG}},dst=/home/mcp/.kube/config",
"ghcr.io/azure/mcp-kubernetes"
],
"env": {
"KUBECONFIG": "<KUBECONFIG>"
}
}
}
}Environment variables
KUBECONFIG
Replace the placeholders with your own credentials and keep them out of version control.