kubectl-mcp-server

by @rohitg00

Kubectl MCP Server

kubectl-mcp-server connects assistants to Kubernetes inspection and management workflows. It covers pod diagnostics, deployments, networking, Helm, security reviews, resource analysis, and optional dashboards.

Cloud & DevOps964pythonMIT

Server facts

kubectl-mcp-server

GitHub stars

964

Last commit

Apr 8, 2026

Runtime

python

License

MIT

Tech

Runtime
pythonPython
Transports
stdio
Remote access
No

Activity

GitHub stars
964
Last commit
Data as of

Tags

  • Cluster Management
  • Devops
  • Helm
  • Kubectl
  • Kubernetes

Overview

kubectl-mcp-server brings Kubernetes operations into MCP conversations. The README describes a broad tool catalog for inspecting pods, logs, events, deployments, services, storage, configuration, and cluster health. Diagnostic workflows investigate crashes, pending workloads, DNS, and connectivity, while management operations can create, scale, restart, patch, or delete resources. Helm support includes release inspection, chart discovery, repositories, installation, upgrades, and rollback. Context tools help select among configured clusters, making the same interface relevant beyond a single namespace or environment.

The recommended launch uses npx, with Node.js 14 or newer listed for that path. A Python installation requires Python 3.9 or newer, and Docker examples provide stdio or SSE deployment options. Every path still needs kubectl installed and configured plus access to a Kubernetes cluster. The README also describes RBAC validation, secret masking, a non-destructive mode, and OAuth 2.1 support, rather than implying that all operations are inherently read-only. Resource and cost tools help identify idle or overprovisioned workloads. Optional dashboard dependencies add interactive views, and the catalog includes integrations for GitOps, certificates, policy engines, and backups. This breadth is useful for an assistant-led operations workflow, but actual usefulness depends on the configured cluster access and the prerequisites of whichever optional features are selected.

Install & configure

Requirements

  • Node.js 14+ for the npx method
  • kubectl installed and configured
  • Access to a Kubernetes cluster
Documented launch / install command
npx -y kubectl-mcp-server

The README recommends this npx launch for MCP clients. Python installation instead requires Python 3.9+. Optional UI features have a separate dependency extra. Docker can use stdio or --transport sse. The tool list here is a selection of explicitly named README operations, not the entire catalog.

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": {
    "kubectl-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "kubectl-mcp-server"
      ],
      "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": {
    "kubectl-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "kubectl-mcp-server"
      ],
      "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": {
    "kubectl-mcp-server": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "kubectl-mcp-server"
      ],
      "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": {
    "kubectl-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "kubectl-mcp-server"
      ],
      "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": {
    "kubectl-mcp-server": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "kubectl-mcp-server"
      ],
      "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 README. Tool descriptions are a documented snapshot, not a live capability check.

ToolWhat it does
get_podsList pods for a Kubernetes namespace.
get_logsRetrieve logs from a pod.
get_pod_eventsInspect events associated with a pod.
diagnose_pod_crashInvestigate pod failures using diagnostic information.
create_deploymentCreate a Kubernetes deployment.
scale_deploymentChange the replica count of a deployment.
kubectl_rolloutManage deployment rollout operations.
diagnose_network_connectivityInvestigate service and workload connectivity problems.
check_dns_resolutionCheck DNS behavior relevant to cluster connectivity.
audit_rbac_permissionsAnalyze Kubernetes role and permission configuration.
check_secrets_securityInspect secrets for security concerns.
helm_listList Helm releases in the cluster.
install_helm_chartInstall an application from a Helm chart.
helm_rollbackReturn a Helm release to an earlier revision.
get_current_contextReport the selected Kubernetes context.
switch_contextSelect another configured Kubernetes context.
list_contextsList configured Kubernetes contexts.
get_resource_recommendationsSuggest resource settings based on workload analysis.
get_idle_resourcesFind resources that appear idle.
get_cost_analysisAnalyze cluster resource costs.
get_overprovisioned_resourcesIdentify workloads with excessive resource allocation.
delete_resourceDelete a selected Kubernetes resource.
show_cluster_overview_uiPresent an optional interactive cluster overview.

Use cases

  • Investigate a crashed pod using logs and events.
  • Create, scale, or roll back deployments.
  • Inspect Helm releases and manage chart installations.
  • Review RBAC and secret-security findings.
  • Identify idle workloads and oversized resource requests.

Strengths

  • Broad coverage of inspection and mutation workflows.
  • Includes Helm and Kubernetes context operations.
  • Documents non-destructive mode and secret masking.
  • Offers npx, Python, and Docker setup paths.

Limitations

  • Needs kubectl configuration and working cluster access.
  • The tool catalog includes destructive resource operations.
  • Interactive dashboards require optional dependencies.

kubectl-mcp-server setup notes

  • kubectl-mcp-server's stdio example needs a client that launches local processes.

Frequently asked questions

Yes. The README requires kubectl to be installed and configured, with cluster access.

Related MCP servers