Kubectl MCP Server

v1.0.0Cloud Servicesstable

Published in CNCF Landscape: A MCP server for Kubernetes.

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

What is Kubectl MCP Server?

Kubectl MCP Server is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to published in cncf landscape: a mcp server for kubernetes.

Published in CNCF Landscape: A MCP server for Kubernetes.

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

Features

  • Published in CNCF Landscape: A MCP server for Kubernetes.

Use Cases

CNCF-registered Kubernetes MCP server
Cluster operations and automation
rohitg00

Maintainer

LicenseMIT
Languagepython
Versionv1.0.0
UpdatedMay 20, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx kubectl

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 Server

Kubectl MCP Server is a Python-based MCP server published in the CNCF Landscape that enables AI assistants to manage Kubernetes clusters through natural language using 253 dedicated tools covering the full spectrum of cluster operations: pod and workload management, networking, storage, RBAC, Helm, GitOps workflows, service mesh integrations, and cost optimization analysis. It connects directly to your existing kubeconfig, supports multi-cluster switching via context parameters, offers read-only and non-destructive operation modes, and exposes eight workflow prompts for common tasks like security audits, deployment automation, and troubleshooting.

Prerequisites

  • Python 3.9+ and pip (for pip installation) or Node.js 14+ for the npm package
  • kubectl installed and a valid kubeconfig at ~/.kube/config or a custom path
  • Access to a running Kubernetes cluster (local or remote)
  • An MCP-compatible client such as Claude Desktop, Cursor, Windsurf, or VS Code
1

Install the MCP server

Install via pip for Python usage. The npm package kubectl-mcp-tool and a Docker image are also available for the same underlying server.

# Python pip:
pip install kubectl-mcp-server

# With interactive dashboards:
pip install kubectl-mcp-server[ui]

# Docker:
docker run -i -v $HOME/.kube:/root/.kube:ro \
  rohitghumare64/kubectl-mcp-server:latest
2

Verify your Kubernetes connection

Confirm kubectl works correctly before wiring up the MCP server, as the server inherits your kubeconfig credentials and RBAC permissions.

kubectl cluster-info
kubectl get nodes
kubectl config current-context
3

Configure Claude Desktop

Add the server to your Claude Desktop configuration file at ~/Library/Application Support/Claude/claude_desktop_config.json (macOS).

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

Set optional environment variables

Fine-tune the server behavior with environment variables for debugging, logging, OAuth authentication, and browser-based dashboards.

# KUBECONFIG=/path/to/kubeconfig   (default: ~/.kube/config)
# MCP_DEBUG=true                    (verbose logging to stderr)
# MCP_LOG_FILE=/tmp/kubectl-mcp.log (persist logs to file)
# MCP_AUTH_ENABLED=true             (enable OAuth 2.1)
# MCP_BROWSER_ENABLED=true          (enable HTML dashboards)
5

Start with alternative transports

The server defaults to stdio transport. For remote or multi-user setups, use SSE or HTTP transport modes.

# Default stdio:
kubectl-mcp-server

# SSE transport:
kubectl-mcp-server --transport sse --port 8000

# HTTP transport:
kubectl-mcp-server --transport http --port 8000

Kubectl MCP Server Examples

Client configuration

Configuration for Claude Desktop. Adjust the kubeconfig path to match your system.

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

Prompts to try

Leverage natural-language Kubernetes management across all 253 tools with these example prompts.

- "Show me all pods in the kube-system namespace and their resource usage"
- "Create a deployment named nginx-test with 3 replicas using the nginx:latest image"
- "Which nodes have the highest CPU utilization right now?"
- "Run a security audit of all service accounts in the default namespace"
- "Switch to the staging cluster context and list all Helm releases"

Troubleshooting Kubectl MCP Server

Server exits immediately with a kubeconfig error on startup

Set the KUBECONFIG environment variable explicitly in the MCP client config to the absolute path of your kubeconfig file. If you have multiple kubeconfig files, merge them first with 'KUBECONFIG=~/.kube/config1:~/.kube/config2 kubectl config view --merge --flatten > ~/.kube/config'.

AI assistant returns 'forbidden' errors for some Kubernetes operations

The server runs with your kubectl user's RBAC permissions. For cluster-admin operations, ensure your kubeconfig uses a service account or user with the cluster-admin ClusterRole. Check with 'kubectl auth can-i create deployments --namespace default'.

pip install fails or imports are missing at runtime

Create a fresh virtual environment and install there: 'python -m venv venv && source venv/bin/activate && pip install kubectl-mcp-server'. Then reference the full path to the Python binary in your MCP client config command.

Frequently Asked Questions about Kubectl MCP Server

What is Kubectl MCP Server?

Kubectl MCP Server is a Model Context Protocol (MCP) server that published in cncf landscape: a mcp server for kubernetes. It connects AI assistants to external tools and data sources through a standardized interface.

How do I install Kubectl MCP Server?

Follow the installation instructions on the Kubectl MCP Server GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with Kubectl MCP Server?

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

Is Kubectl MCP Server free to use?

Yes, Kubectl MCP Server is open source and available under the MIT 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": { "command": "npx", "args": ["-y", "kubectl"] } } }

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

Read the full setup guide →

Ready to use Kubectl MCP Server?

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