Kubernetes Mcp Server

devops-infra MCP Server

Model Context Protocol (MCP) server for Kubernetes and OpenShift

VerifiedInstall Ready
devops-infradevops-infrakubernetes
7 views1,723 stars373 forksApache-2.0

Why This Matters

Discovered via github-topic:mcp and last synced 3mo ago.

VerifiedInstall Ready
Source
github-topic:mcp
Stars
1,723
Last synced
3mo ago
Install
Instructions detected

Install

1. Install the package

npx -y kubernetes-mcp-server@latest

2. Add to claude_desktop_config.json

{
  "mcpServers": {
    "kubernetes-mcp-server": {
      "command": "npx",
      "args": [
        "kubernetes-mcp-server"
      ]
    }
  }
}

Config file location: ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) / %APPDATA%\Claude\claude_desktop_config.json (Windows)

121
Tools
0
Resources
0
Prompts
Standard I/O
Transport

Available Tools (121)

endMicros

(`string`) - End time for traces in microseconds since epoch (optional, defaults to 10 minutes after startMicros if not provided, only used when traceId is not provided)

targets_list

List all available targets

image

(`string`) **(required)** - Container Image to run in the Pod

since

(`string`) - Time duration to fetch logs from (e.g., '5m', '1h', '30s'). If not provided, returns recent logs

pods_log

Get the logs of a Kubernetes Pod in the current or provided namespace with the provided name

resource_name

(`string`) - Name of the resource to get traces for. Required if traceId is not provided.

startMicros

(`string`) - Start time for traces in microseconds since epoch (optional, defaults to 10 minutes before current time if not provided, only used when traceId is not provided)

chart

(`string`) **(required)** - Chart reference to install (for example: stable/grafana, oci://ghcr.io/nginxinc/charts/nginx-ingress)

resource_type

(`string`) - Type of resource to get traces for (app, service, workload). Required if traceId is not provided.

kiali_get_traces

Gets traces for a specific resource (app, service, workload) in a namespace, or gets detailed information for a specific trace by its ID. If traceId is provided, it returns detailed trace information and other parameters are not required.

tags

(`string`) - JSON string of tags to filter traces (optional, only used when traceId is not provided)

json_data

(`string`) - JSON data to apply or create the object

values

(`object`) - Values to pass to the Helm chart (Optional)

workspace

(`string`) **(required)** - Name or path of the workspace to describe

kiali_workload_logs

Get logs for a specific workload's pods in a namespace. Only requires namespace and workload name - automatically discovers pods and containers. Optionally filter by container name, time range, and other parameters. Container is auto-detected if not specified.

kiali_mesh_graph

Returns the topology of a specific namespaces, health, status of the mesh and namespaces. Includes a mesh health summary overview with aggregated counts of healthy, degraded, and failing apps, workloads, and services. Use this for high-level overviews

minDuration

(`integer`) - Minimum trace duration in microseconds (optional, only used when traceId is not provided)

kiali_manage_istio_config_read

Read-only Istio config: list or get objects. For action 'list', returns an array of objects with {name, namespace, type, validation}. For create, patch, or delete use manage_istio_config.

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

namespaces_list

List all the Kubernetes namespaces in the current cluster

name

(`string`) **(required)** - Name of the TaskRun to get logs from

namespace

(`string`) - Namespace of the TaskRun

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

pods_get

Get a Kubernetes Pod in the current or provided namespace with the provided name

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 tool as the first step to diagnose mesh-wide issues, verify Istio/Kiali versions, or check overall health before drilling into specific workloads.

configuration_view

Get the current Kubernetes configuration content as a kubeconfig YAML

port

(`number`) - TCP/IP port to expose from the Pod container (Optional, no port exposed if not provided)

vm_create

Create a KubeVirt VirtualMachine in the cluster 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.

events_list

List Kubernetes events (warnings, errors, state changes) for debugging and troubleshooting in the current cluster from all namespaces

configuration_contexts_list

List all available context names and associated server urls from the kubeconfig file

size

(`string`) - Optional workload size hint for the VM (e.g., 'small', 'medium', 'large', 'xlarge'). Used to auto-select an appropriate instance type if not explicitly specified.

tailLines

(`integer`) - Number of lines to retrieve from the end of the logs (Optional, 0 means all logs)

resources_create_or_update

Create or update a Kubernetes resource in the current cluster by providing a YAML or JSON representation of the resource

pods_list

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

data

(`string`) - Complete JSON or YAML data to apply or create the object. Required for create and patch actions. You MUST provide a COMPLETE and VALID manifest with ALL required fields for the resource type. Arrays (like servers, http, etc.) are REPLACED entirely, so you must include ALL required fields within each array element.

tekton_taskrun_logs

Get the logs from a Tekton TaskRun by resolving its underlying pod

resources_list

List Kubernetes resources and objects in the current cluster by providing their apiVersion and kind and optionally the namespace and label selector

kcp_workspaces_list

List all available kcp workspaces in the current cluster

timeRange

(`string`) - Time window used to compute CPU rate (Prometheus duration like '5m', '10m', '1h', '1d'). Defaults to '10m'.

severity

(`string`) - Optional severity filter applied client-side. Accepts 'ERROR', 'WARN' or combinations like 'ERROR,WARN'.

rateInterval

(`string`) - Rate interval for metrics (e.g., '1m', '5m'). Optional, defaults to '10m'

targetName

(`string`) **(required)** - The name for the new cloned virtual machine

minified

(`boolean`) - Return a minified version of the configuration. If set to true, keeps only the current-context and the relevant pieces of the configuration for that context. If set to false, all contexts, clusters, auth-infos, and users are returned in the configuration. (Optional, default true)

resources_get

Get a Kubernetes resource in the current cluster by providing its apiVersion, kind, optionally the namespace, and its name

gracePeriodSeconds

(`integer`) - Optional duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used

scale

(`integer`) - Optional scale to update the resources scale to. If not provided, will return the current scale of the resource, and not update it

helm_uninstall

Uninstall a Helm release in the current or provided namespace

namespaces

(`string`) - Comma-separated list of namespaces to query (e.g., 'bookinfo' or 'bookinfo,default'). If not provided, it will query across all accessible namespaces.

errorOnly

(`boolean`) - If true, only consider traces that contain errors. Default false.

direction

(`string`) - Traffic direction. Optional, defaults to 'outbound'

AVAILABLE-TOOLSETS-TOOLS-START

>

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

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

group

(`string`) **(required)** - API group of the Istio object

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_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 explicitly asks for the raw output. Do not omit any error or warning lines.

pods_list_in_namespace

List all the Kubernetes pods in the specified namespace in the current cluster

graphType

(`string`) - Granularity of the graph. 'app' aggregates by app name, 'versionedApp' separates by versions, 'workload' maps specific pods/deployments. Default: versionedApp.

object

(`string`) **(required)** - Name of the Istio object

projects_list

List all the OpenShift projects in the current cluster

apiVersion

(`string`) **(required)** - apiVersion of the resource (examples of valid apiVersion are apps/v1)

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

kcp_workspace_describe

Get detailed information about a specific kcp workspace

serviceName

(`string`) **(required)** - Service name to search traces for (required). Returns multiple traces up to limit.

workloadName

(`string`) - Kubernetes Workload name (e.g. Deployment/StatefulSet/etc). Tool will look up the workload and pick one of its Pods. If not found, it will fall back to treating this value as a podName.

reporter

(`string`) - Metrics reporter(s). Comma-separated list of: 'source', 'destination', 'waypoint', or the special value 'both' (no reporter filter). Optional, defaults to 'source'. Example: 'source,waypoint'

storage

(`string`) - Optional storage size for the VM's root disk when using DataSources (e.g., '30Gi', '50Gi', '100Gi'). Defaults to 30Gi. Ignored when using container disks.

label_selector

(`string`) - Kubernetes label selector (e.g. 'app=myapp,env=prod' or 'app in (myapp,yourapp)'), use this option when you want to filter the pods by label (Optional, only applicable when name is not provided)

container

(`string`) - Optional. Name of the Pod container to get the logs from.

pods_run

Run a Kubernetes Pod in the current or provided namespace with the provided container image and optional name

labelSelector

(`string`) - Optional Kubernetes label selector (e.g. 'app=myapp,env=prod' or 'app in (myapp,yourapp)'), use this option when you want to filter the resources by label

resources_delete

Delete a Kubernetes resource in the current cluster by providing its apiVersion, kind, optionally the namespace, and its name

all_namespaces

(`boolean`) - If true, lists all Helm releases in all namespaces ignoring the namespace argument (Optional)

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_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?'

helm_install

Install (deploy) a Helm chart to create a release in the current or provided namespace

version

(`string`) **(required)** - API version. Use 'v1' for VirtualService, DestinationRule, and Gateway.

limit

(`integer`) - Maximum number of traces to return. Default 10.

podName

(`string`) - Kubernetes Pod name. If workloadName is provided, the tool will attempt to resolve a Pod from that workload first.

vm_lifecycle

Manage KubeVirt VirtualMachine lifecycle: start, stop, or restart a VM

pods_delete

Delete a Kubernetes Pod in the current or provided namespace with the provided name

command

(`array`) **(required)** - Command to execute in the Pod container. The first item is the command to be run, and the rest are the arguments to that command. Example: ["ls", "-l", "/tmp"]

tail

(`integer`) - Number of lines to retrieve from the end of the logs (Optional, default: 100)

resource

(`string`) **(required)** - A JSON or YAML containing a representation of the Kubernetes resource. Should include top-level fields such as apiVersion,kind,metadata, and spec

kind

(`string`) **(required)** - Kind of the Istio object (e.g., 'VirtualService', 'DestinationRule').

helm_list

List all the Helm releases in the current or provided namespace (or in all namespaces if specified)

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.

traceId

(`string`) **(required)** - Trace ID to fetch and summarize. If provided, namespace/service_name are ignored.

clusterName

(`string`) - Cluster name to get metrics from. Optional, defaults to the cluster name in the Kiali configuration (KubeConfig)

kiali_get_metrics

Returns a compact JSON summary of Istio metrics (latency quantiles, traffic trends, throughput, payload sizes) for the given resource.

resourceName

(`string`) **(required)** - Name of the resource to get metrics for

instancetype

(`string`) - Optional instance type name for the VM (e.g., 'u1.small', 'u1.medium', 'u1.large')

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.

kiali_manage_istio_config

Create, patch, or delete Istio config. For list and get (read-only) use manage_istio_config_read.

lookbackSeconds

(`integer`) - How far back to search. Default 600 (10m).

queryTime

(`string`) - Optional end timestamp (RFC3339) for the query. Defaults to now.

previous

(`boolean`) - Optional. Return previous terminated container logs

quantiles

(`string`) - Comma-separated list of quantiles for histogram metrics (e.g., '0.5,0.95,0.99'). Optional

preference

(`string`) - Optional preference name for the VM

action

(`string`) **(required)** - The lifecycle action to perform: 'start' (changes runStrategy to Always), 'stop' (changes runStrategy to Halted), or 'restart' (stops then starts the VM)

step

(`string`) - Step between data points in seconds (e.g., '15'). Optional, defaults to 15 seconds

params

(`object`) - Parameter values to pass to the Task. Keys are parameter names; values can be a string, an array of strings, or an object (map of string to string) depending on the parameter type defined in the Task spec

workload

(`string`) - The workload for the VM. Accepts OS names (e.g., 'fedora' (default), 'ubuntu', 'centos', 'centos-stream', 'debian', 'rhel', 'opensuse', 'opensuse-tumbleweed', 'opensuse-leap') or full container disk image URLs

requestProtocol

(`string`) - Filter by request protocol (e.g., 'http', 'grpc', 'tcp'). Optional

autostart

(`boolean`) - Optional flag to automatically start the VM after creation (sets runStrategy to Always instead of Halted). Defaults to false.

tekton_pipeline_start

Start a Tekton Pipeline by creating a PipelineRun that references it

AVAILABLE-TOOLSETS-TOOLS-END

>

byLabels

(`string`) - Comma-separated list of labels to group metrics by (e.g., 'source_workload,destination_service'). Optional

info_type

(`string`) - Type of information to retrieve: 'all' (default - all available info), 'os' (operating system details), 'filesystem' (disk and filesystem info), 'users' (logged-in users), 'network' (network interfaces and IPs)

tekton_taskrun_restart

Restart a Tekton TaskRun by creating a new TaskRun with the same spec

vm_clone

Clone a KubeVirt VirtualMachine by creating a VirtualMachineClone resource. This creates a copy of the source VM with a new name using the KubeVirt Clone API

tekton_pipelinerun_restart

Restart a Tekton PipelineRun by creating a new PipelineRun with the same spec

tekton_task_start

Start a Tekton Task by creating a TaskRun that references it

fieldSelector

(`string`) - Optional Kubernetes field selector to filter resources by field values (e.g. 'status.phase=Running', 'metadata.name=myresource'). Supported fields vary by resource type. For Pods: metadata.name, metadata.namespace, spec.nodeName, spec.restartPolicy, spec.schedulerName, spec.serviceAccountName, status.phase (Pending/Running/Succeeded/Failed/Unknown), status.podIP, status.nominatedNodeName. See https://kubernetes.io/docs/concepts/overview/working-with-objects/field-selectors/

query

(`string`) **(required)** - query specifies services(s) or files from which to return logs (required). Example: "kubelet" to fetch kubelet logs, "/<log-file-name>" to fetch a specific log file from the node (e.g., "/var/log/kubelet.log" or "/var/log/kube-proxy.log")

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 Information) metrics that show resource pressure for CPU, memory, and I/O. See https://kubernetes.io/docs/reference/instrumentation/understand-psi-metrics/ for details on PSI metrics

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.

resourceType

(`string`) **(required)** - Type of resource to get metrics

format

(`string`) - Output formatting for chat. 'codeblock' wraps logs in ~~~ fences (recommended). 'plain' returns raw text like kubernetes-mcp-server pods_log.

networks

(`array`) - Optional secondary network interfaces to attach to the VM. Each item specifies a Multus NetworkAttachmentDefinition to attach. Accepts either simple strings (NetworkAttachmentDefinition names) or objects with 'name' (interface name in VM) and 'networkName' (NetworkAttachmentDefinition name) properties. Each network creates a bridge interface on the VM.

performance

(`string`) - Optional performance family hint for the VM instance type (e.g., 'u1' for general-purpose, 'o1' for overcommitted, 'c1' for compute-optimized, 'm1' for memory-optimized). Defaults to 'u1' (general-purpose) if not specified.