Back to MCP directory
publicPublicdnsLocal runtime

k8s-pilot

k8s_pilot是一个轻量级的Kubernetes多集群集中管理控制平面,支持多集群上下文切换、资源CRUD操作和命名空间管理,通过MCP协议与Claude AI集成。

article

README

🚀 k8s-pilot-ci

k8s_pilot 是一个轻量级、集中式控制平面服务器,可作为您 Kubernetes 集群的中央控制台,助力您管理多个 Kubernetes 集群。借助强大的工具和直观的 API,您能从一个控制台同时观察和管理所有集群。

smithery badge


🚀 快速开始

概览

  • 🔄 支持多集群上下文切换。
  • 🔧 提供对大多数常见 Kubernetes 资源的增删改查(CRUD)操作。
  • ⚙️ 由 MCP(Claude AI 及其更多模型的支持协议)驱动。

先决条件

  • Python 3.13 或更高版本。
  • uv 包管理器。
  • Kubernetes 集群访问权限(~/.kube/config 或集群内配置)。
# 安装 uv(如果尚未安装)

# 对于 MacOS
brew install uv

# 对于 Linux
curl -LsSf https://astral.sh/uv/install.sh | sh

安装

# 克隆仓库
git clone https://github.com/bourbonkk/k8s-pilot.git
cd k8s-pilot

# 使用 uv 和 MCP 启动
uv run --with mcp[cli] mcp run k8s_pilot.py

与 Claude Desktop 配合使用

使用以下配置在 Claude 中运行 k8s_pilot MCP 服务器:

{
  "mcpServers": {
    "k8s_pilot": {
      "command": "uv",
      "args": [
        "--directory",
        "<克隆仓库的实际路径>/k8s-pilot",
        "run",
        "--with",
        "mcp[cli]",
        "mcp",
        "run",
        "k8s_pilot.py"
      ]
    }
  }
}

请将 <克隆仓库的实际路径> 替换为实际的目录路径。

场景示例

在 pypy 命名空间中创建一个使用 nginx:latest 镜像的 Deployment,同时创建一个与之连接的服务。 deployᄋulia ᄉ Eleanor

✨ 主要特性

多集群管理

  • 无缝交互多个 Kubernetes 集群。
  • 执行上下文感知操作。
  • 通过 MCP 提示轻松切换集群。

资源控制

可对以下资源进行查看、创建、更新、删除操作:

  • 部署、服务、Pods
  • ConfigMaps、Secrets、Ingresses
  • StatefulSets、DaemonSets
  • Roles、ClusterRoles
  • PersistentVolumes & Claims

命名空间操作

  • 创建/删除命名空间。
  • 列出命名空间中的所有资源。
  • 管理标签和资源配额。

节点管理

  • 查看节点详细信息和状态。
  • 打结/解开、标记/污损节点。
  • 列出每个节点的 Pods
help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client