# kubernetes-mcp-server [Health: Active]

**Category:** ☁️ Cloud Platforms  
**Repository:** https://github.com/containers/kubernetes-mcp-server  
**GitHub Stars:** 2176  
**npm Downloads (last month):** 51986  
**Views:** 5  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/kubernetes-mcp-server

## Description
A Model Context Protocol (MCP) server for Kubernetes and OpenShift

## Tools
Capabilities this server exposes over MCP:

- **configuration_contexts_list** — List all available context names and associated server urls from the kubeconfig file
- **targets_list** — List all available targets
- **configuration_view** — Get the current Kubernetes configuration content as a kubeconfig YAML
- **events_list** — List Kubernetes events (warnings, errors, state changes) for debugging and troubleshooting in the current cluster from all namespaces. Use limit and continue to retrieve a large list one page at a time.
- **namespaces_list** — List all the Kubernetes namespaces in the current cluster. Use limit and continue to retrieve a large list one page at a time.
- **projects_list** — List all the OpenShift projects in the current cluster. Use limit and continue to retrieve a large list one page at a time.
- **nodes_log** — Get logs from a Kubernetes node (kubelet, kube-proxy, or other system logs). This accesses node logs 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. Provides comprehensive metrics including CPU, memory, filesystem, and network usage at the node, pod, and container levels. On systems with cgroup v2 and kernel 4.20+, also includes PSI (Pressure Stall Info…
- **nodes_top** — List the resource consumption (CPU and memory) as recorded by the Kubernetes Metrics Server for the specified Kubernetes Nodes or all nodes in the cluster. Use limit and continue to retrieve a large list one page at a time.
- **pods_list** — List all the Kubernetes pods in the current cluster from all namespaces. Use limit and continue to retrieve a large list one page at a time.
- **pods_list_in_namespace** — List all the Kubernetes pods in the specified namespace in the current cluster. Use limit and continue to retrieve a large list one page at a time.
- **pods_get** — Get a Kubernetes Pod in the current or provided namespace with the provided name
- **pods_delete** — Delete a Kubernetes Pod in the current or provided namespace with the provided name
- **pods_top** — List the resource consumption (CPU and memory) as recorded by the Kubernetes Metrics Server for the specified Kubernetes Pods in the all namespaces, the provided namespace, or the current namespace. Use limit and continue to retrieve a large list one page at a time.
- **pods_exec** — Execute a command in a Kubernetes Pod (shell access, run commands in container) in the current or provided namespace with the provided name and command
- **pods_log** — Get the logs of a Kubernetes Pod in the current or provided namespace with the provided name
- **pods_run** — Run a Kubernetes Pod in the current or provided namespace with the provided container image and optional name
- **resources_list** — List Kubernetes resources and objects in the current cluster by providing their apiVersion and kind and optionally the namespace and label selector. Use limit and continue to retrieve a large list one page at a time.
- **resources_get** — Get a Kubernetes resource in the current cluster by providing its apiVersion, kind, optionally the namespace, and its name
- **resources_create_or_update** — Create or update a Kubernetes resource via Server-Side Apply. The manifest is the complete desired state: any field this tool previously set and the new manifest omits is removed. To edit an existing resource, fetch it with resources_get, modify it, then re-apply the full resource.
- **resources_delete** — Delete a Kubernetes resource in the current cluster by providing its apiVersion, kind, optionally the namespace, and its name
- **resources_scale** — Get or update the scale of a Kubernetes resource in the current cluster by providing its apiVersion, kind, name, and optionally the namespace. If the scale is set in the tool call, the scale will be updated to that value. Always returns the current scale of the resource
- **helm_install** — Install (deploy) a Helm chart to create a release in the current or provided namespace
- **helm_list** — List all the Helm releases in the current or provided namespace (or in all namespaces if specified). Use limit and offset to page the releases returned to you. Helm loads release secrets before applying that page, so a secret list that exceeds max_backend_response_bytes can still fail.
- **helm_uninstall** — Uninstall a Helm release in the current or provided namespace
- **kcp_workspaces_list** — List all available kcp workspaces in the current cluster
- **kcp_workspace_describe** — Get detailed information about a specific kcp workspace
- **kiali_get_mesh_traffic_graph** — Returns service-to-service traffic topology, dependencies, and network metrics (throughput, response time, mTLS) for the specified namespaces. Use this to diagnose routing issues, latency, or find upstream/downstream dependencies.
- **kiali_get_mesh_status** — Retrieves the high-level health, topology, and environment details of the Istio service mesh. Returns multi-cluster control plane status (istiod), data plane namespace health (including ambient mesh status), observability stack health (Prometheus, Grafana...), and component connectivity. Use this t…
- **kiali_manage_istio_config_read** — Read Istio, Gateway API, and Inference API config. 'list' groups by namespace→'group/version/kind'→{valid:[...],invalid:[...]} where valid/invalid arrays contain resource names; omit group/kind to retrieve ALL config types in a single call. Supports Istio (networking.istio.io, security.istio.io), G…
- **kiali_manage_istio_config** — Create, patch, or delete Istio, Gateway API, and Inference API config. Supports Istio resources (networking.istio.io, security.istio.io), Gateway API resources (gateway.networking.k8s.io), and Inference API resources (inference.networking.k8s.io) when installed on the cluster. For list and get (rea…
- **kiali_list_mesh_clusters** — Returns the list of Istio mesh clusters that Kiali can access. Each entry includes its name and whether it is the home cluster (where Kiali is deployed). Call this tool before using meshCluster on other Kiali tools when the target cluster is unknown.
- **kiali_get_resource_details** — Fetches a list of resources OR retrieves detailed data for a specific resource. If 'resourceName' is omitted, it returns a list. If 'resourceName' is provided, it returns details for that specific resource.
- **kiali_list_traces** — Lists distributed traces for a service in a namespace. Returns a summary (namespace, service, total_found, avg_duration_ms) and a list of traces with id, duration_ms, spans_count, root_op, slowest_service, has_errors. Use get_trace_details with a trace id to get full hierarchy.
- **kiali_get_trace_details** — Fetches a single distributed trace by trace_id and returns its call hierarchy (service tree with duration, status, and nested calls). Use this after list_traces to drill into a specific trace.
- **kiali_get_pod_performance** — Returns a human-readable text summary with current Pod CPU/memory usage (from Prometheus) compared to Kubernetes requests/limits (from the Pod spec). Useful to answer questions like 'Is this workload using too much memory?'
- **kiali_get_logs** — Get the logs of a Kubernetes Pod (or workload name that will be resolved to a pod) in a namespace. Output is plain text, matching kubernetes-mcp-server pods_log. The line_count field tells you the total number of log lines returned. Analyze ALL of them, but summarize the results unless the user exp…
- **kiali_get_metrics** — Returns a compact JSON summary of Istio metrics (latency quantiles, traffic trends, throughput, payload sizes) for the given resource.
- **vm_clone** — Clone a VirtualMachine on KubeVirt by creating a VirtualMachineClone resource. This creates a copy of the source VM with a new name using the KubeVirt Clone API
- **vm_console_screenshot** — Capture a screenshot of the graphical (VNC) console of a VirtualMachine on KubeVirt as a PNG image. Use this to see what is currently displayed on the VM's screen (for example firmware, a bootloader, or a login prompt). Read-only: it never sends input to the guest.
- **vm_create** — Create a VirtualMachine on KubeVirt with the specified configuration, automatically resolving instance types, preferences, and container disk images. VM will be created in Halted state by default; use autostart parameter to start it immediately.
- **vm_guest_info** — Get guest operating system information from a VirtualMachine's QEMU guest agent. Requires the guest agent to be installed and running inside the VM. Provides detailed information about the OS, filesystems, network interfaces, and logged-in users.
- **vm_lifecycle** — Manage KubeVirt VirtualMachine lifecycle: start, stop, restart, pause, or unpause a VM
- **vm_create_from_template** — Create a VirtualMachine from a VirtualMachineTemplate (virt-template) on KubeVirt. Processes the template server-side to substitute parameters (required values, defaults, and auto-generated values like passwords), then creates the resulting VirtualMachine in the same namespace. Cross-namespace temp…
- **vm_troubleshoot** — Diagnose KubeVirt VirtualMachine issues with automated root-cause detection. Collects VM status, VMI status, volumes, DataVolume/PVC state, cloud-init configuration, pod state, logs, and events, then runs heuristic checks to identify specific problems and suggest fixes. Returns a 'Detected Issues'…
- **netobserv_list_flows** — Lists NetObserv network flow records from Loki. Use when investigating traffic between workloads, IPs, ports, or protocols in a namespace or time window.
- **netobserv_export_flows** — Exports NetObserv flow records as CSV with the same filters as list_flows. Use when the user needs downloadable flow data for audits or offline analysis.
- **netobserv_get_flow_metrics** — Returns aggregated NetObserv flow metrics as topology or time-series data. Use for throughput, TLS/DNS/drop breakdowns, and namespace or workload traffic analysis; see aggregateBy and groups for grouping options.
- **loki_list_instances** — List LokiStack instances available in the Kubernetes cluster.
- **loki_label_names** — List available Loki label names for a time range. Use this before writing LogQL queries.
- **loki_label_values** — List possible values for a Loki label key. Use this to build precise label matchers in LogQL.
- **loki_query_range** — Execute a Loki LogQL range query and return matching log streams and lines.
- **list_metrics** — MANDATORY FIRST STEP: List all available metric names in Prometheus.
- **execute_instant_query** — Execute a PromQL instant query to get current/point-in-time values.
- **execute_range_query** — Execute a PromQL range query to get time-series data over a period.
- **show_timeseries** — Display the results as an interactive timeseries chart.
- **get_label_names** — Get all label names (dimensions) available for filtering a metric.
- **get_label_values** — Get all unique values for a specific label.
- **get_series** — Get time series matching selectors and preview cardinality.
- **get_alerts** — Get alerts from Alertmanager.
- **get_silences** — Get silences from Alertmanager.
- **otelcol_list_components** — List available OpenTelemetry Collector components (receivers, processors, exporters, extensions, connectors) for a given version.
- **otelcol_get_component_schema** — Get the JSON schema for an OpenTelemetry Collector component's configuration options.
- **otelcol_validate_config** — Validate an OpenTelemetry Collector component configuration against its JSON schema.
- **otelcol_get_versions** — List available OpenTelemetry Collector versions and identify the latest.
- **tempo_list_instances** — List all Tempo instances available in the Kubernetes cluster.
- **tempo_get_trace_by_id** — Retrieve a single distributed trace by its trace ID from Tempo.
- **tempo_search_traces** — Search for distributed traces in Tempo using TraceQL.
- **tempo_search_tags** — List available tag names (attribute keys) in Tempo, grouped by scope.
- **tempo_search_tag_values** — List the known values for a specific tag (attribute key) in Tempo.
- **tekton_pipeline_start** — Start a Tekton Pipeline by creating a PipelineRun that references it
- **tekton_pipelinerun_lifecycle** — Manage a Tekton PipelineRun lifecycle by restarting it with the same spec or cancelling it by setting spec.status to Cancelled.
- **tekton_pipelinerun_logs** — Get logs for all TaskRuns owned by a Tekton PipelineRun. Use this to inspect PipelineRun execution output without locating pods manually.
- **tekton_task_start** — Start a Tekton Task by creating a TaskRun that references it
- **tekton_taskrun_restart** — Restart a Tekton TaskRun by creating a new TaskRun with the same spec
- **tekton_taskrun_logs** — Get the logs from a Tekton TaskRun by resolving its underlying pod

## Claude Desktop Quick Installation
No confirmed install details yet, so no config is published. Follow the setup steps in the repository above.

## Documentation

## What kubernetes-mcp-server does

kubernetes-mcp-server exposes Kubernetes and OpenShift operations as Model Context Protocol tools. It can read kubeconfig contexts, inspect the active configuration, enumerate cluster objects, and work across multiple clusters defined in kubeconfig files. The implementation communicates directly with the Kubernetes API rather than shelling out to kubectl or helm.

Its scope covers both read and write operations. Agents can retrieve, create, update, scale, and delete arbitrary Kubernetes resources, while specialized tools handle pods, namespaces, events, nodes, Helm releases, and OpenShift projects. Additional capabilities cover kcp workspaces and Kiali or Istio service-mesh information.

## How it works

The server uses the Kubernetes configuration available to the process, either from kubeconfig or an in-cluster configuration. It can detect configuration changes and update its available contexts. Requests are sent to the Kubernetes API, including API-proxy access for node logs and kubelet access for node Summary API statistics.

Many listing operations support pagination. Tools use parameters such as `limit` and `continue`, while Helm release listing uses `limit` and `offset`. Resource updates use Kubernetes Server-Side Apply: the supplied manifest represents the complete desired state, so fields omitted from an existing resource can be removed.

## Setup and configuration

A Kubernetes cluster is required. The project provides a native binary for Linux, macOS, and Windows, along with npm, Python, and container or Docker distributions. Native binaries do not require Node.js or Python on the host.

For Claude Desktop, Cursor, VS Code, and Goose, the documented npm setup runs `npx -y kubernetes-mcp-server@latest` as the MCP command. Claude Code has a dedicated setup path, including guidance for using a dedicated read-only Kubernetes ServiceAccount in production. Configuration can be supplied through command-line arguments, TOML files, or environment variables.

## Tools and capabilities

- Inspect kubeconfig contexts, server URLs, and the current configuration.
- List namespaces, OpenShift projects, events, pods, resources, nodes, and Helm releases.
- Read, create or update, scale, and delete generic Kubernetes resources.
- Retrieve pod logs, execute commands in pods, delete pods, run container images, and inspect pod metrics.
- Retrieve node logs and node, pod, or container resource statistics; node statistics can include CPU, memory, filesystem, network, and pressure metrics where supported.
- Install and uninstall Helm releases.
- List and describe kcp workspaces, and query Kiali traffic graphs, service-mesh status, and Istio-related configuration.
- Support Tekton pipeline and task operations, including starting, restarting, canceling, troubleshooting, and retrieving logs.

## Limitations and notes

Operations depend on the Kubernetes or OpenShift permissions of the configured identity. Write-capable tools can modify or remove cluster resources, and Server-Side Apply requires care when a manifest omits fields from an existing object. Metrics tools rely on the corresponding Kubernetes Metrics Server or kubelet APIs. Helm listing can fail when the relevant secret list exceeds the backend response-size limit. Optional OpenTelemetry tracing and metrics are available, including a `/stats` endpoint for runtime statistics.

_Full upstream README: https://allmcps.com/mcp/kubernetes-mcp-server/readme_

