KubeBlocks Cloud MCP server

Enables querying and managing KubeBlocks Cloud resources including organizations, environments, instances, and backups via the KB Cloud API for automated database operations.
Back to servers
Setup instructions
Provider
ApeCloud
Release date
Apr 10, 2025
Language
Go
Stats
2 stars

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).

Prerequisites

Before installing the KubeBlocks Cloud MCP Server, ensure you have:

  1. Go 1.20 or higher (compatible with the MCP-Go package)
  2. KubeBlocks Cloud API credentials (API key name and secret)

Installation

Building from Source

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

Using Docker

The server is also available as a Docker image, which is used in the VS Code configuration shown later.

Configuration

Environment Variables

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

Configuration File

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

Running the Server

Basic Command Line Usage

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

VS Code Integration

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).

Available MCP Tools

The server provides the following tools for interacting with KubeBlocks Cloud:

Organizations

  • 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)

Environments

  • 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)

Instances

  • 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)

Backups

  • 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)

How to install this MCP server

For Claude Code

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.

For Cursor

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.

Adding an MCP server to Cursor globally

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}"
            }
        }
    }
}

Adding an MCP server to a project

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.

How to use the MCP server

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.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.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

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later