Kubectl MCP

v1.24.0Cloud Servicesstable

A Model Context Protocol server that enables AI assistants to interact with Kubernetes clusters through natural language, supporting core Kubernetes operations, monitoring, security, and diagnostics.

aideploymentdevopsgenaikubernetes
Share:
890
Stars
0
Downloads
0
Weekly
0/5

What is Kubectl MCP?

Kubectl MCP is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to model context protocol server that enables ai assistants to interact with kubernetes clusters through natural language, supporting core kubernetes operations, monitoring, security, and diagnostics.

A Model Context Protocol server that enables AI assistants to interact with Kubernetes clusters through natural language, supporting core Kubernetes operations, monitoring, security, and diagnostics.

This server falls under the Cloud Services category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • A Model Context Protocol server that enables AI assistants t

Use Cases

Kubernetes cluster management through natural language
Operations, monitoring, and diagnostics
rohitg00

Maintainer

LicenseMIT License
Languagepython
Versionv1.24.0
UpdatedMay 20, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

NPM

npx -y kubectl-mcp-tool

Manual Installation

npx -y kubectl-mcp-tool

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use Kubectl MCP

Kubectl MCP Tool is a feature-rich MCP server that gives AI assistants natural-language control over Kubernetes clusters through 253 purpose-built tools covering pod management, deployments, StatefulSets, services, networking, storage, RBAC, Helm v3, GitOps (Flux/ArgoCD), service meshes (Istio/Cilium), cost optimization, and diagnostics. It is published in the CNCF Landscape and connects directly to your existing kubeconfig, supporting multi-cluster contexts, non-destructive read-only mode, OAuth 2.1 authentication, and six interactive HTML dashboards for visual cluster monitoring.

Prerequisites

  • kubectl installed and configured with a valid kubeconfig (~/.kube/config)
  • Access to a Kubernetes cluster (local like minikube/kind or remote)
  • Node.js 14+ and npx, or Python 3.9+ with pip
  • An MCP-compatible client such as Claude Desktop, Cursor, or VS Code
1

Install the server

The npm package is the easiest zero-install option. A Python pip package and Docker image are also available.

# npm (zero-install):
npx -y kubectl-mcp-tool

# npm global install:
npm install -g kubectl-mcp-tool

# Python pip:
pip install kubectl-mcp-server

# Docker:
docker pull rohitghumare64/kubectl-mcp-server:latest
2

Verify kubectl access

Confirm that kubectl can reach your cluster before connecting the MCP server. The server uses your existing kubeconfig.

kubectl cluster-info
kubectl get nodes
3

Configure your MCP client

Add the server to your Claude Desktop or other MCP client configuration. The KUBECONFIG environment variable is optional if your config is at the default location.

{
  "mcpServers": {
    "kubernetes": {
      "command": "npx",
      "args": ["-y", "kubectl-mcp-tool"],
      "env": {
        "KUBECONFIG": "/Users/you/.kube/config",
        "MCP_DEBUG": "false"
      }
    }
  }
}
4

Enable optional features

Set environment variables to enable OAuth authentication or browser automation dashboards if needed.

# Environment variables:
# KUBECONFIG=/path/to/kubeconfig   (default: ~/.kube/config)
# MCP_DEBUG=true                    (verbose logging)
# MCP_LOG_FILE=/tmp/mcp.log        (log to file)
# MCP_AUTH_ENABLED=true            (OAuth 2.1)
# MCP_BROWSER_ENABLED=true         (HTML dashboards)
5

Explore available tools

Use the CLI to list all 253 available tools or search for specific ones before using them through an AI client.

# List all tools:
kubectl-mcp-tool tools -d

# Search for pod-related tools:
kubectl-mcp-tool grep "*pod*"

# Call a tool directly:
kubectl-mcp-tool call get_pods '{"namespace": "default"}'

Kubectl MCP Examples

Client configuration

Add to claude_desktop_config.json on macOS at ~/Library/Application Support/Claude/claude_desktop_config.json.

{
  "mcpServers": {
    "kubernetes": {
      "command": "npx",
      "args": ["-y", "kubectl-mcp-tool"],
      "env": {
        "KUBECONFIG": "/Users/you/.kube/config"
      }
    }
  }
}

Prompts to try

Natural language Kubernetes operations enabled by the 253 MCP tools across all cluster management domains.

- "List all pods in the production namespace and show their status"
- "Scale the frontend deployment to 5 replicas"
- "Show me all failing pods and their recent events"
- "Run a security audit on the default namespace"
- "List all Helm releases and their current versions"
- "Analyze cost optimization opportunities in the cluster"

Troubleshooting Kubectl MCP

MCP server cannot connect to the Kubernetes cluster

Run 'kubectl cluster-info' to verify connectivity. If it fails, check that your VPN is connected (for remote clusters), that the kubeconfig context is correct ('kubectl config current-context'), and that KUBECONFIG points to the right file.

Permission denied errors when running cluster operations

The server uses the same RBAC permissions as your kubeconfig credentials. Check your ClusterRole bindings with 'kubectl auth can-i <verb> <resource>'. For read-only usage, ensure your user has at least 'view' cluster role.

npx kubectl-mcp-tool is slow to start on first run

The first run downloads the package from npm. Use 'npm install -g kubectl-mcp-tool' to install globally and avoid the download on every invocation, or pre-pull with 'npx -y kubectl-mcp-tool --version'.

Frequently Asked Questions about Kubectl MCP

What is Kubectl MCP?

Kubectl MCP is a Model Context Protocol (MCP) server that model context protocol server that enables ai assistants to interact with kubernetes clusters through natural language, supporting core kubernetes operations, monitoring, security, and diagnostics. It connects AI assistants to external tools and data sources through a standardized interface.

How do I install Kubectl MCP?

Install via npm with the command: npx -y kubectl-mcp-tool. Then add the server configuration to your AI client's JSON config file (e.g., claude_desktop_config.json or .cursor/mcp.json).

Which AI clients work with Kubectl MCP?

Kubectl MCP works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is Kubectl MCP free to use?

Yes, Kubectl MCP is open source and available under the MIT License license. You can use it freely in both personal and commercial projects.

Browse More Cloud Services MCP Servers

Explore all cloud services servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "kubectl-mcp-tool": { "command": "npx", "args": ["-y", "kubectl-mcp-tool"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use Kubectl MCP?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides