MCP Directory

K8M

AI-driven mini Kubernetes dashboard with a built-in MCP server exposing 49 cluster operation tools

Unverified
SSE (remote)
API key
Go

Add to your client

Copy the config for your MCP client and paste it into its config file.

Paste into ~/Library/Application Support/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "k8m": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "http://localhost:3618/mcp/k8m/sse",
        "--header",
        "Authorization: <token-from-k8m-个人中心-开放MCP>"
      ]
    }
  }
}

Claude Desktop connects to remote servers through the `mcp-remote` proxy (installed on first run via npx). Restart Claude Desktop after saving.

Step-by-step guides: Add to Claude Desktop · Add to Cursor · Add to Windsurf

Before you start

  • A running, self-hosted K8M instance (single binary or docker-compose; default port 3618)
  • One or more Kubernetes clusters registered/managed in K8M
  • The built-in 'k8m' MCP server enabled under 平台设置-MCP管理
  • An MCP access link and Authorization Token created under 个人中心-开放MCP (the Token is bound to the creating user's cluster permissions)

About K8M

K8M is a single-binary, cross-platform Kubernetes AI dashboard (Go backend, Baidu AMIS frontend) with an embedded MCP server. The MCP server speaks SSE only and exposes 49 tools to operate Kubernetes across every cluster K8M manages. Enable the built-in k8m MCP server in the admin settings, generate a per-user access link/Token, and point an MCP client (Cursor, Trae, CherryStudio, Cline, Claude Desktop, Windsurf, GitHub Copilot, etc.) at the SSE URL. MCP calls execute with the link creator's cluster permissions and are fully audit-logged.

Tools & capabilities (49)

list_clusters

List all registered Kubernetes clusters

scale_deployment

Scale a Deployment up or down

restart_deployment

Restart a Deployment

stop_deployment

Stop a Deployment

restore_deployment

Restore a stopped Deployment

update_tag_deployment

Update a Deployment's image tag

rollout_history_deployment

Query a Deployment's rollout history

rollout_undo_deployment

Roll back a Deployment

rollout_pause_deployment

Pause a Deployment rollout

rollout_resume_deployment

Resume a paused Deployment rollout

rollout_status_deployment

Query a Deployment's rollout status

hpa_list_deployment

List the HPAs for a Deployment

list_deployment_pods

Get the Pods managed by a Deployment

get_k8s_resource

Get a Kubernetes resource (incl. CRDs)

describe_k8s_resource

Describe a Kubernetes resource

delete_k8s_resource

Delete a Kubernetes resource

list_k8s_resource

List Kubernetes resources

list_k8s_event

List Kubernetes events

patch_k8s_resource

Update a Kubernetes resource via JSON Patch

label_k8s_resource

Add or remove labels on a Kubernetes resource

annotate_k8s_resource

Add or remove annotations on a Kubernetes resource

taint_node

Add a taint to a node

untaint_node

Remove a taint from a node

cordon_node

Cordon a node

uncordon_node

Uncordon a node

drain_node

Drain a node

get_node_resource_usage

Query a node's resource usage

get_node_ip_usage

Query Pod IP usage on a node

get_node_pod_count

Query the number of Pods on a node

list_pod_files

List files in a Pod

list_all_pod_files

List all files in a Pod

delete_pod_file

Delete a file in a Pod

upload_file_to_pod

Upload a file (text content) into a Pod, stored as a Pod file

get_pod_logs

Get Pod logs

run_command_in_pod

Execute a command inside a Pod

get_pod_linked_service

Get the Service linked to a Pod

get_pod_linked_ingress

Get the Ingress linked to a Pod

get_pod_linked_endpoints

Get the Endpoints linked to a Pod

get_pod_linked_pvc

Get the PVC linked to a Pod

get_pod_linked_pv

Get the PV linked to a Pod

get_pod_linked_env

Get Pod runtime environment variables by running env inside the Pod

get_pod_linked_env_from_yaml

Get Pod runtime environment variables from the Pod YAML definition

get_pod_resource_usage

Get a Pod's resource usage (CPU/memory request, limit, allocatable, usage ratio)

apply_yaml

Apply a YAML resource

delete_yaml

Delete a YAML resource

set_default_storageclass

Set the default StorageClass

get_storageclass_pvc_count

Get the PVC count for a StorageClass

get_storageclass_pv_count

Get the PV count for a StorageClass

set_default_ingressclass

Set the default IngressClass

What this server can do

K8M provides tools for these capabilities — tap one to see every MCP server that does the same:

When to use it

  • Let an LLM client (Cursor, Trae, CherryStudio, Cline, GitHub Copilot) inspect and operate Kubernetes clusters in natural language
  • Scale, restart, roll out, and roll back Deployments through a chat agent
  • Diagnose Pods by pulling logs, running commands, and inspecting linked Services/Ingress/PVCs and resource usage
  • Perform node maintenance (cordon, drain, taint) via an AI agent with audited, permission-scoped access
  • Apply or delete YAML and manage CRDs across multiple registered clusters from one MCP endpoint

Security notes

The MCP server is only reachable after you self-host K8M and create an access link under 个人中心-开放MCP; the URL http://localhost:3618/mcp/k8m/sse is a per-user template — replace localhost with your server IP and use your own generated link. External clients must authenticate by passing the Token (created under 个人中心-开放MCP) in the Authorization header. MCP permissions are bound to the creating user's cluster authorization (read-only / exec / cluster-admin), so scope that user carefully — cluster-admin links can apply YAML, delete resources, drain nodes, and exec into Pods. Change the default k8m/k8m credentials and enable 2FA before exposing the dashboard.

K8M FAQ

What transport does the MCP server use?

SSE only. The docs state the built-in MCP server supports the SSE protocol exclusively; the endpoint is http://<server-ip>:3618/mcp/k8m/sse.

How does authentication work?

Create an access link/Token under 个人中心-开放MCP in the K8M UI, then pass it in the Authorization header from your MCP client. The link inherits the creating user's cluster permissions (read-only, exec, or cluster-admin).

Do I need to install a package?

No npm/pip package. You self-host the K8M binary (or docker-compose), enable the built-in k8m MCP server in admin settings, and connect your client to the SSE URL.

How many tools does it expose?

49 built-in tools covering cluster, deployment, dynamic resource/CRD, node, Pod, YAML, storage, and ingress operations across all clusters K8M manages.

Alternatives to K8M

Compare all alternatives →

GitHub's official server for repos, issues, PRs, and Actions — local Docker or hosted remote.

Featured
Verified
stdio (local)
API key
Go
7 tools
Updated 7 days agoRepo

Official AWS Labs server that lets agents call any AWS API via the AWS CLI surface.

Verified
stdio (local)
API key
Python
3 tools
Updated 9 days agoRepo

Bulk Kubernetes port forwarding with an MCP server that lets AI assistants forward services, inspect pods, and monitor traffic.

Unverified
stdio (local)
No auth
Go
28 tools
Updated 1 day agoRepo