kubernetes-mcp-server — MCP server for Kubernetes and OpenShift
Connects your agent to a Kubernetes or OpenShift cluster: pods, logs, Helm, Tekton. Useful when you want to inspect and change resources without leaving the chat.
claude mcp add kubernetes-mcp-server -- npx -y kubernetes-mcp-serverWhat kubernetes-mcp-server does
The server is written in Go and talks to the Kubernetes API server directly instead of shelling out to kubectl or helm. So no external tools are required on the machine, and with the native binary you skip Node and Python too. Builds exist for Linux, macOS and Windows, plus an npm package, a Python package and a container image.
It handles any CRUD operation on Kubernetes and OpenShift resources, pod work (list, logs, exec, metrics, delete, run an image), namespaces, events and OpenShift projects. Helm gets its own set: install a chart, list releases, uninstall. Tekton covers starting a Pipeline or Task, restarting and cancelling a PipelineRun, and pulling logs by resolving the pod. Configuration comes from .kube/config, and the server notices when that file changes. Several clusters from your kubeconfig can be used at once.
Settings go through command-line arguments, a TOML file or environment variables. OpenTelemetry tracing and metrics are optional, with custom sampling rates and a /stats endpoint. No cluster access means nothing works, so check that first.
What it helps with
- read pod logs without switching to a terminal
- run a command inside a container via
exec - install or remove a Helm release from the chat
- start a Tekton Pipeline and fetch its logs
- check namespace events when something keeps crashing
Example prompts for the agent
- Show me the logs for pod
api-7d9fin namespaceprod - Start the Tekton Pipeline
buildin namespaceci - How much CPU and memory are the pods in
stagingusing?
How to install kubernetes-mcp-server
Platform CLI
claude mcp add kubernetes-mcp-server -- npx -y kubernetes-mcp-serverPlatform CLI
codex mcp add kubernetes-mcp-server -- npx -y kubernetes-mcp-serverConfig file
{
"mcpServers": {
"kubernetes-mcp-server": {
"command": "npx",
"args": [
"-y",
"kubernetes-mcp-server"
]
}
}
}Config file
{
"servers": {
"kubernetes-mcp-server": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"kubernetes-mcp-server"
]
}
}
}Platform CLI
gemini mcp add kubernetes-mcp-server npx -y kubernetes-mcp-serverStep by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about kubernetes-mcp-server
How do I install kubernetes-mcp-server in Claude Code?
Run claude mcp add kubernetes-mcp-server -- npx -y kubernetes-mcp-server. The server then shows up in your Claude MCP list.
What does kubernetes-mcp-server do?
It gives the agent access to the Kubernetes and OpenShift API server: resource CRUD, pod operations, Helm releases, Tekton runs. Everything goes direct, with no kubectl calls.
Do I need Node or Python to run it?
Not with the native binary, which is self-contained. Node is only needed for the npm package, Python for the PyPI one.