Cluster API MCP server

Provides secure bridge to Kubernetes Cluster API management clusters, enabling creation, scaling, and lifecycle management of Kubernetes clusters across cloud providers with AWS support, node management, kubeconfig retrieval, and comprehensive monitoring capabilities.
Back to servers
Setup instructions
Provider
jsell-rh
Release date
Jul 02, 2025
Language
Java
Stats
1 star

The CAPI MCP Server provides a production-grade interface between AI agents and Kubernetes Cluster API (CAPI), allowing for simplified management of Kubernetes clusters through a secure, standardized protocol. It acts as a bridge that abstracts away the complexity of CAPI operations into straightforward tools for cluster lifecycle management.

Installation

Prerequisites

Before installing the CAPI MCP Server, ensure you have:

  • Go 1.24.x
  • Docker & Docker Compose
  • kubectl
  • kind (for local testing)

Local Installation

# Clone the repository
git clone https://github.com/capi-mcp/capi-mcp-server.git
cd capi-mcp-server

# Build the server
make build

# Run locally with your API key
API_KEY=your-key make run

Kubernetes Deployment

For production environments, deploy the server using Helm:

helm install capi-mcp-server ./deploy/charts/capi-mcp-server \
  --set auth.apiKey=$API_KEY \
  --namespace capi-system

Usage

The CAPI MCP Server provides several core tools for managing Kubernetes clusters through AWS infrastructure.

Authentication

All requests to the server require API key authentication using a Bearer token:

curl -H "Authorization: Bearer your-api-key" https://your-server-address/api/v1/clusters

Available Tools

Listing Clusters

To retrieve all managed workload clusters:

curl -H "Authorization: Bearer your-api-key" https://your-server-address/api/v1/clusters

Getting Cluster Details

To get detailed information about a specific cluster:

curl -H "Authorization: Bearer your-api-key" https://your-server-address/api/v1/clusters/my-cluster

Creating a New Cluster

To create a new workload cluster from templates:

curl -X POST \
  -H "Authorization: Bearer your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "my-new-cluster",
    "template": "standard",
    "version": "1.27",
    "nodeCount": 3,
    "region": "us-west-2"
  }' \
  https://your-server-address/api/v1/clusters

Deleting a Cluster

To delete an existing workload cluster:

curl -X DELETE \
  -H "Authorization: Bearer your-api-key" \
  https://your-server-address/api/v1/clusters/my-cluster

Scaling a Cluster

To scale worker nodes in a cluster:

curl -X PATCH \
  -H "Authorization: Bearer your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "nodeCount": 5
  }' \
  https://your-server-address/api/v1/clusters/my-cluster/scale

Retrieving Cluster Kubeconfig

To get access credentials for a cluster:

curl -H "Authorization: Bearer your-api-key" \
  https://your-server-address/api/v1/clusters/my-cluster/kubeconfig

Listing Cluster Nodes

To list all nodes within a cluster:

curl -H "Authorization: Bearer your-api-key" \
  https://your-server-address/api/v1/clusters/my-cluster/nodes

Security Considerations

The server implements several security measures:

  • API key authentication for all requests
  • Role-Based Access Control (RBAC) for authorization
  • Secure secrets management
  • Least-privilege access principles

When deploying in production, ensure your API keys are kept secure and rotated regularly.

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 "capi-mcp" '{"command":"go","args":["run","github.com/jsell-rh/capi-mcp/cmd/server"]}'

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": {
        "capi-mcp": {
            "command": "go",
            "args": [
                "run",
                "github.com/jsell-rh/capi-mcp/cmd/server"
            ]
        }
    }
}

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": {
        "capi-mcp": {
            "command": "go",
            "args": [
                "run",
                "github.com/jsell-rh/capi-mcp/cmd/server"
            ]
        }
    }
}

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