Kubernetes CLI Bridge

v1.0.0Cloud Servicesstable

K8s-mcp-server is a Model Context Protocol (MCP) server that enables AI assistants like Claude to securely execute Kubernetes commands. It provides a bridge between language models and essential Kubernetes CLI tools including kubectl, helm, istioctl,

ai-assistantargocdclaudedevopsdocker
Share:
209
Stars
0
Downloads
0
Weekly
0/5

What is Kubernetes CLI Bridge?

Kubernetes CLI Bridge is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to k8s-mcp-server is a model context protocol (mcp) server that enables ai assistants like claude to securely execute kubernetes commands. it provides a bridge between language models and essential kuber...

K8s-mcp-server is a Model Context Protocol (MCP) server that enables AI assistants like Claude to securely execute Kubernetes commands. It provides a bridge between language models and essential Kubernetes CLI tools including kubectl, helm, istioctl,

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

Features

  • K8s-mcp-server is a Model Context Protocol (MCP) server that

Use Cases

Execute kubectl commands from Claude
Manage Kubernetes deployments and infrastructure
Helm and cluster operations
reza-gholizade

Maintainer

LicenseMIT License
Languagepython
Versionv1.0.0
UpdatedMay 16, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx k8s

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 Kubernetes CLI Bridge

k8s-mcp-server is a Model Context Protocol server that gives AI assistants like Claude secure, structured access to Kubernetes cluster operations through a bridge to kubectl, helm, istioctl, and argocd CLI tools. It exposes a rich set of tools covering cluster discovery, pod operations, resource management, monitoring, Helm chart lifecycle, and YAML/JSON manifest operations — all executable through natural language without requiring the user to remember complex kubectl syntax. Teams use it to inspect cluster health, troubleshoot failing pods, manage Helm releases, and perform rolling restarts directly from their AI client, with support for read-only mode to prevent accidental modifications in production environments.

Prerequisites

  • Go 1.23+ (if building from source) OR Docker (for container deployment)
  • A configured kubeconfig file at ~/.kube/config with access to your target cluster
  • kubectl installed and in PATH (for stdio mode), OR access to a Kubernetes API server
  • An MCP-compatible client such as Claude Desktop or VS Code with MCP support
  • Helm installed in PATH if you want to use Helm management tools
1

Build the server from source

Clone the repository and build the Go binary. Requires Go 1.23 or higher.

git clone https://github.com/reza-gholizade/k8s-mcp-server.git
cd k8s-mcp-server
go mod download
go build -o k8s-mcp-server main.go
2

Alternative: Run with Docker

Use the pre-built Docker image, mounting your local kubeconfig into the container.

docker pull ginnux/k8s-mcp-server:latest
docker run -p 8080:8080 \
  -v ~/.kube/config:/home/appuser/.kube/config:ro \
  ginnux/k8s-mcp-server:latest
3

Test the binary in stdio mode

Verify the binary works by running it in stdio mode. This is the mode used by Claude Desktop for direct process communication.

./k8s-mcp-server --mode stdio --read-only
4

Configure Claude Desktop

Add the k8s-mcp-server to your claude_desktop_config.json. Use --read-only for production clusters to prevent accidental mutations.

{
  "mcpServers": {
    "k8s": {
      "command": "/path/to/k8s-mcp-server",
      "args": ["--mode", "stdio", "--read-only"],
      "env": {
        "KUBECONFIG": "/Users/yourname/.kube/config"
      }
    }
  }
}
5

Configure for remote cluster access

For clusters where you don't have a local kubeconfig, set environment variables to authenticate directly against the Kubernetes API.

{
  "mcpServers": {
    "k8s": {
      "command": "/path/to/k8s-mcp-server",
      "args": ["--mode", "stdio"],
      "env": {
        "KUBERNETES_SERVER": "https://your-cluster-api:6443",
        "KUBERNETES_TOKEN": "your-bearer-token",
        "KUBERNETES_INSECURE": "false"
      }
    }
  }
}

Kubernetes CLI Bridge Examples

Client configuration

Standard claude_desktop_config.json setup using the local kubeconfig file with read-only mode enabled for safety.

{
  "mcpServers": {
    "k8s": {
      "command": "/usr/local/bin/k8s-mcp-server",
      "args": ["--mode", "stdio", "--read-only"],
      "env": {
        "KUBECONFIG": "/Users/yourname/.kube/config"
      }
    }
  }
}

Prompts to try

These prompts cover cluster inspection, pod troubleshooting, Helm management, and resource operations through the k8s-mcp-server tools.

- "Show me all pods in the production namespace and their current status"
- "Get the logs from the payment-service pod in the last 100 lines"
- "Describe the failing pod api-gateway-7d9f8b in the staging namespace"
- "List all Helm releases installed in the cluster"
- "Get CPU and memory usage for all nodes in the cluster"
- "Trigger a rolling restart of the deployment named web-frontend in production"

Troubleshooting Kubernetes CLI Bridge

Server starts but cannot connect to the cluster

Verify your kubeconfig is valid by running kubectl get nodes in a terminal. Check that the KUBECONFIG environment variable in your MCP config points to the correct file. For remote clusters, verify KUBERNETES_SERVER and KUBERNETES_TOKEN are correct and the token has the necessary RBAC permissions.

Helm tools return 'command not found'

Ensure helm is installed and available in PATH on the machine running k8s-mcp-server. If you do not use Helm, add the --no-helm flag to the args array in your MCP config to disable Helm tools and eliminate the error.

Read-only mode still allows mutations

The --read-only flag disables write tools like createOrUpdateResource, deleteResource, and rolloutRestart at the server level. If mutations are still occurring, verify --read-only is in the args array of your MCP client config and that you restarted the client after making changes.

Frequently Asked Questions about Kubernetes CLI Bridge

What is Kubernetes CLI Bridge?

Kubernetes CLI Bridge is a Model Context Protocol (MCP) server that k8s-mcp-server is a model context protocol (mcp) server that enables ai assistants like claude to securely execute kubernetes commands. it provides a bridge between language models and essential kubernetes cli tools including kubectl, helm, istioctl, It connects AI assistants to external tools and data sources through a standardized interface.

How do I install Kubernetes CLI Bridge?

Follow the installation instructions on the Kubernetes CLI Bridge GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with Kubernetes CLI Bridge?

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

Is Kubernetes CLI Bridge free to use?

Yes, Kubernetes CLI Bridge 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": { "k8s": { "command": "npx", "args": ["-y", "k8s"] } } }

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

Read the full setup guide →

Ready to use Kubernetes CLI Bridge?

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