by kubesphere
The KubeSphere MCP Server integrates KubeSphere APIs to provide resource access, divided into four modules: Workspace Management, Cluster Management, User and Roles, and Extensions Center.
The KubeSphere MCP Server is a Model Context Protocol (MCP) server designed to integrate with KubeSphere APIs. It enables users to access and manage resources within a KubeSphere cluster through a standardized protocol.
To use the KubeSphere MCP Server, you first need a KubeSphere cluster with its access address, username, and password. Installation involves generating a KSConfig
file, similar to kubeconfig
, which contains HTTP connector information for your KubeSphere instance. You then obtain the ks-mcp-server
binary by building it from source (go build -o ks-mcp-server cmd/main.go
) or downloading it from GitHub releases. Finally, you configure the MCP Server within an AI Agent like Claude Desktop or Cursor by specifying the ks-mcp-server
command and providing the absolute path to your KSConfig
file and the KubeSphere cluster address.
KSConfig
file.KSConfig
file?
The KSConfig
file is a YAML configuration similar to kubeconfig
, containing details like certificate-authority-data
, server
address, KubeSphere username
, and password
.KSConfig
server
field requires an HTTPS address, you can specify an HTTP KubeSphere address using the --ks-apiserver
parameter during MCP Server configuration.ks-mcp-server
binary?
You can download it from the GitHub releases page or build it from source.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
.
You must have a KubeSphere cluster. contains: Access Address, Username, Password.
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.
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
.
{
"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
).
{
"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
).
Reviews feature coming soon
Stay tuned for community discussions and feedback