MCP Server Kubernetes

by @Flux159

Kubernetes MCP Server

MCP Server Kubernetes lets assistants inspect and manage clusters through kubectl-oriented tools. It covers resources, logs, rollouts, Helm releases, port forwarding, and diagnostics using an existing Kubernetes context.

Cloud & DevOps1,606nodeMIT

Server facts

MCP Server Kubernetes

GitHub stars

1,606

Last commit

Oct 14, 2026

Runtime

node

License

MIT

Tech

Runtime
node
Transports
stdio
Remote access
No

Activity

GitHub stars
1,606
Last commit
Data as of

Tags

  • Cluster Management
  • Helm
  • Kubectl
  • Kubernetes
  • Observability

Overview

MCP Server Kubernetes connects an assistant to a Kubernetes cluster using an existing kubectl configuration. Its interface covers listing and describing resources, reading logs, applying manifests, creating objects, patching fields, scaling deployments, and managing rollouts. Context-management tools let users inspect or switch the selected cluster context. Other capabilities include running commands in pods, forwarding ports, maintaining nodes, and installing or upgrading Helm charts. A diagnostic prompt guides an assistant through identifying relevant pods, gathering evidence, and proposing remediation based on a keyword and optional namespace.

The documented prerequisites are kubectl on the executable path, a valid kubeconfig, and access to a cluster. Helm version three is optional unless chart operations are needed. The server normally loads the standard kubeconfig location and connects through the current context. An optional non-destructive mode removes designated destructive tools, but still permits creation and modification, so it should not be mistaken for read-only access. Secret values are masked in secret-get commands; the README explicitly excludes logs from that protection. Optional OpenTelemetry instrumentation traces tool calls, durations, errors, and Kubernetes context, exporting to compatible OTLP backends. Local client configuration uses npx, with examples for several assistants and editors. A Claude Desktop extension and development workflows are also documented.

Install & configure

Requirements

  • Node.js and npx
  • kubectl on PATH
  • A valid kubeconfig with cluster access
  • Helm v3 on PATH for Helm operations
Documented launch / install command
npx mcp-server-kubernetes

Loads the standard kubeconfig and current kubectl context by default. Set ALLOW_ONLY_NON_DESTRUCTIVE_TOOLS to true to disable designated destructive operations; this still permits creation and updates. Telemetry is optional and off by default.

Config file · macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

Windows: %APPDATA%\Claude\claude_desktop_config.json

Use Settings → Developer → Edit Config when available. Do not assume a Linux configuration path; check the client documentation for your platform. Remote servers use the app’s connector flow when supported, not the local stdio file shown here. Merge this example with existing settings; do not overwrite unrelated servers.

Claude Desktop configuration
{
  "mcpServers": {
    "mcp-server-kubernetes": {
      "command": "npx",
      "args": [
        "mcp-server-kubernetes"
      ],
      "env": {}
    }
  }
}

Read the Claude Desktop setup guide

Config file · Project: .cursor/mcp.json

User: ~/.cursor/mcp.json

The project path is relative to the workspace root. The tilde denotes your user home directory. Use Cursor’s MCP settings to confirm which configuration and scope your installed version is reading. Merge this example with existing settings; do not overwrite unrelated servers.

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

Read the Cursor setup guide

Config file · Workspace: .vscode/mcp.json

For user scope, use the “MCP: Open User Configuration” command if available. Do not guess a user configuration path across operating systems, profiles, containers, or remote workspaces; check the client documentation. Merge this example with existing settings; do not overwrite unrelated servers.

VS Code configuration
{
  "servers": {
    "mcp-server-kubernetes": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "mcp-server-kubernetes"
      ],
      "env": {}
    }
  }
}

Read the VS Code setup guide

Config file · macOS/Linux: ~/.codeium/windsurf/mcp_config.json

Windows: %USERPROFILE%\.codeium\windsurf\mcp_config.json

Open the MCP configuration through Windsurf’s settings when possible to confirm the active file. Paths can differ in managed or future releases; check the client documentation if this location is not present. Merge this example with existing settings; do not overwrite unrelated servers.

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

Read the Windsurf setup guide

Config file · Project scope: .mcp.json at the repository root

The project file uses mcpServers. For user scope, use claude mcp add --scope user rather than assuming .mcp.json in your home directory is the user configuration. Check the client documentation for managed settings and storage details. Merge this example with existing settings; do not overwrite unrelated servers.

Claude Code configuration
{
  "mcpServers": {
    "mcp-server-kubernetes": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "mcp-server-kubernetes"
      ],
      "env": {}
    }
  }
}

Read the Claude Code setup guide

Examples are translated from the published configuration. Supply your own credentials and verify requirements in the upstream README. Remote connectors are shown only where a supported configuration format is known.

Tools

Source: repository tool metadata and repository README. Tool descriptions are a documented snapshot, not a live capability check.

ToolWhat it does
cleanupRemove resources managed by the server.
kubectl_getRetrieve Kubernetes objects by type, name, and optional namespace.
kubectl_describeInspect detailed information about selected Kubernetes objects.
kubectl_applyApply a YAML manifest supplied as text or a file.
kubectl_deleteDelete resources selected by name, labels, type, or manifest.
kubectl_createCreate resources from files or supported creation subcommands.
kubectl_logsRead logs from workloads such as pods, deployments, and jobs.
kubectl_scaleAdjust deployment replica counts.
kubectl_patchChange resource fields through supported patch formats.
kubectl_rolloutControl rollouts for supported workload resources.
kubectl_contextList, inspect, or change the current Kubernetes context.
kubectl_reconnectRebuild API clients to refresh network connections and DNS after cluster changes.
explain_resourceRead documentation for a Kubernetes resource or field.
install_helm_chartInstall a Helm chart using standard or template-based methods.
upgrade_helm_chartUpdate an existing Helm release.
uninstall_helm_chartRemove a Helm release.
node_managementCordon, drain, or uncordon cluster nodes.
port_forwardExpose a resource port through a local forwarded port.
stop_port_forwardTerminate an active port-forwarding process.
exec_in_podRun an executable and argument array in a container without shell interpretation.
list_api_resourcesEnumerate resource APIs supported by the cluster.
kubectl_genericRun a kubectl command using supplied arguments and flags.
pingCheck whether the connection remains responsive.
cleanup_podsClean up pods in documented problematic or completed states.
helm_template_applyUse template-based Helm installation to work around authentication issues.
helm_template_uninstallUse template-based Helm removal to work around authentication issues.

Use cases

  • Inspect pods and logs while diagnosing workload failures.
  • Apply manifests and manage deployment rollouts from an assistant.
  • Install or upgrade Helm releases with custom values.
  • Trace assistant-driven cluster operations through an OTLP backend.

Strengths

  • Covers routine kubectl work and advanced cluster operations.
  • Uses existing kubeconfig contexts.
  • Provides a diagnostic prompt and opt-in distributed tracing.
  • Offers a mode that disables designated destructive tools.

Limitations

  • Requires working cluster credentials and local kubectl.
  • Non-destructive mode still allows resource changes.
  • Secret masking does not cover log output.

MCP Server Kubernetes setup notes

  • MCP Server Kubernetes's stdio example needs a client that launches local processes.

Frequently asked questions

Yes. kubectl must be installed and configured with a valid kubeconfig and working cluster credentials.

Related MCP servers