home / mcp / kubernetes mcp server
Native Go MCP server for Kubernetes and OpenShift with multi-cluster support, direct API access, and optional observability.
Configuration
View docs{
"mcpServers": {
"containers-kubernetes-mcp-server": {
"command": "npx",
"args": [
"-y",
"kubernetes-mcp-server@latest"
]
}
}
}You manage Kubernetes and OpenShift resources through a native MCP (Model Context Protocol) server that talks directly to the Kubernetes API. This server provides CRUD operations for generic resources, Pods, Namespaces, Events, Helm, and OpenShift projects, plus specialized tooling to inspect and control clusters. It is designed for high performance, multi-cluster use, and straightforward configuration without requiring external CLI wrappers.
You run the Kubernetes MCP server as a local process and connect to it from an MCP client or integration. The server can operate in multi-cluster mode by using your kubeconfig, or in a single-cluster setup by configuring a specific context. You can access a wide range of Kubernetes and OpenShift capabilities, including listing resources, managing pods, viewing events, inspecting logs, running commands in pods, and handling Helm charts.
Prerequisites: you need a machine with a supported operating system (Linux, macOS, or Windows) and network access to your Kubernetes cluster. You also need either Node.js/npm or Python if you plan to use helper tools, but the MCP server itself is a native binary or a cross-platform runtime that can be run directly.
Step 1. Run the MCP server using the package runner you prefer. The fastest way to try Kubernetes MCP Server on a desktop environment is via an inline command using a package runner. For example, you can run the MCP server with npx to fetch and execute the latest version.
Step 2. If you want to explore help and available commands, start the server in help mode to learn about runtime options and toolsets.
The server supports a main TOML configuration file plus optional drop-in files. You can load the main config with --config and provide per-directory overrides with --config-dir. Changes can be reloaded at runtime via SIGHUP when you started with a config. If you modify kubeconfig or cluster-related settings, you will need to restart the server.
Example startup configuration (simplified): You can run the server using npx, which executes the latest package version. You may also run the server directly from a binary or with uvx if you have Python available.
For production deployments, configure a dedicated ServiceAccount with read-only access to the Kubernetes API for reporting and inspection tasks. Use separate kubeconfig contexts to isolate clusters and enforce least-privilege access.
The MCP server offers configurable toolsets to tailor available actions. The core sets include configuration viewing, common Kubernetes tools, and Helm chart management. Additional toolsets extend support for Kiali, KubeVirt, and more..enabled toolsets reduce context size and improve tool selection by the AI.
List all namespaces, inspect pods in a namespace, view events, fetch pod logs, execute commands inside a pod, run a Helm chart, and manage OpenShift projects. You can also query resources by apiVersion and kind and filter by namespace or labels.
If you need to update configuration without restarting, use SIGHUP after starting the server with a config. If you change kubeconfig or cluster access details, plan a restart. Monitor log levels to diagnose issues and adjust the --log-level as needed.
If you are contributing, you can build the server locally and test with a focused inspector tool to observe internal behavior. The project provides a dev flow that includes a build step and a local runtime.
A Helm Chart is available to simplify the deployment of the Kubernetes MCP server. Additional details can be found in the chart README.
Running with mcp-inspector helps you inspect the MCP server while you develop. Compile the project and start the server with the inspector to verify behavior.
View and manage the current local Kubernetes configuration (kubeconfig)
List all available targets
Get the current Kubernetes configuration content as a kubeconfig YAML
List all the Kubernetes events in the current cluster from all namespaces
List all the Kubernetes namespaces in the current cluster
List all the OpenShift projects in the current cluster
Get logs from a Kubernetes node through the Kubernetes API proxy to the kubelet
Get detailed resource usage statistics from a Kubernetes node via the kubelet's Summary API
List the resource consumption for Kubernetes Nodes from the Metrics Server
List all the Kubernetes pods in the current cluster from all namespaces
List pods in a specific namespace in the current cluster
Get a Kubernetes Pod by name in a namespace
Delete a Kubernetes Pod by name in a namespace
List resource consumption for Pods from the Metrics Server
Execute a command inside a Pod container
Get logs for a Pod in a namespace
Run a Pod with a container image in a namespace
List Kubernetes resources by apiVersion and kind across namespaces
Get a Kubernetes 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 Kubernetes resource
List all available kcp workspaces
Get detailed information about a specific kcp workspace
Return the topology and health graph for a namespace
Manage Istio configuration objects
Get details for resources within the mesh
Get metrics for resources within a namespace
Get logs for a workload's pods
Get traces for resources or a specific trace by ID
Create a VirtualMachine with optional autostart and various configuration hints
Manage VirtualMachine lifecycle actions (start, stop, restart)
Install a Helm chart in a namespace
List Helm releases across namespaces
Uninstall a Helm release from a namespace
View and manage the current local Kubernetes configuration (kubeconfig)