Get the FREE Ultimate OpenClaw Setup Guide →

mcp-k8s

A Kubernetes MCP (Model Control Protocol) server that enables interaction with Kubernetes clusters through MCP tools.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio silenceper-mcp-k8s /path/to/mcp-k8s --kubeconfig /path/to/kubeconfig --enable-create --enable-delete --enable-update --enable-list --enable-helm-install --enable-helm-upgrade \
  --env KUBECONFIG="Path to kubeconfig file (same as --kubeconfig)"

How to use

mcp-k8s is a Go-based MCP (Model Control Protocol) server for Kubernetes. It exposes a suite of MCP tools that let you query Kubernetes resource types, perform CRUD operations on resources, and manage Helm releases and repositories via a standardized MCP interface. The server communicates over three modes: stdio (default), SSE over HTTP, and a streamable HTTP mode, enabling flexible integration with LLMs, orchestration frameworks, or IDE assistants. Available tools include get_api_resources for resource type discovery; get_resource, list_resources, create_resource, update_resource, and delete_resource for resource management; and a comprehensive set of Helm tools for release and repository management (list_helm_releases, get_helm_release, install_helm_chart, upgrade_helm_chart, uninstall_helm_chart, list_helm_repositories, add_helm_repository, remove_helm_repository). You can run the server locally with a kubeconfig and enable or disable specific operations as needed.

How to install

Prerequisites:

  • Go environment (Go 1.x+)
  • Access to a Kubernetes cluster (via kubeconfig)

Option A: Build from source

  1. Clone the repository git clone https://github.com/silenceper/mcp-k8s.git cd mcp-k8s

  2. Build the server go build ./...

  3. Run the server (example for stdio mode) ./mcp-k8s --kubeconfig /path/to/kubeconfig --enable-create --enable-delete --enable-update --enable-list --enable-helm-install --enable-helm-upgrade

  4. Verify it starts and listens as configured (the defaults in README demonstrate the stdio JSON config). You can also adapt the command to your environment and desired mode (SSE or streamable-http).

Option B: Run with Docker (example)

  1. Ensure Docker is installed and running

  2. Run the image with SSE mode (example) docker run --rm -p 8080:8080 -v ~/.kube/config:/root/.kube/config ghcr.io/silenceper/mcp-k8s:latest --transport=sse

  3. Use the corresponding mcp config in your client to connect (e.g., set the URL to http://localhost:8080/sse).

Notes:

  • Replace /path/to/kubeconfig with your actual kubeconfig path or mount a kubeconfig into the container.
  • Adjust enable- flags to match the capabilities you want to expose in your environment.

Additional notes

Tips and considerations:

  • Ensure your Kubernetes cluster permissions align with the operations you enable (read vs write access).
  • When using SSE or streamable-http modes, be mindful of security implications, especially in public or multi-tenant environments.
  • The server supports enabling/disabling individual operations; disable write operations in sensitive contexts.
  • Helm operations require the Helm v3 client libraries and appropriate cluster RBAC permissions.
  • For local development, mount your kubeconfig into the running process and verify connectivity with kubectl before wiring to MCP.
  • If you encounter issues with resource types or CRDs, ensure the cluster has the necessary CRDs installed and that the client-go version is compatible with your cluster.

Related MCP Servers

Sponsor this space

Reach thousands of developers