Manage KubeSphere Resources and Access
KubeSphere MCP Server gives AI agents access to KubeSphere workspaces, clusters, users, roles, and extensions.
Why it matters
Integrate with KubeSphere to manage workspaces, clusters, users, roles, and extensions. This asset provides a centralized control plane for your KubeSphere environment.
Outcomes
What it gets done
Manage KubeSphere workspaces and clusters.
Control user access and role assignments.
Manage KubeSphere extensions.
Integrate with KubeSphere API for resource management.
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/vb-kubesphere | bash Capabilities
Tools your agent gets
Manage KubeSphere workspaces including creation, deletion, and configuration.
Manage KubeSphere clusters including registration, monitoring, and resource allocation.
Manage users and role-based access control in KubeSphere.
Manage KubeSphere extensions and add-ons installation and configuration.
Overview
KubeSphere MCP Server
KubeSphere MCP Server gives an AI agent read access to KubeSphere workspaces, clusters, users and roles, and extensions, via a ksconfig file. Use it when an AI agent needs to query resources across a KubeSphere-managed cluster instead of the KubeSphere console.
What it does
KubeSphere MCP Server is an MCP server that integrates with KubeSphere's APIs, letting an AI agent read resources from a KubeSphere cluster. Its tools are organized into four modules: Workspace Management, Cluster Management, User and Roles, and Extensions Center.
When to use - and when NOT to
Use it when you want an AI agent to query resources across a KubeSphere-managed Kubernetes environment: workspaces, clusters, users and their roles, or installed extensions, conversationally instead of navigating the KubeSphere console. It requires an existing KubeSphere cluster with an access address, username, and password, plus a ksconfig file, similar in shape to a kubeconfig, carrying the HTTP connection details pointed at that cluster. It is specific to KubeSphere's API surface, not a generic Kubernetes API client, so it is not a fit for clusters that don't run KubeSphere.
Capabilities
Four tool modules, each mapping to a KubeSphere API area:
- Workspace Management: read workspace-level resources
- Cluster Management: read cluster-level resources
- User and Roles: read user and role information
- Extensions Center: read installed extensions
How to install
Generate a ksconfig file, YAML, in a kubeconfig-like format, with your cluster's server address, an optional base64-encoded CA certificate for HTTPS access, and your KubeSphere username and password; the default context name is kubesphere, overridable via the KUBESPHERE_CONTEXT environment variable. Build the binary from source with go build -o ks-mcp-server cmd/main.go, or download a prebuilt one from the project's GitHub releases, then place it on your PATH. Register it in your MCP client, for example Claude Desktop or Cursor:
{
"mcpServers": {
"KubeSphere": {
"args": [
"stdio",
"--ksconfig", "<ksconfig file absolute path>",
"--ks-apiserver", "<KubeSphere Address>"
],
"command": "ks-mcp-server"
}
}
}
The --ks-apiserver flag, pointing at either the ks-console or ks-apiserver service address, is required if you're accessing KubeSphere over plain HTTP rather than HTTPS.
Who it's for
Platform teams running KubeSphere who want an AI agent to inspect workspaces, clusters, users, roles, and extensions conversationally, instead of navigating the KubeSphere console by hand. The same configuration pattern, a ksconfig path plus an optional apiserver address, applies whether the client is Claude Desktop or Cursor, so switching AI tools does not require reconfiguring the KubeSphere connection itself.
Source README
KubeSphere MCP Server
The KubeSphere MCP Server is a Model Context Protocol(MCP) server that provides integration with KubeSphere APIs, enabling to get resources from KubeSphere. Divided into four tools modules: Workspace Management, Cluster Management, User and Roles, Extensions Center.
Prerequisites
You must have a KubeSphere cluster. contains: Access Address, Username, Password.
Installation
Generate KSConfig
The format is similar to kubeconfig. This configuration contains HTTP connector information. The default context for KubeSphere is kubesphere, which can be modified via the environment variable 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>: Optional. Fill in the CA certificate in base64-encoded format when KubeSphere is accessed via HTTPS.<Server Address>: Required Must be an HTTPS address. (If using HTTP, enter any HTTPS address here, then modify via the parameter --ks-apiserver http://xxx)<KubeSphere Username>: Required The user for the KubeSphere cluster.<KubeSphere Password>: Required The password for the KubeSphere cluster user.
Get ks-mcp-server binary
you can run command go build -o ks-mcp-server cmd/main.go or download from (github releases)[https://github.com/kubesphere/ks-mcp-server/releases]
and then move it to $PATH.
Configuration MCP Server in AI Agent
Claude Desktop
- According to Claude Desktop
should change the MCP Configuration. like:
{
"mcpServers": {
"KubeSphere": {
"args": [
"stdio",
"--ksconfig", "<ksconfig file absolute path>",
"--ks-apiserver", "<KubeSphere Address>"
],
"command": "ks-mcp-server"
}
}
}
<ksconfig file absolute path>: Required The absolute path of the ksconfig file.<KubeSphere Address>: Optional (but required for HTTP access) The access address of the KubeSphere cluster, supporting either the ks-console or ks-apiserver service address (e.g., http://172.10.0.1:30880).
- chat with mcp server
Cursor
- According to Curosr
should change the MCP Configuration. like:
{
"mcpServers": {
"KubeSphere": {
"args": [
"stdio",
"--ksconfig", "<ksconfig file absolute path>",
"--ks-apiserver", "<KubeSphere Address>"
],
"command": "ks-mcp-server"
}
}
}
<ksconfig file absolute path>: Required The absolute path of the ksconfig file.<KubeSphere Address>: Optional (but required for HTTP access) The access address of the KubeSphere cluster, supporting either the ks-console or ks-apiserver service address (e.g., http://172.10.0.1:30880).
- chat with mcp server
FAQ
Common questions
Discussion
Questions & comments · 0
Sign In Sign in to leave a comment.