kube-compare-mcp
MCP server for kube-compare - enables AI assistants to compare Kubernetes cluster configurations against reference templates.
Potencialize seu agente
Instalação do publicador. Não é um endpoint do PlugMCP.
Host a copy with our keys and logs.
Ainda não há uma versão empacotada no registro. Siga o README do repositório.
URL remota ou um comando na sua máquina? Como as duas instalações diferem
Rodar no PlugMCP
A new server you create. It is not this listing's official endpoint. Use the publisher install when you want their URL and their credentials.
AbrirDo publicador
MCP server for kube-compare - enables AI assistants to compare Kubernetes cluster configurations against reference templates.
MCP server for kube-compare - enables AI assistants to compare Kubernetes cluster configurations against reference templates
This project provides a Model Context Protocol (MCP) server for Kubernetes / OpenShift cluster compliance checking. It allows AI assistants like Claude, Cursor, OpenShift Lightspeed (OLS), and other MCP-compatible clients to:
Note: This server is designed for remote deployment (e.g., in a Kubernetes cluster). Reference configurations must be provided via HTTP/HTTPS URLs or OCI container image references - local filesystem paths are not supported.
flowchart TB
subgraph clients [MCP Clients]
Cursor[Cursor IDE]
Claude[Claude Desktop]
OLS[OpenShift Lightspeed]
end
subgraph server [kube-compare-mcp Server]
Transport[Transport Layer<br/>stdio / http]
Tools[MCP Tools]
Diff[kube_compare_cluster_diff]
ResolveRDS[kube_compare_resolve_rds]
ValidateRDS[kube_compare_validate_rds]
BIOSDiff[baremetal_bios_diff]
end
subgraph external [External Resources]
K8sCluster[Kubernetes Cluster]
Registry[Container Registry<br/>registry.redhat.io]
HTTPRef[HTTP References]
end
Cursor --> Transport
Claude --> Transport
OLS --> Transport
Transport --> Tools
Tools --> Diff
Tools --> ResolveRDS
Tools --> ValidateRDS
Tools --> BIOSDiff
Diff --> K8sCluster
Diff --> Registry
Diff --> HTTPRef
ResolveRDS --> K8sCluster
ResolveRDS --> Registry
ValidateRDS --> Diff
ValidateRDS --> ResolveRDS
BIOSDiff --> K8sCluster
# Build the server
git clone https://github.com/sakhoury/kube-compare-mcp.git
cd kube-compare-mcp
make build
# Run locally with stdio transport (for local MCP clients)
./bin/kube-compare-mcp
# Or run with HTTP transport for network access
./bin/kube-compare-mcp --transport=http --port=8080
git clone https://github.com/sakhoury/kube-compare-mcp.git
cd kube-compare-mcp
make build
The binary will be available at bin/kube-compare-mcp.
sudo make install
# macOS Apple Silicon
make build-darwin-arm64
# macOS Intel
make build-darwin-amd64
# Linux x86_64 (for containers/servers)
make build-linux-amd64
# All platforms
make build-all
For local MCP clients like Cursor and Claude Desktop running on the same machine:
./bin/kube-compare-mcp --transport=stdio
For network access and MCP client integration (Cursor, Claude Desktop, OpenShift Lightspeed):
./bin/kube-compare-mcp --transport=http --port=8080
Endpoints:
POST /mcp - MCP endpointGET /health - Health check endpointThe recommended deployment is as a service in your Kubernetes cluster. This allows the MCP server to use in-cluster authentication and directly access the cluster API.
Deploy using the provided Kustomize manifests:
kubectl apply -k deploy/
This creates:
Build the container image, push to registry, deploy to OpenShift, and configure registry credentials in one command:
make docker-build docker-push deploy setup-registry-credentials IMG=quay.io/myuser/kube-compare-mcp:latest
If using the RDS tools (kube_compare_resolve_rds or kube_compare_validate_rds), you need to provide credentials for registry.redhat.io.
On OpenShift (recommended): Use the Makefile target to copy the existing cluster pull-secret:
make setup-registry-credentials
Alternatively, create credentials from username/password:
kubectl create secret docker-registry registry-credentials \
--docker-server=registry.redhat.io \
--docker-username=<your-username> \
--docker-password=<your-password> \
-n kube-compare-mcp
Or use a local pull-secret file:
kubectl create secret generic registry-credentials \
--from-file=.dockerconfigjson=/path/to/pull-secret.json \
--type=kubernetes.io/dockerconfigjson \
-n kube-compare-mcp
To configure OpenShift Lightspeed to use this MCP server, add the following to your OLSConfig:
spec:
featureGates:
- MCPServer
mcpServers:
- name: kube-compare-mcp
streamableHTTP:
url: http://kube-compare-mcp.kube-compare-mcp.svc.cluster.local:8080/mcp
timeout: 60
sseReadTimeout: 0
enableSSE: false
Configure your MCP client to connect to the server's endpoint:
Cursor (.cursor/mcp.json):
{
"mcpServers": {
"kube-compare": {
"url": "https://kube-compare-mcp-route.apps.your-cluster.example.com/mcp"
}
}
}
Claude Desktop:
{
"mcpServers": {
"kube-compare": {
"url": "https://kube-compare-mcp-route.apps.your-cluster.example.com/mcp"
}
}
}
Local stdio mode (Claude Desktop claude_desktop_config.json):
{
"mcpServers": {
"kube-compare": {
"command": "/path/to/kube-compare-mcp",
"args": ["--transport=stdio"]
}
}
}
The server exposes four MCP tools:
Detect configuration drift between a Kubernetes/OpenShift cluster and a reference design.
Example prompts:
Compare my Kubernetes cluster against the reference configuration at https://example.com/telco-core/metadata.yaml
Run kube-compare on my cluster using reference container://quay.io/openshift-kni/telco-core-rds-rhel9:v4.18:/metadata.yaml
Get the correct Red Hat Telco RDS container reference for a cluster's OpenShift version.
Response:
{
"cluster_version": "4.18.0",
"rhel_version": "rhel9",
"rds_type": "core",
"reference": "container://registry.redhat.io/openshift4/openshift-telco-core-rds-rhel9:v4.18:/usr/share/telco-core-rds/configuration/reference-crs-kube-compare/metadata.yaml",
"available_versions": ["v4.16", "v4.17", "v4.18", "v4.19"],
"validated": true
}
Example prompts:
Find the Telco Core RDS reference for my OpenShift 4.18 cluster
What RDS reference should I use for a RAN deployment on OpenShift 4.20?
Find the Telco Hub RDS reference for my OpenShift 4.19 cluster
Validate an OpenShift cluster's compliance with Red Hat Telco RDS. This is the recommended tool for RDS validation.
Response:
{
"rds_reference": {
"cluster_version": "4.18.0",
"rhel_version": "rhel9",
"rds_type": "core",
"reference": "container://...",
"available_versions": ["v4.16", "v4.17", "v4.18"],
"validated": true
},
"comparison": {
"Summary": { ... },
"Diffs": [ ... ]
}
}
Example prompts:
Compare my cluster against the Telco Core RDS
Check if my OpenShift cluster is compliant with the Telco RAN DU reference design
Validate my hub cluster against the Telco Hub RDS for OpenShift 4.19
Compare BIOS versions and settings of bare metal hosts against reference configurations. Targets ZTP-provisioned clusters managed via ACM hub.
Response:
{
"Namespace": "my-cluster",
"Hosts": [
{
"Name": "worker-0",
"Namespace": "my-cluster",
"Role": "worker",
"ServerModel": {
"Manufacturer": "Dell Inc.",
"ProductName": "XR8620t"
},
"Reference": "bios-ref-dell-xr8620t-worker",
"ReferenceSource": "mcp-server-cluster",
"BIOSVersion": {
"Expected": "2.19.1",
"Actual": "2.18.0",
"Match": false
},
"SettingsDiff": [
{
"Setting": "SriovGlobalEnable",
"Expected": "Enabled",
"Actual": "Disabled"
}
],
"Compliant": false
}
],
"Summary": {
"TotalHosts": 1,
"CompliantHosts": 0,
"NumDiffHosts": 1,
"ErrorHosts": 0
}
}
Example prompts:
Compare the BIOS settings of all hosts in namespace my-cluster against reference configurations
Check if host worker-0 in namespace my-cluster has compliant BIOS settings
Validate BIOS configuration for all bare metal hosts in the spoke-cluster-1 namespace
This server includes specialized support for Red Hat's Telco Reference Design Specifications:
core)For telco core network functions on OpenShift.
registry.redhat.io/openshift4/openshift-telco-core-rds-rhel9ran)For Radio Access Network Distributed Unit workloads.
registry.redhat.io/openshift4/ztp-site-generate-rhel8hub)For Advanced Cluster Management hub clusters.
registry.redhat.io/openshift4/openshift-telco-hub-rds-rhel9When running inside an OpenShift cluster, the kube_compare_resolve_rds and kube_compare_validate_rds tools can automatically:
ClusterVersion resourceThe baremetal_bios_diff tool compares bare metal host BIOS settings against reference ConfigMaps stored on the MCP server cluster. This section describes how to create and deploy these references.
Each reference ConfigMap contains the expected BIOS version and settings for a specific server model and role:
apiVersion: v1
kind: ConfigMap
metadata:
name: bios-ref-dell-xr8620t-master
namespace: reference-configs
labels:
app.kubernetes.io/name: kube-compare-mcp
app.kubernetes.io/component: bios-reference
bios-reference/vendor: dell-inc
bios-reference/model: xr8620t
bios-reference/role: master
data:
biosVersion: "2.19.1"
settings: |
BootMode: Uefi
SysProfile: Custom
WorkloadProfile: TelcoOptimizedProfile
SriovGlobalEnable: Enabled
MadtCoreEnumeration: Linear
ProcC1E: Disabled
ProcPwrPerf: OsDbpm
Required fields:
Required labels for auto-matching:
The tool matches hosts to reference ConfigMaps using a two-step process:
bios-ref-dell-inc-xr8620t-worker) and looks for an exact match.bios-reference/vendor and bios-reference/role labels, then uses Smith-Waterman-Gotoh string similarity to find the best model match (minimum similarity threshold: 0.7).You can bypass auto-matching entirely by specifying a reference_override parameter with the exact ConfigMap name.
Example reference configurations for Dell and HPE servers are included in the repository:
# Deploy example BIOS reference ConfigMaps
kubectl apply -k examples/bios-reference-configs/
# Or use the Makefile target
make deploy-examples
This creates the reference-configs namespace and deploys example ConfigMaps for several server models. Customize or add your own ConfigMaps following the format above.
To remove the examples:
make undeploy-examples
Reference ConfigMaps are only read from the MCP server's own cluster (via in-cluster config), never from the user-provided kubeconfig. This ensures the server operator controls the compliance baseline -- users cannot influence which reference configurations are used for comparison.
All tools support connecting to remote clusters via kubeconfig. The format is auto-detected:
Simply provide the kubeconfig content as-is:
{
"reference": "https://example.com/metadata.yaml",
"kubeconfig": "apiVersion: v1\nkind: Config\nclusters:\n- name: my-cluster\n ...",
"context": "my-cluster-context"
}
# Encode your kubeconfig
base64 < ~/.kube/config # Works on both Linux and macOS
{
"reference": "https://example.com/metadata.yaml",
"kubeconfig": "<base64-encoded-kubeconfig>",
"context": "my-cluster-context"
}
When using this MCP server with OpenShift Lightspeed (OLS), you may encounter token and file size limits. The OLS operator restricts the amount of data it sends to MCP servers. Since full kubeconfigs often contain embedded CA certificates and multiple contexts, they can exceed these limits.
Create a minimal kubeconfig using a service account token:
# Create a service account with cluster-admin access
oc create sa rds-checker -n default
oc adm policy add-cluster-role-to-user cluster-admin -z rds-checker -n default
# Generate a token and get the API server URL
TOKEN=$(oc create token rds-checker -n default --duration=24h)
API_SERVER=$(oc whoami --show-server)
# Create minimal kubeconfig
cat << EOF > minimal-kubeconfig.yaml
apiVersion: v1
kind: Config
clusters:
- cluster:
server: ${API_SERVER}
insecure-skip-tls-verify: true
name: cluster
contexts:
- context:
cluster: cluster
user: user
name: ctx
current-context: ctx
users:
- name: user
user:
token: ${TOKEN}
EOF
# Verify connectivity
export KUBECONFIG="${PWD}/minimal-kubeconfig.yaml"
oc whoami
Why this works:
insecure-skip-tls-verify instead of embedding large CA bundles--duration as needed)Security Note: Using
insecure-skip-tls-verify: trueskips TLS certificate verification. This is acceptable when the MCP server runs inside the same cluster or when connecting over a trusted network. For production use across untrusted networks, consider using the CA certificate approach with a compressed kubeconfig. Thecluster-adminrole grants full cluster access; consider creating a more restrictive ClusterRole for production use.
You can then provide this minimal kubeconfig content to the MCP tools directly or base64-encode it:
base64 < minimal-kubeconfig.yaml # Works on both Linux and macOS
The server implements several security measures when processing kubeconfigs:
Supported authentication methods:
Blocked authentication methods (security risk):
users[].exec)users[].auth-provider)References must be provided as remote URLs:
Note: Local filesystem paths are not supported. Host your reference configurations on an HTTP server, GitHub raw URLs, or package them in a container image.
The tools return comparison results in the specified format (default: JSON).
{
"Summary": {
"NumDiffCRs": 1,
"NumMissing": 0,
"UnmatchedCRS": [],
"ValidationIssuses": {}
},
"Diffs": [
{
"CRName": "apps/v1_Deployment_default_my-app",
"CorrelatedTemplate": "deployment.yaml",
"DiffOutput": "--- reference\n+++ cluster\n..."
}
]
}
summary:
numDiffCRs: 1
numMissing: 0
unmatchedCRS: []
validationIssues: {}
diffs:
- crName: apps/v1_Deployment_default_my-app
correlatedTemplate: deployment.yaml
diffOutput: |
--- reference
+++ cluster
...
For CI/CD integration, use junit format to generate test reports.
The server behavior can be customized using environment variables:
Example:
# Set a 200MB max file size and 10 minute pull timeout
export KUBE_COMPARE_MCP_MAX_FILE_SIZE=209715200
export KUBE_COMPARE_MCP_IMAGE_PULL_TIMEOUT=10m
# Increase validation timeouts for slow networks
export KUBE_COMPARE_MCP_HTTP_VALIDATION_TIMEOUT=30s
export KUBE_COMPARE_MCP_OCI_VALIDATION_TIMEOUT=60s
./bin/kube-compare-mcp --transport=http --port=8080
make build
# Clean build artifacts
make clean
# Run with debug logging (stdio transport)
make run
make test
# With coverage
make test-cover
make lint
# With auto-fix
make lint-fix
make verify
# Show all available make targets
make help
# Build container image (builds for linux/amd64 by default, works on macOS)
make docker-build IMG=quay.io/myuser/kube-compare-mcp:v1.0.0
# Push to registry
make docker-push IMG=quay.io/myuser/kube-compare-mcp:v1.0.0
# Deploy to cluster
make deploy IMG=quay.io/myuser/kube-compare-mcp:v1.0.0
# Configure registry credentials for RDS tools (OpenShift only)
make setup-registry-credentials
# Remove deployment from cluster
make undeploy
# Deploy example BIOS reference ConfigMaps
make deploy-examples
# Remove example BIOS reference ConfigMaps
make undeploy-examples
Variables:
IMG - Container image name and tagCONTAINER_TOOL - Container tool to use (default: podman, can use docker)PLATFORM - Target platform (default: linux/amd64)Apache License 2.0 - See LICENSE for details.
MCP server for kube-compare - enables AI assistants to compare Kubernetes cluster configurations against reference templates
Ferramentas
Ainda não há lista de ferramentas. Servidores remotos recebem uma após a primeira verificação de saúde.
Perguntas frequentes
Copie nesta página a configuração stdio para Cursor, Claude Desktop, Claude Code ou VS Code. Ela usa a instalação do publicador, não um proxy do PlugMCP.
Este registro não lista nenhuma variável de ambiente obrigatória.
Kube Compare roda localmente via stdio.
Última verificação: 2026-10-28. MCP server for kube-compare - enables AI assistants to compare Kubernetes cluster configurations against reference templates