home / mcp / k8s mcp server

K8s MCP Server

Provides Kubernetes resource management and Helm operations via MCP for easy automation and LLM integration.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "silenceper-mcp-k8s": {
      "url": "http://localhost:8080/sse"
    }
  }
}

You run an MCP server that lets you manage Kubernetes resources and Helm operations through a standardized MCP protocol. It connects to your cluster via kubeconfig, exposes CRUD capabilities for native and custom resources, and provides Helm release and repository management. This makes it easy to drive Kubernetes tasks from MCP clients, including language models and automation tools, with fine-grained control over what actions are allowed.

How to use

Connect to your cluster using either a local, stdio-based setup or a remote SSE HTTP endpoint. In stdio mode, you run the MCP server locally and connect through standard I/O. In SSE mode, you expose an HTTP endpoint that MCP clients can call.

How to install

Prerequisites: you need a Go toolchain to build from source or you can download a prebuilt binary. Ensure you have access to a Kubernetes cluster and a kubeconfig file.

# Option 1: Direct download and run (prebuilt binary)
# Download the appropriate binary for your platform, then run it with your kubeconfig

# Option 2: Build from source
# Install Go if you haven’t already
# Then clone the repository and build the binary

go install github.com/silenceper/mcp-k8s/cmd/mcp-k8s@latest
```} ,{

Additional sections

Configuration and operation modes are described below. You can run in stdio mode for local development, or in SSE mode to expose a HTTP endpoint for remote clients.

{
  "mcpServers": {
    "mcp-k8s": {
      "url": "http://localhost:8080/sse",
      "args": []
    }
  }
}

SSE mode accepts the following flags to enable or disable operations. The server can be started with a kubeconfig path and with granular controls for create, delete, update, list, and Helm actions.

# SSE mode start example
./bin/mcp-k8s -kubeconfig=/path/to/kubeconfig \
  -transport=sse -port=8080 -host=localhost \
  -enable-create -enable-delete -enable-list -enable-update \
  -enable-helm-install -enable-helm-upgrade

Security considerations

Write operations are controlled by independent configuration switches. RBAC is used so the Kubernetes client has only the permissions it needs. Inputs are validated to prevent injection, and Helm actions follow the same security principles with read operations enabled by default and write operations off by default.

Available tools

get_api_resources

Query all supported Kubernetes API resource types present in the cluster, including built-in resources and CRDs.

get_resource

Retrieve detailed information about a specific Kubernetes resource.

list_resources

List all resources of a given type, with optional filtering.

create_resource

Create new Kubernetes resources. This operation can be enabled or disabled individually.

update_resource

Update existing Kubernetes resources. This operation can be enabled or disabled individually.

delete_resource

Delete Kubernetes resources. This operation can be enabled or disabled individually.

list_helm_releases

List all Helm releases installed in the cluster.

get_helm_release

Get detailed information about a specific Helm release.

install_helm_chart

Install a Helm chart into the cluster. This operation can be enabled or disabled.

upgrade_helm_chart

Upgrade an existing Helm release.

uninstall_helm_chart

Uninstall a Helm release from the cluster.

list_helm_repositories

List configured Helm repositories.

add_helm_repository

Add a new Helm repository to the configuration.

remove_helm_repository

Remove an existing Helm repository from the configuration.