mcpField
K
KubeSphere MCP Server

KubeSphere MCP Server

本地服务
github.com/kubesphere云与基础设施1777 周前更新

关于 KubeSphere MCP Server

KubeSphere MCP Server 连接 AI Agent 与 KubeSphere API,以读取和管理平台资源。其工具按工作空间、集群、用户与角色以及 Extensions Center 划分。

主要功能

  1. 01工作空间管理工具
  2. 02集群管理工具
  3. 03用户与角色工具
  4. 04Extensions Center 工具
  5. 05访问 KubeSphere API

适用场景

  1. 01读取 KubeSphere 集群资源
  2. 02执行工作空间和集群相关操作
  3. 03使用用户与角色功能
  4. 04通过 AI Agent 使用 Extensions Center 功能

MCP 相关

它将 KubeSphere API 能力作为 MCP 工具提供给 AI Agent,分为工作空间、集群、用户与角色以及 Extensions Center 模块。

配置

本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。

暂未收录安装方式

我们还没有获取到这个服务的安装包或远程地址,请按项目 README 中的说明安装。

代码仓库

工具

还没有获取到工具列表

本地服务需要在你的电脑上运行后才能读取工具,维护者暂未提供工具列表。

详细介绍

KubeSphere MCP 服务

KubeSphere MCP 服务是一个 Model Context Protocol(MCP) 服务,可与 KubeSphere API 集成,从 KubeSphere 获取资源。它分为四个工具模块:Workspace Management、Cluster Management、User and Roles、Extensions Center。

前提条件

你必须拥有一个 KubeSphere 集群,包含:访问地址、用户名和密码。

安装

生成 KSConfig

其格式与 kubeconfig 类似。此配置包含 HTTP 连接器信息。KubeSphere 的默认上下文为 kubesphere,可通过环境变量 KUBESPHERE_CONTEXT 修改。

apiVersion: v1
clusters:
- cluster:
    certificate-authority-data: <CA file>
    server: <Server Address>
  name: kubesphere
contexts:
- context:
    cluster: kubesphere
    user: admin
  name: kubesphere
current-context: kubesphere
kind: Config
preferences: {}
users:
- name: admin
  user:
    username: <KubeSphere Username>
    password: <KubeSphere Password>

<CA file>:可选。通过 HTTPS 访问 KubeSphere 时,以 Base64 编码格式填写 CA 证书。
<Server Address>:必填,必须是 HTTPS 地址。(如果使用 HTTP,请在此处输入任意 HTTPS 地址,然后通过参数 --ks-apiserver http://xxx 修改。)
<KubeSphere Username>:必填,KubeSphere 集群的用户。
<KubeSphere Password>:必填,KubeSphere 集群用户的密码。

获取 ks-mcp-server 二进制文件

你可以运行命令 go build -o ks-mcp-server cmd/main.go,或从 (github releases)[https://github.com/kubesphere/ks-mcp-server/releases] 下载, 然后将其移至 $PATH。

在 AI Agent 中配置 MCP 服务
Claude Desktop
  1. 根据 Claude Desktop 的说明, 修改 MCP 配置。例如:
{
  "mcpServers": {
    "KubeSphere": {
      "args": [
        "stdio",
        "--ksconfig", "<ksconfig file absolute path>",
        "--ks-apiserver", "<KubeSphere Address>"
      ],
      "command": "ks-mcp-server"
    }
  }
}

<ksconfig file absolute path>:必填,ksconfig 文件的绝对路径。
<KubeSphere Address>:可选(但通过 HTTP 访问时必填),KubeSphere 集群的访问地址,支持 ks-console 或 ks-apiserver 服务地址(例如:http://172.10.0.1:30880)。

  1. 与 MCP 服务聊天 claude desktop result
Cursor
  1. 根据 Curosr 的说明, 修改 MCP 配置。例如:
{
  "mcpServers": {
    "KubeSphere": {
      "args": [
        "stdio",
        "--ksconfig", "<ksconfig file absolute path>",
        "--ks-apiserver", "<KubeSphere Address>"
      ],
      "command": "ks-mcp-server"
    }
  }
}

<ksconfig file absolute path>:必填,ksconfig 文件的绝对路径。
<KubeSphere Address>:可选(但通过 HTTP 访问时必填),KubeSphere 集群的访问地址,支持 ks-console 或 ks-apiserver 服务地址(例如:http://172.10.0.1:30880)。

  1. 与 MCP 服务聊天 cursor result

评论

支持 Markdown

第一次接触 MCP?

从协议是什么,到在客户端里装上第一个服务,这几条回答覆盖了大多数入门问题。

一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。