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.
Before installing the CAPI MCP Server, ensure you have:
# 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
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
The CAPI MCP Server provides several core tools for managing Kubernetes clusters through AWS infrastructure.
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
To retrieve all managed workload clusters:
curl -H "Authorization: Bearer your-api-key" https://your-server-address/api/v1/clusters
To get detailed information about a specific cluster:
curl -H "Authorization: Bearer your-api-key" https://your-server-address/api/v1/clusters/my-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
To delete an existing workload cluster:
curl -X DELETE \
-H "Authorization: Bearer your-api-key" \
https://your-server-address/api/v1/clusters/my-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
To get access credentials for a cluster:
curl -H "Authorization: Bearer your-api-key" \
https://your-server-address/api/v1/clusters/my-cluster/kubeconfig
To list all nodes within a cluster:
curl -H "Authorization: Bearer your-api-key" \
https://your-server-address/api/v1/clusters/my-cluster/nodes
The server implements several security measures:
When deploying in production, ensure your API keys are kept secure and rotated regularly.
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.
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": {
"capi-mcp": {
"command": "go",
"args": [
"run",
"github.com/jsell-rh/capi-mcp/cmd/server"
]
}
}
}
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": {
"capi-mcp": {
"command": "go",
"args": [
"run",
"github.com/jsell-rh/capi-mcp/cmd/server"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect