home / mcp / kubernetes mcp server
Provides a native MCP server for Kubernetes and OpenShift with configurable resources, pods, Helm, observability, and multi-cluster support.
Configuration
View docs{
"mcpServers": {
"containers-kubernetes-mcp-server": {
"command": "npx",
"args": [
"-y",
"kubernetes-mcp-server@latest"
],
"env": {
"MCP_CONFIG": "<MCP_CONFIG>",
"NODE_OPTIONS": "<NODE_OPTIONS>"
}
}
}
}You deploy and run a native Kubernetes MCP server to interact directly with the Kubernetes API. It provides a flexible set of MCP endpoints for Kubernetes and OpenShift resources, with optional observability and multi-cluster support, all implemented as a standalone Go binary or accessible via common package runners.
You use an MCP client to connect to the Kubernetes MCP server and perform operations across Kubernetes and OpenShift resources. Practical capabilities include listing resources, viewing and managing pods and events, running commands inside pods, managing Helm releases, and observing cluster metrics and traces. You can operate in read-only or restricted modes, enable or disable multi-cluster access, and turn on observability features such as distributed tracing.
Prerequisites: you need a machine with access to a Kubernetes cluster. You can run the MCP server from a local or remote setup using common tooling shown here.
# Run with npx (if you have Node.js installed)
npx kubernetes-mcp-server@latest
# Run with uvx (if you have uv and Python installed)
uvx kubernetes-mcp-server@latest
# Run the latest release binary directly
./kubernetes-mcp-serverConfigure options via command-line arguments or a TOML configuration file. You can control the server port, logging level, kubeconfig source, read-only and destructive operation modes, multi-cluster support, and the set of toolsets enabled to tailor the available functionality.
Optional distributed tracing and metrics can be enabled to monitor the MCP serverβs interactions with the Kubernetes API. Real-time statistics are available via a dedicated endpoint when telemetry is enabled.
Configure access controls and resource restrictions to limit what the MCP server can perform. You can enforce least-privilege access with a dedicated service account and restricted permissions for production deployments.
- View all pods across clusters and namespaces, then fetch logs for a specific pod to diagnose issues.
If you encounter connectivity issues, verify kubeconfig resolution, ensure the MCP server is listening on the expected port, and confirm the MCP client is configured with the correct context or namespace when performing operations.
The server is designed as a native Go-based implementation with no external command wrappers. It supports multiple clusters and aligns with Kubernetes concepts to provide a streamlined experience for managing resources through MCP endpoints.
Get the current Kubernetes configuration content as a kubeconfig YAML; supports a minified view option for concise output.
List Kubernetes pods across all namespaces with optional field selectors and label filters.
Retrieve a specific pod by name from a given namespace.
Fetch logs for a pod, with options to select container and tail lines.
Execute a command inside a pod's container to run diagnostics or ad-hoc tasks.
List Kubernetes resources by apiVersion and kind, with optional namespace and label filters.
Install a Helm chart into a specified namespace to create or update a release.
List Helm releases across namespaces.
Uninstall a Helm release from a namespace.
List all namespaces in the current cluster.
List Kubernetes events across namespaces for debugging and troubleshooting.