Kubernetes MCP Server

Manage Kubernetes and OpenShift clusters from an assistant through the cluster's API

By Containers Go Local · stdio DevOps and monitoringCloud platforms

88 popularity score ★ 2.2k ↓ 69k/wk

Connect your client

Local (npm)

Add in one click

Opens the app, which asks before it adds the server.

Or add it by command or config

Claude CodeTerminal
claude mcp add kubernetes -- npx -y kubernetes-mcp-server@latest
Claude Desktopclaude_desktop_config.json
{
  "mcpServers": {
    "kubernetes": {
      "command": "npx",
      "args": [
        "-y",
        "kubernetes-mcp-server@latest"
      ]
    }
  }
}
Cursor~/.cursor/mcp.json
{
  "mcpServers": {
    "kubernetes": {
      "command": "npx",
      "args": [
        "-y",
        "kubernetes-mcp-server@latest"
      ]
    }
  }
}
VS Code.vscode/mcp.json
{
  "servers": {
    "kubernetes": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "kubernetes-mcp-server@latest"
      ]
    }
  }
}
Codex~/.codex/config.toml
[mcp_servers.kubernetes]
command = "npx"
args = ["-y", "kubernetes-mcp-server@latest"]
Gemini CLITerminal
gemini mcp add --scope user kubernetes npx -- -y kubernetes-mcp-server@latest
Local (PyPI)

Add in one click

Opens the app, which asks before it adds the server.

Or add it by command or config

Claude CodeTerminal
claude mcp add kubernetes -- uvx kubernetes-mcp-server@latest
Claude Desktopclaude_desktop_config.json
{
  "mcpServers": {
    "kubernetes": {
      "command": "uvx",
      "args": [
        "kubernetes-mcp-server@latest"
      ]
    }
  }
}
Cursor~/.cursor/mcp.json
{
  "mcpServers": {
    "kubernetes": {
      "command": "uvx",
      "args": [
        "kubernetes-mcp-server@latest"
      ]
    }
  }
}
VS Code.vscode/mcp.json
{
  "servers": {
    "kubernetes": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "kubernetes-mcp-server@latest"
      ]
    }
  }
}
Codex~/.codex/config.toml
[mcp_servers.kubernetes]
command = "uvx"
args = ["kubernetes-mcp-server@latest"]
Gemini CLITerminal
gemini mcp add --scope user kubernetes uvx -- kubernetes-mcp-server@latest

Settings 7

KUBECONFIG Optional: Path to the kubeconfig, read by the Kubernetes client library when no kubeconfig is set in TOML. Default ~/.kube/config.
MCP_CONFIG_PATH Optional: Path to the main TOML file (read_only, toolsets, port and so on); ignored when --config is given.
KUBE_CLIENT_QPS Optional: Request rate limit for the Kubernetes API client; 0 uses the client's own default. Default 0.
KUBE_CLIENT_BURST Optional: Burst limit for the Kubernetes API client; 0 uses the client's own default. Default 0.
Set together: telemetry
OTEL_EXPORTER_OTLP_ENDPOINT Optional: OpenTelemetry collector endpoint; setting it turns on trace and metric export.
OTEL_EXPORTER_OTLP_PROTOCOL Optional: OTLP protocol, grpc or http/protobuf. Default grpc.
OTEL_TRACES_SAMPLER Optional: Trace sampling strategy, such as traceidratio.

What it does

Kubernetes MCP Server connects an MCP client to one or more Kubernetes or OpenShift clusters. It is a Go program that calls the Kubernetes API server directly instead of wrapping kubectl or helm, so neither has to be installed. It finds clusters through your kubeconfig, which it watches for changes, or through in-cluster credentials when it runs in a pod.

Only the core and config toolsets load by default. Together they cover everyday cluster work: listing and reading pods and their logs, running commands in containers, starting pods, events, namespaces and OpenShift projects, node logs and usage figures, and get, list, apply, delete and scale on any resource by apiVersion and kind. Optional toolsets add Helm releases, kcp workspaces, Kiali and Istio mesh views and config edits, KubeVirt virtual machines, NetObserv network flows and Tekton pipelines. Recent releases add four observability toolsets: Loki log queries (observability/logs), Prometheus and Alertmanager queries (observability/metrics), OpenTelemetry Collector config schemas and validation (observability/otelcol) and Tempo trace search (observability/traces). The tool snapshots at the release tag show 77 tools with every toolset on. There are also 16 prompts, such as a cluster health check.

It speaks stdio unless a port is set in TOML, then serves Streamable HTTP at /mcp, where it can require OAuth/OIDC. Settings live in TOML: read_only, disable_destructive, toolsets, enabled_tools, disabled_tools and denied_resources trim what it exposes, and confirmation_rules can ask the user before risky calls in clients that support elicitation. Its config code caps one tool result at 16 MiB (max_result_bytes), one backend response at 4 MiB (max_backend_response_bytes) and runs 64 calls at once (max_in_flight). It ships as native binaries for Linux, macOS and Windows, an npm package, a PyPI package, a container image and a Helm chart.

What it needs

RuntimeNode.jsPythonA prebuilt binary
Runs onmacOS, Windows, Linux
Kubernetes or OpenShift clusterYour own instanceA kubeconfig (~/.kube/config or $KUBECONFIG) or an in-cluster service account; it acts with that identity's RBAC rights
Also
  • Metrics Server in the cluster for pods_top and nodes_top
  • Helm, kcp, Kiali/Istio, KubeVirt, NetObserv, Tekton, Loki, Prometheus or Tempo in the cluster for the matching optional toolset

Pick one way to run it: Node.js for npx, uv for uvx, or the native release binary, which needs neither. vm_guest_info needs the QEMU guest agent running inside the VM. For production its Kubernetes setup guide suggests a dedicated ServiceAccount with read-only rights.

Limits

  • Not covered Only core and config load by default; every other toolset must be named in the TOML toolsets setting
  • Limit Runtime settings are TOML or a few environment variables; the only flags are --config, --config-dir and --version
  • Limit An unknown key in a TOML file stops the server from starting
  • Limit --config - reads the main TOML from stdin, but only in HTTP mode
  • Size cap A tool result is capped at 16 MiB and a backend response at 4 MiB by default (max_result_bytes, max_backend_response_bytes)
  • Rate limit At most 64 tool, prompt and resource calls run at once by default (max_in_flight)
  • Not covered OAuth sign-in only applies in HTTP mode, which needs port set in TOML
  • Limit The published container image serves Streamable HTTP on port 8080, not stdio
  • Read only read_only keeps only read tools and disable_destructive drops destructive ones; both are off by default
  • Limit api_resources_list is listed in the README on main but is not in the released package yet

Only the core and config toolsets load by default; Helm, kcp, Kiali, KubeVirt, NetObserv and Tekton tools must be enabled in the TOML toolsets setting. Runtime settings are TOML or a few environment variables, not command-line flags, and unknown TOML keys stop the server from starting. OAuth sign-in only works in HTTP mode. The published container image serves HTTP on port 8080 rather than stdio.

Who it suits

Suits developers and platform engineers who want an assistant to inspect and operate clusters they already reach with kubectl credentials, including OpenShift and multi-cluster kubeconfigs, without installing kubectl or helm. Because it acts with whatever rights the kubeconfig grants and can delete, exec and apply, it fits best with a dedicated ServiceAccount and read_only or disable_destructive turned on, as its own Kubernetes setup guide suggests for production. It is a community project under the containers organisation, not a release of the Kubernetes project or a cloud vendor; teams that only need a managed cloud's own Kubernetes console may prefer that vendor's server.

Tools 60 of 77

44 only read, 11 change things, 5 can delete or overwrite. A ? marks an optional parameter.

configuration_contexts_list
Lists the contexts in the kubeconfig and the API server each one points at
targets_list
With non-kubeconfig cluster providers such as ACM, lists the targets; renamed after the provider, e.g. cluster_list
configuration_view
Prints the kubeconfig in use as YAML, optionally trimmed to the current contextminified?: boolean
events_list
Lists cluster events in all namespaces or one, with pagingcontext?: stringcontinue?: stringfieldSelector?: stringlimit?: integernamespace?: string
namespaces_list
Lists namespaces, with paging and field selectorscontext?: stringcontinue?: stringfieldSelector?: stringlimit?: integer
projects_list
Lists OpenShift projectscontext?: stringcontinue?: stringlimit?: integer
nodes_log
Reads kubelet, kube-proxy or another log file from a node through the API proxycontext?: stringname: stringquery: stringtailLines?: integer
nodes_stats_summary
Returns a node's CPU, memory, disk and network statistics from the kubelet Summary APIcontext?: stringname: string
nodes_top
Shows CPU and memory use per node from Metrics Servercontext?: stringcontinue?: stringlabel_selector?: stringlimit?: integername?: string
pods_list
Lists pods across all namespaces, filtered by label or fieldcontext?: stringcontinue?: stringfieldSelector?: stringlabelSelector?: stringlimit?: integer
pods_list_in_namespace
Lists pods in one namespacecontext?: stringcontinue?: stringfieldSelector?: stringlabelSelector?: stringlimit?: integernamespace: string
pods_get
Fetches a single pod by namecontext?: stringname: stringnamespace?: string
pods_delete deletes
Deletes a pod by namecontext?: stringname: stringnamespace?: string
pods_top
Shows CPU and memory use per pod from Metrics Serverall_namespaces?: booleancontext?: stringcontinue?: stringlabel_selector?: stringlimit?: integername?: stringnamespace?: string
pods_exec deletes
Runs a command in a pod's container and returns the outputcommand: arraycontainer?: stringcontext?: stringname: stringnamespace?: string
pods_log
Reads a container's logs, including the previous instancecontainer?: stringcontext?: stringname: stringnamespace?: stringprevious?: booleantail?: integer
pods_run changes
Starts a pod from a container image, optionally exposing a portcontext?: stringimage: stringname?: stringnamespace?: stringport?: number
resources_list
Lists objects of any apiVersion and kind, by namespace, label or fieldapiVersion: stringcontext?: stringcontinue?: stringfieldSelector?: stringkind: stringlabelSelector?: stringlimit?: integernamespace?: string
resources_get
Fetches one object of any kind by nameapiVersion: stringcontext?: stringkind: stringname: stringnamespace?: string
resources_create_or_update deletes
Applies a YAML or JSON manifest, creating or replacing the objectcontext?: stringresource: string
resources_delete deletes
Deletes an object of any kind, with an optional grace periodapiVersion: stringcontext?: stringgracePeriodSeconds?: integerkind: stringname: stringnamespace?: string
resources_scale changes
Reads or sets the replica count of a Deployment, StatefulSet or other scalable objectapiVersion: stringcontext?: stringkind: stringname: stringnamespace?: stringscale?: integer
helm_install changes
Installs a Helm chart as a release, with optional valueschart: stringname?: stringnamespace?: stringvalues?: object
helm_list
Lists Helm releases in one namespace or all of themall_namespaces?: booleanlimit?: integernamespace?: stringoffset?: integer
helm_uninstall deletes
Removes a Helm releasename: stringnamespace?: string
vm_clone changes
Copies a KubeVirt virtual machine under a new namename: stringnamespace: stringtargetName: string
vm_console_screenshot
Takes a picture of a virtual machine's VNC consolename: stringnamespace: string
vm_create changes
Creates a KubeVirt virtual machine from a workload, size or instance typeautostart?: booleaninstancetype?: stringname: stringnamespace: stringnetworks?: arrayperformance?: stringpreference?: stringsize?: stringstorage?: stringworkload?: string
vm_guest_info
Reads operating system, network and disk details from inside a VM via the guest agentinfo_type?: enumname: stringnamespace: string
vm_lifecycle changes
Starts, stops or restarts a virtual machineaction: enumname: stringnamespace: string
vm_create_from_template changes
Creates a virtual machine from a VirtualMachineTemplate with parametersnamespace: stringparameters?: objecttemplate_name: string
vm_troubleshoot
Collects a VM's status, conditions and events to help diagnose itname: stringnamespace: string
loki_list_instances
Finds the Loki instances in the cluster
loki_label_names
Lists the log label names a Loki instance holdsend?: stringlokiName?: stringlokiNamespace?: stringstart?: stringtenant?: string
loki_label_values
Lists the values seen for one Loki labelend?: stringlabel: stringlokiName?: stringlokiNamespace?: stringstart?: stringtenant?: string
loki_query_range
Runs a LogQL query over a time range and returns log linesdirection?: stringduration?: stringend?: stringlimit?: integerlokiName?: stringlokiNamespace?: stringquery: stringstart?: stringtenant?: string
list_metrics
Lists Prometheus metric names that match a regular expressionname_regex: string
execute_instant_query
Runs a PromQL query at one point in timequery: stringtime?: string
execute_range_query
Runs a PromQL query over a time range at a set stepduration?: stringend?: stringquery: stringstart?: stringstep: string
show_timeseries
Runs a PromQL range query and returns it for display as a chartdescription?: stringduration?: stringend?: stringquery: stringstart?: stringstep: stringtitle?: string
get_label_names
Lists Prometheus label names, optionally for one metricend?: stringmetric?: stringstart?: string
get_label_values
Lists the values of one Prometheus labelend?: stringlabel: stringmetric?: stringstart?: string
get_series
Finds the time series that match given selectorsend?: stringmatches: stringstart?: string
get_alerts
Lists Alertmanager alerts, filtered by state or receiveractive?: booleanfilter?: stringinhibited?: booleanreceiver?: stringsilenced?: booleanunprocessed?: boolean
get_silences
Lists Alertmanager silencesfilter?: string
otelcol_list_components
Lists OpenTelemetry Collector receivers, processors, exporters and other components for a versionversion?: string
otelcol_get_component_schema
Returns the configuration schema of one Collector componentcomponent_name: stringcomponent_type: stringversion?: string
otelcol_validate_config
Checks a Collector component's configuration against its schemacomponent_name: stringcomponent_type: stringconfig: stringformat?: stringversion?: string
tempo_list_instances
Finds the Tempo instances in the cluster
tempo_get_trace_by_id
Fetches one trace from Tempo by its IDend?: stringstart?: stringtempoName: stringtempoNamespace: stringtenant?: stringtraceid: string
tempo_search_traces
Searches Tempo for traces with a TraceQL queryend?: stringlimit?: integerquery: stringspss?: integerstart?: stringtempoName: stringtempoNamespace: stringtenant?: string
tempo_search_tags
Lists the span and resource attribute names Tempo has seenend?: stringlimit?: integermaxStaleValues?: integerquery?: stringscope?: stringstart?: stringtempoName: stringtempoNamespace: stringtenant?: string
tempo_search_tag_values
Lists the values seen for one trace attributeend?: stringlimit?: integermaxStaleValues?: integerquery?: stringstart?: stringtag: stringtempoName: stringtempoNamespace: stringtenant?: string
tekton_pipeline_start changes
Starts a Tekton Pipeline by creating a PipelineRun with parametersname: stringnamespace?: stringparams?: object
tekton_pipelinerun_lifecycle changes
Restarts or cancels a PipelineRunaction: enumname: stringnamespace?: string
tekton_pipelinerun_logs
Reads the logs of the TaskRuns in a PipelineRunname: stringnamespace?: stringstep?: stringtail?: integertask?: string
tekton_pipelinerun_diagnose
Collects a failed PipelineRun's conditions, failed steps with log tails, and warning events in one callname: stringnamespace: string
tekton_task_start changes
Starts a Tekton Task by creating a TaskRunname: stringnamespace?: stringparams?: object
tekton_taskrun_restart changes
Runs a TaskRun again with the same specname: stringnamespace?: string
tekton_taskrun_logs
Reads a TaskRun's step logs from its podname: stringnamespace?: stringstep?: stringtail?: integer

Prompts 16

cluster-health-check
Walks through a health check of a Kubernetes or OpenShift cluster, optionally one namespace
mesh-list-applications
Lists applications in the Istio mesh namespaces (kiali)
list-istio-config
Lists Istio configuration objects in the mesh namespaces (kiali)
mesh-list-namespaces
Lists namespaces with their sidecar injection state (kiali)
mesh-list-services
Lists services in the mesh namespaces (kiali)
mesh-list-workloads
Lists workloads in the mesh namespaces (kiali)
mesh-health-check
Checks control plane and data plane health of the mesh (kiali)
mesh-topology
Describes mesh control plane components and cluster links (kiali)
traffic-topology
Maps service dependencies and traffic flow in the mesh (kiali)
service-troubleshoot
Looks into service errors through logs, traces and Istio config (kiali)
trace-analysis
Looks for slow spans and error sources in a service's traces (kiali)
istio-config-review
Reviews Istio configuration in a namespace for mistakes (kiali)
vm-troubleshoot
Produces step-by-step troubleshooting for a KubeVirt VM (kubevirt)
windows-golden-image
Guides building a Windows golden image with the windows-efi-installer Tekton pipeline (kubevirt)
hco-status
Reports the state of the HyperConverged Cluster Operator (kubevirt)
pipeline-troubleshoot
Gathers a PipelineRun's status, failed step logs and events for troubleshooting (tekton)

Similar servers