home / mcp / kubernetes mcp server

Kubernetes MCP Server

Native Go MCP server for Kubernetes and OpenShift with multi-cluster support, direct API access, and optional observability.

Installation
Add the following to your MCP client configuration file.

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.

How to use

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.

How to install

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.

Configuration and usage notes

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.

Security and access control

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.

Toolsets and available capabilities

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.

Examples of common operations

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.

Troubleshooting and tips

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.

Development and contribution

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.

Helm Chart

A Helm Chart is available to simplify the deployment of the Kubernetes MCP server. Additional details can be found in the chart README.

Development

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.

Available tools

config_view

View and manage the current local Kubernetes configuration (kubeconfig)

targets_list

List all available targets

configuration_view

Get the current Kubernetes configuration content as a kubeconfig YAML

events_list

List all the Kubernetes events in the current cluster from all namespaces

namespaces_list

List all the Kubernetes namespaces in the current cluster

projects_list

List all the OpenShift projects in the current cluster

nodes_log

Get logs from a Kubernetes node through the Kubernetes API proxy to the kubelet

nodes_stats_summary

Get detailed resource usage statistics from a Kubernetes node via the kubelet's Summary API

nodes_top

List the resource consumption for Kubernetes Nodes from the Metrics Server

pods_list

List all the Kubernetes pods in the current cluster from all namespaces

pods_list_in_namespace

List pods in a specific namespace in the current cluster

pods_get

Get a Kubernetes Pod by name in a namespace

pods_delete

Delete a Kubernetes Pod by name in a namespace

pods_top

List resource consumption for Pods from the Metrics Server

pods_exec

Execute a command inside a Pod container

pods_log

Get logs for a Pod in a namespace

pods_run

Run a Pod with a container image in a namespace

resources_list

List Kubernetes resources by apiVersion and kind across namespaces

resources_get

Get a Kubernetes resource by apiVersion, kind, and name

resources_create_or_update

Create or update a Kubernetes resource from a YAML/JSON representation

resources_delete

Delete a Kubernetes resource by apiVersion, kind, and name

resources_scale

Get or update the scale of a Kubernetes resource

kcp_workspaces_list

List all available kcp workspaces

kcp_workspace_describe

Get detailed information about a specific kcp workspace

kiali_mesh_graph

Return the topology and health graph for a namespace

kiali_manage_istio_config

Manage Istio configuration objects

kiali_get_resource_details

Get details for resources within the mesh

kiali_get_metrics

Get metrics for resources within a namespace

kiali_workload_logs

Get logs for a workload's pods

kiali_get_traces

Get traces for resources or a specific trace by ID

vm_create

Create a VirtualMachine with optional autostart and various configuration hints

vm_lifecycle

Manage VirtualMachine lifecycle actions (start, stop, restart)

helm_install

Install a Helm chart in a namespace

helm_list

List Helm releases across namespaces

helm_uninstall

Uninstall a Helm release from a namespace

config

View and manage the current local Kubernetes configuration (kubeconfig)