BK

basebandit/kai

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

20 stars 2 forks 质量 74 趋势 14MIT

Kubernetes 的 MCP 服务器

概览

一个模型上下文协议(MCP)服务器,用于管理兼容MCP客户端如Claude Desktop、Cursor和Continue的Kubernetes集群。 Kai 将 Kubernetes 操作作为 MCP 工具,让 LLM 客户端通过自然语言管理你的集群——工作负载、网络、配置、存储、RBAC、自定义资源和原始清单。 - [x] - 创建、列表、获取、删除和流日志 - [x] - 创建、列表、描述和更新 - [x] - 批量工作负载管理(创建、获取、列表、删除) - [x] - 定时批处理工作负载(创建、获取、列表、删除) - [x] - 创建、获取、列表和删除- [x] - HTTP/HTTPS路由,TLS配置(创建、获取、列表、更新、删除) - [x] - 配置管理(创建、获取、列表、更新、删除)- [x] - 秘密管理(创建、获取、列表、更新、删除)- [x] - 命名空间管理(创建、获取、列表、删除) - [x] - 切换上下文、列表上下文、重命名、删除 - [x] - 节点监控、封锁和排空(列表、获取、封锁,...

概述(AI 翻译)

一个模型上下文协议(MCP)服务器,用于管理兼容MCP客户端如Claude Desktop、Cursor和Continue的Kubernetes集群。

概述

Kai 将 Kubernetes 操作作为 MCP 工具,让 LLM 客户端通过自然语言管理你的集群——工作负载、网络、配置、存储、RBAC、自定义资源和原始清单。

特色

核心工作负载

  • [x] Pods - 创建、列出、获取、删除和流式传输日志
  • [x] 部署 - 创建、列出、描述和更新
  • [x] 作业 - 批量工作负载管理(创建、获取、列表、删除)
  • [x] CronJobs - 调度批处理工作负载(创建、获取、列表、删除)

网络

  • [x] 服务 - 创建、获取、列出和删除
  • [x] Ingress - HTTP/HTTPS 路由,TLS 配置(创建、获取、列表、更新、删除)

配置

  • [x] ConfigMaps - 配置管理(创建、获取、列表、更新、删除)
  • [x] 秘密 - 秘密管理(创建、获取、列表、更新、删除)
  • [x] 命名空间 - 命名空间管理(创建、获取、列表、删除)

集群行动

  • [x] 上下文管理 - 切换上下文、列出上下文、重命名、删除

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

Kai - Kubernetes MCP Server

A Model Context Protocol (MCP) server for managing Kubernetes clusters from MCP-compatible clients like Claude Desktop, Cursor, and Continue.

Overview

Kai exposes Kubernetes operations as MCP tools, letting an LLM client manage your cluster through natural language — workloads, networking, config, storage, RBAC, custom resources, and raw manifests.

Features

Core Workloads

  • [x] Pods - Create, list, get, delete, and stream logs
  • [x] Deployments - Create, list, describe, and update
  • [x] Jobs - Batch workload management (create, get, list, delete)
  • [x] CronJobs - Scheduled batch workloads (create, get, list, delete)

Networking

  • [x] Services - Create, get, list, and delete
  • [x] Ingress - HTTP/HTTPS routing, TLS configuration (create, get, list, update, delete)

Configuration

  • [x] ConfigMaps - Configuration management (create, get, list, update, delete)
  • [x] Secrets - Secret management (create, get, list, update, delete)
  • [x] Namespaces - Namespace management (create, get, list, delete)

Cluster Operations

  • [x] Context Management - Switch contexts, list contexts, rename, delete
  • [x] Nodes - Node monitoring, cordoning, and draining (list, get, cordon, uncordon, drain)
  • [x] Cluster Health - Cluster status and resource metrics (cluster health, node/pod metrics)

Storage

  • [x] Persistent Volumes - PV management (list, get, delete) and PVC management (create, list, get, delete)
  • [x] Storage Classes - Storage class operations (list, get)

Security

  • [x] RBAC - Roles, RoleBindings, ClusterRoles, ClusterRoleBindings, and ServiceAccounts (list, get)

Utilities

  • [x] Port Forwarding - Forward ports to pods and services (start, stop, list sessions)

Advanced

  • [x] Apply/Delete Manifests - Apply or delete raw YAML/JSON, multi-document and any kind including CRDs (apply_yaml, delete_yaml)
  • [x] Custom Resources - CRD and custom resource operations (list/get CRDs, list/get/delete custom resources)
  • [x] Events - Event listing and filtering (by namespace, type, involved object)
  • [x] API Discovery - API resource exploration (list_api_resources)

Requirements

The server connects to your current kubectl context by default. Ensure you have access to a Kubernetes cluster configured for kubectl (e.g., minikube, Rancher Desktop, kind, EKS, GKE, AKS).

Installation

go install github.com/basebandit/kai/cmd/kai@latest

Container image

A multi-arch image (linux/amd64, linux/arm64) is published on Docker Hub:

docker pull cyclon/kai:v1.0.0
docker run --rm cyclon/kai:v1.0.0 -version

CLI Options

kai [options]

Options:
  -kubeconfig string        Path to kubeconfig file (default "~/.kube/config")
  -context string           Name for the loaded context (default "local")
在 GitHub 查看完整 README

安装

docker run --rm cyclon/kai:v1.0.0 -version
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "kubernetes": { "command": "/path/to/kai" } } }