The KubeBlocks Cloud MCP Server is a Model Context Protocol (MCP) server that provides seamless integration with KubeBlocks Cloud APIs, enabling AI assistants to interact with KubeBlocks Cloud resources through a standardized tool-calling interface.
- Automating KubeBlocks Cloud resource management
 - Retrieving and analyzing data from KubeBlocks Cloud environments
 - Building AI-powered tools that interact with the KubeBlocks Cloud ecosystem
 - Enabling AI assistants to provision and manage database instances
 
- MCP-based API for accessing KubeBlocks Cloud resources
 - Secure authentication via KubeBlocks Cloud API key and secret
 - Support for common KubeBlocks Cloud resources:
- Organizations
 - Environments
 - Instances
 - Backups
 
 - Internationalization support via translation helpers
 - Secure communication through StdioServer
 
- Go 1.20+ (compatible with the MCP-Go package)
 - KubeBlocks Cloud API credentials - you'll need an API key name and secret
 
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/serverAdd the following JSON block to your User Settings (JSON) file in VS Code. You can do this by pressing Ctrl + Shift + P and typing Preferences: Open User Settings (JSON).
Optionally, you can add it to a file called .vscode/mcp.json in your workspace to share the configuration with others.
Note that the
mcpkey is not needed in the.vscode/mcp.jsonfile.
{
  "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}"
        }
      }
    }
  }
}More about using MCP server tools in VS Code's agent mode documentation.
The server supports the following environment variables:
# KubeBlocks Cloud API credentials (required)
export KB_CLOUD_API_KEY_NAME=your-api-key-name
export KB_CLOUD_API_KEY_SECRET=your-api-key-secret
export KB_CLOUD_SITE=https://api.apecloud.com  # Optional: KubeBlocks Cloud API endpoint
# Server configuration
export KB_CLOUD_MCP_LOG_LEVEL=info  # debug, info, warn, error
export KB_CLOUD_MCP_EXPORT_TRANSLATIONS=true  # Optional: Export translations to JSON file
export KB_CLOUD_DEBUG=true  # Optional: Enable debug mode for KubeBlocks Cloud API client./kb-cloud-mcp-serverOr with command-line flags:
./kb-cloud-mcp-server stdio --api-key=your-api-key-name --api-secret=your-api-key-secretYou can also use a 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.comThen start the server with:
./kb-cloud-mcp-server stdio --config=.kb-cloud-mcp-server.yamlThe server provides the following MCP tools for interacting with KubeBlocks Cloud resources:
- 
list_organizations - List all organizations you have access to
- No parameters required
 
 - 
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)
 
The exported Go API of this module should currently be considered unstable and subject to breaking changes. In the future, we may offer stability; please file an issue if there is a use case where this would be valuable.
This project is licensed under the Apache 2.0 License - see the LICENSE file for details.