KubeBlocks Cloud MCP Server provides seamless integration with KubeBlocks Cloud APIs, enabling AI assistants to interact with KubeBlocks Cloud resources through a standardized tool-calling interface based on the Model Context Protocol (MCP).
Before installing the KubeBlocks Cloud MCP Server, ensure you have:
You can build the server from source code with the following commands:
git clone https://github.com/apecloud/kb-cloud-mcp-server.git
cd kb-cloud-mcp-server
go mod tidy
go build -o kb-cloud-mcp-server ./cmd/server
The server is also available as a Docker image, which is used in the VS Code configuration shown later.
Configure the server using the following environment variables:
# Required KubeBlocks Cloud API credentials
export KB_CLOUD_API_KEY_NAME=your-api-key-name
export KB_CLOUD_API_KEY_SECRET=your-api-key-secret
# Optional configurations
export KB_CLOUD_SITE=https://api.apecloud.com # KubeBlocks Cloud API endpoint
export KB_CLOUD_MCP_LOG_LEVEL=info # debug, info, warn, error
export KB_CLOUD_MCP_EXPORT_TRANSLATIONS=true # Export translations to JSON file
export KB_CLOUD_DEBUG=true # Enable debug mode for API client
Alternatively, use a YAML configuration file:
# .kb-cloud-mcp-server.yaml
log_level: info
api_key: your-api-key-name
api_secret: your-api-key-secret
site_url: https://api.apecloud.com
Start the server from the command line:
./kb-cloud-mcp-server
Or with command-line flags:
./kb-cloud-mcp-server stdio --api-key=your-api-key-name --api-secret=your-api-key-secret
Or using a configuration file:
./kb-cloud-mcp-server stdio --config=.kb-cloud-mcp-server.yaml
To use the server with VS Code's agent mode, add the following configuration to your VS Code User Settings (JSON):
{
"mcp": {
"inputs": [
{
"type": "promptString",
"id": "kb_cloud_api_key",
"description": "KubeBlocks Cloud API Key Name",
"password": false
},
{
"type": "promptString",
"id": "kb_cloud_api_secret",
"description": "KubeBlocks Cloud API Secret",
"password": true
}
],
"servers": {
"kbcloud": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"KB_CLOUD_API_KEY_NAME",
"-e",
"KB_CLOUD_API_KEY_SECRET",
"apecloud/kb-cloud-mcp-server:latest"
],
"env": {
"KB_CLOUD_API_KEY_NAME": "${input:kb_cloud_api_key}",
"KB_CLOUD_API_KEY_SECRET": "${input:kb_cloud_api_secret}"
}
}
}
}
}
Alternatively, you can add this to .vscode/mcp.json
in your workspace (without the mcp
key).
The server provides the following tools for interacting with KubeBlocks Cloud:
list_organizations - List all organizations you have access to
get_organization - Get details of a specific organization
organizationId
: Organization unique identifier (string, required)list_environments - List all environments within an organization
organizationId
: Organization unique identifier (string, required)get_environment - Get details of a specific environment
organizationId
: Organization unique identifier (string, required)environmentId
: Environment unique identifier (string, required)list_instances - List all instances within an environment
organizationId
: Organization unique identifier (string, required)environmentId
: Environment unique identifier (string, required)get_instance - Get details of a specific instance
organizationId
: Organization unique identifier (string, required)environmentId
: Environment unique identifier (string, required)instanceId
: Instance unique identifier (string, required)list_backups - List all backups for an instance
organizationId
: Organization unique identifier (string, required)environmentId
: Environment unique identifier (string, required)instanceId
: Instance unique identifier (string, required)get_backup - Get details of a specific backup
organizationId
: Organization unique identifier (string, required)environmentId
: Environment unique identifier (string, required)instanceId
: Instance unique identifier (string, required)backupId
: Backup unique identifier (string, required)To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "kbcloud" '{"command":"docker","args":["run","-i","--rm","-e","KB_CLOUD_API_KEY_NAME","-e","KB_CLOUD_API_KEY_SECRET","apecloud/kb-cloud-mcp-server:latest"],"env":{"KB_CLOUD_API_KEY_NAME":"${input:kb_cloud_api_key}","KB_CLOUD_API_KEY_SECRET":"${input:kb_cloud_api_secret}"}}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"kbcloud": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"KB_CLOUD_API_KEY_NAME",
"-e",
"KB_CLOUD_API_KEY_SECRET",
"apecloud/kb-cloud-mcp-server:latest"
],
"env": {
"KB_CLOUD_API_KEY_NAME": "${input:kb_cloud_api_key}",
"KB_CLOUD_API_KEY_SECRET": "${input:kb_cloud_api_secret}"
}
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"kbcloud": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"KB_CLOUD_API_KEY_NAME",
"-e",
"KB_CLOUD_API_KEY_SECRET",
"apecloud/kb-cloud-mcp-server:latest"
],
"env": {
"KB_CLOUD_API_KEY_NAME": "${input:kb_cloud_api_key}",
"KB_CLOUD_API_KEY_SECRET": "${input:kb_cloud_api_secret}"
}
}
}
}
3. Restart Claude Desktop for the changes to take effect