
This repository contains the Claude Kubernetes MCP (Model Control Plane) server, built in Go. The server integrates with ArgoCD, GitLab, Claude AI, and Kubernetes to enable advanced control and automation of Kubernetes environments.
This server is designed to orchestrate Kubernetes workloads using Claude AI, GitLab, ArgoCD, and Vault. It exposes a REST API that allows programmatic interaction with these systems, driven by a configured config.yaml and authenticated using an API key.
~/.kube/configgit clone https://github.com/blankcut/kubernetes-mcp-server.git
cd kubernetes-mcp-server
Export credentials for ArgoCD, GitLab, and Claude:
export ARGOCD_USERNAME="argocd-username"
export ARGOCD_PASSWORD="argocd-password"
export GITLAB_TOKEN="gitlab-token"
export CLAUDE_API_KEY="claude-api-key"
export VAULT_TOKEN="optional-if-using-vault"
Ensure a kubeconfig is available:
export KUBECONFIG=~/.kube/config
config.yamlUpdate kubernetes-claude-mcp/config.yaml with credentials and server preferences:
server:
address: ":8080"
readTimeout: 30
writeTimeout: 60
auth:
apiKey: ""${API_KEY}""
kubernetes:
kubeconfig: ""
inCluster: false
defaultContext: ""
defaultNamespace: "default"
argocd:
url: "http://example.argocd.com"
authToken: ""
username: "${ARGOCD_USERNAME}"
password: "${ARGOCD_PASSWORD}"
insecure: true
gitlab:
url: "https://gitlab.com"
authToken: "${AUTH_TOKEN}"
apiVersion: "v4"
projectPath: ""${PROJECT_PATH}""
claude:
apiKey: "${API_KEY}"
baseURL: "https://api.anthropic.com"
modelID: "claude-3-haiku-20240307"
maxTokens: 4096
temperature: 0.7
You can use the provided Go templates or environment variable interpolation method.
Please ensure a config.yaml includes an apiKey. This will be used to authenticate requests in Postman or any external client.
cd kubernetes-claude-mcp
go run ./cmd/server/main.go
LOG_LEVEL=debug go run ./cmd/server/main.go --config config.yaml
Server will start and bind to the configured port in config.yaml (default: 8080).
cd kubernetes-claude-mcp
docker build -t claude-mcp-server -f Dockerfile .
cd kubernetes-claude-mcp
docker-compose build
docker-compose up -d
A Helm chart is included in the repository for Kubernetes deployment:
cd kubernetes-claude-mcp/deployments/helm
Update values.yaml with appropriate values and run:
helm install claude-mcp .
To upgrade:
helm upgrade claude-mcp .
Please ensure secrets and config maps are properly mounted and secured in the cluster.
Below are the primary endpoints exposed by the MCP server. All requests require the X-API-Key header:
GET /api/v1/healthGET /api/v1/namespacesGET /api/v1/resources/{kind}?namespace={ns}GET /api/v1/resources/{kind}/{name}?namespace={ns}GET /api/v1/events?namespace={ns}&resource={kind}&name={name}GET /api/v1/argocd/applicationsPOST /api/v1/mcp/resourcePOST /api/v1/mcp/troubleshootPOST /api/v1/mcp/commitPOST /api/v1/mcpAll POST endpoints accept a JSON payload containing fields such as:
{
"resource": "pod",
"name": "example-pod",
"namespace": "default",
"query": "What’s wrong with this pod?"
}
A ready-to-use Postman collection will be available soon.
This project is licensed under the MIT License.
Documentation will be expanded soon. If you’d like to contribute, feel free to open a pull request or file an issue!
A Model Context Protocol (MCP) server for the Kubernetes API.
No releases published
No packages published