home / mcp / kubernetes mcp server
Provides a Go-based MCP server for Kubernetes and OpenShift with direct API access, multi-cluster support, and observability.
Configuration
View docs{
"mcpServers": {
"containers-kubernetes-mcp-server": {
"command": "npx",
"args": [
"-y",
"kubernetes-mcp-server@latest"
]
}
}
}You are using a Go-based Kubernetes Model Context Protocol (MCP) server that directly talks to the Kubernetes API. It provides powerful, flexible access to Kubernetes and OpenShift resources, multi-cluster support, and optional observability, all without relying on external CLI tools for each operation.
You connect to the Kubernetes MCP server from your MCP client to perform Kubernetes and OpenShift operations. You can work with generic resources, pods (including logs, execution, and top metrics), namespaces, events, and OpenShift projects, as well as Helm charts and KubeVirt resources. When multi-cluster access is enabled, you can target specific clusters via contexts in your kubeconfig. You can also enable observability and telemetry to monitor the serverβs behavior and performance.
Follow these concrete steps to install and start using the Kubernetes MCP server.
# Prerequisites: ensure Node.js and npm exist if you plan to use npx
# You may also run a binary or uvx-based installation as an alternative
# Using npx (fastest way to get started)
npx kubernetes-mcp-server@latest --help
# Start the server with npx (example; customize via config as needed)
npx kubernetes-mcp-server@latest
# Using uvx (if you have uv and Python installed)
uvx kubernetes-mcp-server@latest --help
# Start the server with uvx (example)
uvx kubernetes-mcp-server@latest
# Run via the latest release binary
./kubernetes-mcp-server --help
# Then start the server directly
./kubernetes-mcp-server
# Claude Desktop example configuration (in claude_desktop_config.json)
``` json
{
"mcpServers": {
"kubernetes": {
"command": "npx",
"args": [
"-y",
"kubernetes-mcp-server@latest"
]
}
}
}
```
# Cursor extension example (mcp.json)
```json
{
"mcpServers": {
"kubernetes-mcp-server": {
"command": "npx",
"args": ["-y", "kubernetes-mcp-server@latest"]
}
}
}
```
# Goose CLI example (config.yaml)
```yaml
extensions:
kubernetes:
command: npx
args:
- -y
- kubernetes-mcp-server@latestConfigure the MCP server using CLI arguments or a TOML config file. You can set port, logging level, kubeconfig location, multi-cluster behavior, and more. See the Configuration Reference for full details.
If you have a multi-cluster kubeconfig, you can selectively target clusters per operation. You can enable or disable specific toolsets to control which Kubernetes capabilities are exposed to your tooling, reducing context size for AI agents. You can also enable observability with optional tracing and metrics.
Prompts and helpers are available to perform common tasks like health checks, cluster health, and troubleshooting for workloads and resources. These prompts help you guide the MCP server to perform tasks efficiently.
A Helm Chart is available to simplify deployment of the Kubernetes MCP server. Install using:
``
helm install kubernetes-mcp-server oci://ghcr.io/containers/charts/kubernetes-mcp-server
``
Join the community to share feedback and get help. Development can be done by building locally and running with inspector tooling to observe MCP server behavior.
The MCP server supports optional observability features and secures responses by redacting sensitive data before sending to clients.
Use the SPI-like telemetry and real-time statistics endpoint to verify health and performance during operation.
The server is designed as a native Go-based MCP server with direct API interactions to Kubernetes, avoiding reliance on external CLI wrappers for Kubernetes or Helm commands.
Perform comprehensive health assessment of Kubernetes/OpenShift cluster with optional namespace scoping and event inclusion.
Generate a step-by-step troubleshooting guide for diagnosing VirtualMachine issues in KubeVirt.
View the current Kubernetes kubeconfig content and context.
List Kubernetes events for debugging and troubleshooting in the current cluster.
List all Kubernetes namespaces in the current cluster.
List all OpenShift projects in the current cluster.
List all pods across all namespaces in the cluster.
Get details for a specific pod by name in a namespace.
Delete a specific pod by name in a namespace.
Fetch logs from a pod container with optional previous logs and tail lines.
Execute a command inside a pod container for shell access.
Run a new pod with a specific container image in a namespace.
Show resource usage for pods using the Metrics Server.
List Kubernetes resources by apiVersion and kind, with optional namespace and label filtering.
Get a specific resource by apiVersion, kind, and name.
Create or update a Kubernetes resource from a YAML/JSON representation.
Delete a Kubernetes resource by apiVersion, kind, and name.
Get or update the scale of a scalable resource.
Install a Helm chart as a release in a namespace.
List Helm releases in a namespace or all namespaces.
Uninstall a Helm release from a namespace.
List available kcp workspaces in the current cluster.
Describe a specific kcp workspace.
Return topology and health metrics for Istio mesh in a namespace.
Create, patch, or delete Istio configuration objects.
Get details for Kubernetes resources within the mesh.
Retrieve metrics for resources within a namespace.
Get logs for a workload's pods in a namespace.
Get traces for resources or a specific trace by ID.
Clone a KubeVirt VirtualMachine.
Create a VirtualMachine with specified configuration.
Manage VirtualMachine lifecycle actions like start, stop, or restart.