Provides MCP multi-cluster Kubernetes management and operations, featuring a management interface, logging, and nearly 50 built-in tools covering common DevOps and development scenarios. Supports both standard and CRD resources.
Add to Claude Desktop config.json
{
"mcpServers": {
"weibaohui-k8m": {
"command": "node",
"args": [
"~/.mcp/k8m/index.js"
]
}
}
} Get the source and run locally
git clone https://github.com/weibaohui/k8m.git ~/.mcp/k8m
cd ~/.mcp/k8m
k8m 是一款AI驱动的 Mini Kubernetes AI Dashboard 轻量级控制台工具,专为简化集群管理设计。它基于 AMIS 构建,并通过
kom 作为 Kubernetes API 客户端,k8m 内置了
Qwen2.5-Coder-7B,支持deepseek-ai/DeepSeek-R1-Distill-Qwen-7B模型
模型交互能力,同时支持接入您自己的私有化大模型(包括ollama)。
本项目提供cnb 在线访问地址 k8m
letsfly/justforfun/k8m && docker-compose up -d && docker-compose ps 
k8m 的设计理念是”AI驱动,轻便高效,化繁为简”,它帮助开发者和运维人员快速上手,轻松管理 Kubernetes 集群。
./k8m 命令启动,访问http://127.0.0.1:3618。k8mk8mUsage of ./k8m:
--enable-temp-admin 是否启用临时管理员账户配置,默认关闭
--admin-password string 管理员密码,启用临时管理员账户配置后生效
--admin-username string 管理员用户名,启用临时管理员账户配置后生效
--print-config 是否打印配置信息 (default false)
--connect-cluster 启动集群是是否自动连接现有集群,默认关闭
-d, --debug 调试模式
--in-cluster 是否自动注册纳管宿主集群,默认启用
--jwt-token-secret string 登录后生成JWT token 使用的Secret (default "your-secret-key")
-c, --kubeconfig string kubeconfig文件路径 (default "/root/.kube/config")
--kubectl-shell-image string Kubectl Shell 镜像。默认为 bitnami/kubectl:latest,必须包含kubectl命令 (default "bitnami/kubectl:latest")
--log-v int klog的日志级别klog.V(2) (default 2)
--login-type string 登录方式,password, oauth, token等,default is password (default "password")
--image-pull-timeout Node Shell、Kubectl Shell 镜像拉取超时时间。默认为 30 秒
--node-shell-image string NodeShell 镜像。 默认为 alpine:latest,必须包含`nsenter`命令 (default "alpine:latest")
-p, --port int 监听端口 (default 3618)
-v, --v Level klog的日志级别 (default 2)
也可以直接通过docker-compose(推荐)启动:
services:
k8m:
container_name: k8m
image: registry.cn-hangzhou.aliyuncs.com/minik8m/k8m
restart: always
ports:
- "3618:3618"
environment:
TZ: Asia/Shanghai
volumes:
- ./data:/app/data
启动之后,访问3618端口,默认用户:k8m,默认密码k8m。
如果你想通过在线环境快速拉起体验,可以访问:k8m
brew install kind
kind create cluster --name k8sgpt-demo
kubectl apply -f https://raw.githubusercontent.com/weibaohui/k8m/refs/heads/main/deploy/k8m.yaml
不要加 k8m.io/role: leader 标签,加了不能正常访问。必须加 k8m.io/role: leader 标签,否则不会切换。kubectl apply -f https://raw.githubusercontent.com/weibaohui/k8m/refs/heads/main/deploy/k8m-ms.yaml
从v0.0.8版本开始,将内置GPT,无需配置。 如果您需要使用自己的GPT,请参考以下文档。
如果设置参数后,依然没有效果,请尝试使用./k8m -v 6获取更多的调试信息。
会输出以下信息,通过查看日志,确认是否启用ChatGPT。
如果你想在本地开发调试,请先执行一次本地前端构建,自动生成dist目录。因为本项目采用了二进制嵌入,没有dist前端会报错。
cd ui
pnpm run build
#下载依赖
go mod tidy
#运行
air
#或者
go run *.go
# 监听localhost:3618端口
cd ui
pnpm run dev
#Vite服务会监听在localhost:3000端口
#Vite转发后端访问到3618端口
如果你有任何进一步的问题或需要额外的帮助,请随时与我联系!
zhaomingcheng01:提出了诸多非常高质量的建议,为k8m的易用好用做出了卓越贡献~
La0jin:提供在线资源及维护,极大提升了k8m的展示效果
eryajf:为我们提供了非常好用的github actions,为k8m增加了自动化的发版、构建、发布等功能
A hosted deployment is available on Fronteir AI.

AWS MCP servers for seamless integration with AWS services and resources.
Kubernetes bulk port forwarding with service discovery, /etc/hosts management, traffic monitoring, and pod log streaming.
Integration with Cloudflare services including Workers, KV, R2, and D1
powerful Kubernetes MCP server with additional support for OpenShift. Besides providing CRUD operations for **any** Kubernetes resource, this server provides specialized tools to interact with your cluster.
Typescript implementation of Kubernetes cluster operations for pods, deployments, services.
The official Terraform MCP Server seamlessly integrates with the Terraform ecosystem, enabling provider discovery, module analysis, and direct Registry API integration for advanced Infrastructure as Code workflows.