KubeCraft MCP Server
KubeCraft MCP Server gives AI assistants comprehensive Kubernetes visibility, analysis, and management through MCP tools — 73 open-source Community tools and 140 with KubeCraft Pro.
Cluster insight: Get cluster info, list namespaces/nodes, check node health, switch kubeconfig contexts, and multi-cluster overview.
Resource browsing: List pods, deployments, services, ingresses, Gateway API resources, HPAs, quotas, PDBs, DaemonSets, StatefulSets, CronJobs, Jobs, CSI drivers, storage, CRDs, and more; describe resources in YAML/JSON.
Diagnostics & troubleshooting: Fetch pod logs, describe resources, get events, check resource usage via metrics-server, run comprehensive pod diagnosis, and inspect node health.
Security & posture auditing: Inspect RBAC risks, summarize NetworkPolicies, policy engines (Kyverno/Gatekeeper), detect service mesh/CNI, diagnose CoreDNS, and perform cluster-DNS lookups.
Visualization & rendering: Generate Mermaid diagrams (
visualize_*) and PNG renders (render_*) for cluster topology, namespaces, networks, app architecture, and GPU dashboards/metrics.GitOps & CD integration: Detect and list ArgoCD apps/projects, Flux sources/kustomizations/HelmReleases, and Tekton pipelines/runs/tasks; visualize Flux flows.
OpenShift support: Detect OpenShift and list routes, projects, and BuildConfigs.
Helm: List releases and get user-supplied values.
GPU / accelerator awareness: List GPU workloads, assess cluster GPU readiness, and generate GPU visualizations/PromQL references.
CRD & operator inventory: List CRDs with instance counts, describe CRDs, count custom resources, and detect operators.
Management (KubeCraft Pro): Scale/restart/rollback deployments, cordon nodes, delete resources, apply/validate manifests, exec commands, install/uninstall Helm charts, trigger CronJobs, ArgoCD sync/rollback, and more.
Compliance reporting (Pro): Generate Markdown/PDF/DOCX compliance reports mapped to CIS, SOC 2, ISO 27001, NIST, PCI-DSS, and HIPAA using read-only evidence tools.
Full support for Amazon EKS clusters, enabling management and monitoring of EKS resources via the Kubernetes API.
Integration with ArgoCD for managing applications, projects, sync, rollback, and visualization of ArgoCD resources.
Support for Canonical Kubernetes (MicroK8s) clusters, providing full visibility and control.
Detection of Cilium CNI and service mesh, with network policy analysis and visualization capabilities.
Integration with Flux CD for managing sources, kustomizations, Helm releases, and unified GitOps visualization.
Tools for listing, installing, uninstalling, and retrieving values of Helm releases in the cluster.
Detection of Istio service mesh, enabling network analysis and service mesh diagnostics.
Full support for K3s lightweight Kubernetes clusters, compatible with standard Kubernetes APIs.
Comprehensive management of Kubernetes clusters including resources, diagnostics, security, compliance, storage, networking, and visualization.
Detection of Linkerd service mesh, providing network analysis and service mesh health insights.
GPU workload management, cluster readiness checks, allocation visualization, and nvidia-smi access.
Server statistics and observability via OpenTelemetry for monitoring the MCP server itself.
Direct querying of Prometheus for metrics and observability data from the cluster.
Support for Rancher-managed Kubernetes clusters, including K3s and standard Rancher integration.
Full support for Red Hat OpenShift clusters, including OpenShift-specific resources like routes, projects, and builds.
Integration with Tekton for listing pipelines, runs, tasks, and visualization of Tekton resources.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@KubeCraft MCP Server show me pods in default namespace with their resource usage"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
KubeCraft MCP Server
A Model Context Protocol (MCP) server that gives AI assistants (Claude, Cursor, etc.) full visibility and control over Kubernetes clusters.
Features (73 Community tools · 140 with KubeCraft Pro)
The open-source Community Edition (this repository, MIT) ships 73 tools. The separately licensed KubeCraft Pro add-on registers 67 more (140 total); those are marked Pro below and are not included in this repository or the Community image.
Category | Tools | Community | With Pro |
Cluster Info |
| 4 | 4 |
Resources |
| 11 | 11 |
Diagnostics |
| 3 | 3 |
Management |
| 0 | 9 |
Platform / Posture |
| 4 | 6 |
Security Posture |
| 0 | 4 |
Workloads |
| 4 | 9 |
Cluster Intelligence |
| 0 | 3 |
Advanced Storage |
| 1 | 3 |
Advanced Networking |
| 5 | 12 |
Ingress Audit |
| 0 | 4 |
Access Control (RBAC YAML) |
| 0 | 3 |
Compliance Reporting |
| 0 | 1 |
CRDs & Operators |
| 4 | 10 |
Visualization |
| 4 | 5 |
Rendered Diagrams |
| 7 | 8 |
3D Visualization |
| 0 | 1 |
Multi-Cluster |
| 2 | 3 |
Pod Exec |
| 0 | 1 |
Helm |
| 2 | 4 |
Cost Analysis |
| 0 | 2 |
OpenShift |
| 4 | 4 |
ArgoCD |
| 3 | 8 |
Flux CD |
| 5 | 5 |
Tekton |
| 4 | 5 |
GitOps Overview |
| 0 | 1 |
GPU / Accelerators |
| 3 | 6 |
Observability |
| 1 | 3 |
License |
| 2 | 2 |
Total | 73 | 140 |
Further roadmap items (HTTP MCP transport, deeper GitOps) are in docs/ROADMAP.md.
Related MCP server: Kubernetes MCP Server
Diagram & Visual Rendering
KubeCraft returns visual content using multiple MCP content types, with automatic browser fallback for clients that don't render visuals inline.
Content | MCP response type | Inline rendering | Fallback |
PNG diagrams ( |
| Cursor renders inline | Auto-opens saved PNG in default viewer; also saved to |
3D topology ( |
| Future clients that support | Auto-opens HTML in default browser; also saved to |
Mermaid text ( |
| Cursor + Claude Desktop render natively | Copy Mermaid block to any Mermaid renderer |
Auto-open behavior: When KUBECRAFT_OUTPUT_DIR is configured and writable, rendered PNGs and 3D HTML files are saved to disk and automatically opened in the user's default browser or image viewer. Inside Docker containers, auto-open works only when the container can reach the host display (e.g. via X11 forwarding or host networking); otherwise, open the saved files from the host-mounted output directory.
Kubernetes Distribution Compatibility
KubeCraft uses the standard Kubernetes Python client and communicates directly with the K8s API server — no kubectl or other CLI wrappers required.
Distribution | Status | Notes |
Vanilla K8s / KinD | Fully supported | Primary dev/test target |
Amazon EKS | Fully supported | kubeconfig via |
Azure AKS | Fully supported | kubeconfig via |
Google GKE | Fully supported | kubeconfig via |
Canonical K8s / MicroK8s | Fully supported | CNCF certified, standard APIs |
k3s / Rancher | Fully supported | Lightweight but fully conformant |
Red Hat OpenShift | Fully supported | Standard K8s tools + OCP-specific tools for Routes, Projects, BuildConfigs |
Quick Start
Build the Docker image
docker build -t kubecraft-mcp:latest .Configure in Cursor
Create or edit .cursor/mcp.json in your project:
{
"mcpServers": {
"kubecraft": {
"command": "docker",
"args": [
"run", "--rm", "-i", "--network=host",
"-v", "/home/<user>/.kube:/home/mcp/.kube:ro",
"-e", "KUBECONFIG=/home/mcp/.kube/config",
"kubecraft-mcp:latest"
]
}
}
}Windows (WSL kubeconfig):
{
"mcpServers": {
"kubecraft": {
"command": "docker",
"args": [
"run", "--rm", "-i",
"-v", "C:\\Users\\<user>\\.kube:/home/mcp/.kube:ro",
"-e", "KUBECONFIG=/home/mcp/.kube/config",
"kubecraft-mcp:latest"
]
}
}
}3D topology viewer (HTTP link, KubeCraft Pro): The Viewer URL works only while the Kubecraft process is running. If you run a one-off python -c locally, the server exits immediately and the link will show connection refused. On Docker Desktop (Windows/macOS), --network=host does not publish the container's loopback to your host browser like it does on Linux; prefer opening the saved HTML file from KUBECRAFT_OUTPUT_DIR, or publish a fixed port, for example add to args: "run", "--rm", "-i", "-p", "8765:8765", plus -e, KUBECRAFT_VIEWER_BIND=0.0.0.0:8765, -e, KUBECRAFT_VIEWER_EXPOSE=1, then use http://127.0.0.1:8765 plus the path from the tool output (copy it exactly; the token is case-sensitive).
Configure in Claude Desktop
Claude Desktop doesn't render MCP ImageContent or EmbeddedResource inline, so diagrams are saved to a shared folder on your machine and automatically opened in your default browser/viewer. Open (or create)
%APPDATA%\Claude\claude_desktop_config.json (Windows) or
~/Library/Application Support/Claude/claude_desktop_config.json (macOS):
Windows:
{
"mcpServers": {
"kubecraft": {
"command": "docker",
"args": [
"run", "--rm", "-i", "--network=host",
"-v", "C:\\Users\\<user>\\.kube:/home/mcp/.kube:ro",
"-v", "C:\\Users\\<user>\\kubecraft-diagrams:/output",
"-e", "KUBECONFIG=/home/mcp/.kube/config",
"-e", "KUBECRAFT_OUTPUT_DIR=/output",
"kubecraft-mcp:latest"
]
}
}
}Rendered PNG diagrams and 3D topology HTML files will appear in C:\Users\<user>\kubecraft-diagrams\ and auto-open in your browser.
macOS / Linux:
{
"mcpServers": {
"kubecraft": {
"command": "docker",
"args": [
"run", "--rm", "-i", "--network=host",
"-v", "/home/<user>/.kube:/home/mcp/.kube:ro",
"-v", "/home/<user>/kubecraft-diagrams:/output",
"-e", "KUBECONFIG=/home/mcp/.kube/config",
"-e", "KUBECRAFT_OUTPUT_DIR=/output",
"kubecraft-mcp:latest"
]
}
}
}Configure in Claude Code
claude mcp add kubecraft \
-- docker run --rm -i --network=host \
-v ~/.kube:/home/mcp/.kube:ro \
-e KUBECONFIG=/home/mcp/.kube/config \
kubecraft-mcp:latestBuilt-in Chat UI (Web mode)
KubeCraft ships with a full React/TypeScript chat UI bundled in the same Docker image. It exposes the full tool surface (73 Community tools, or 140 with KubeCraft Pro installed) as a conversational interface backed by your choice of LLM (Claude, OpenAI, or Azure OpenAI) — the LLM decides when to call MCP tools and the UI streams the results back with markdown, embedded PNG diagrams, and (with Pro) an interactive 3D topology viewer.
Pages
Chat — streaming conversation with expandable tool-invocation cards, image/HTML embedding, kubeconfig context switcher in the header. Per-message Copy and Edit actions (hover any message); Suggestions picker right next to the input opens a searchable popover of the full template library.
Templates — curated catalog of 159 prompt templates spanning all 27 tool categories. Sidebar filter by category, full-text search across title / prompt / tool name / tags. Click Use to drop a template into the chat input.
Saved — bookmark your own reusable questions; one click sends them to chat.
History — every past conversation, resumable.
Audit — every MCP tool call ever executed (compliance trail).
Settings — provider config, license registration, full tool inventory.
Compliance reporting (KubeCraft Pro)
KubeCraft Pro's generate_compliance_report tool produces audit-ready PDF and Word documents mapped to the major compliance frameworks. Run it from chat with one prompt like "Generate a SOC 2 compliance audit report and export PDF + Word".
Frameworks supported:
Framework | Mapping |
CIS Kubernetes Benchmark v1.9 | Direct control-ID mapping (5.1.x RBAC, 5.2.x PSS, 5.3.x networking, 5.4.x secrets, etc.) |
SOC 2 Trust Service Criteria | CC6.x logical access · CC7.x system operations · CC8.x change management |
ISO 27001:2022 | Annex A (A.5 access control · A.8 operations / cryptography / network security) |
NIST 800-53 Rev. 5 | AC, AU, CM, IA, RA, SC, SI control families |
PCI-DSS v4.0 | Req 1, 2, 6, 7, 8, 10 |
HIPAA Security Rule | §164.312 Technical Safeguards (a) Access · (b) Audit · (c) Integrity · (e) Transmission |
comprehensive | All of the above in one report — every finding lists its mapping in each framework |
What the report contains:
Executive summary — color-coded status counts + a 0-100 compliance score with interpretation
Findings summary table — every control with status, control ID, and one-line summary
Detailed findings — per-control: status, evidence excerpt, cross-framework mappings, remediation guidance
Methodology — which tools were used to gather evidence, which findings need manual review
Evidence sources (run automatically, read-only):
inspect_rbac · summarize_pod_security_standards · analyze_network_reachability · find_unprotected_workloads · audit_secret_hygiene · summarize_image_vulnerabilities · scan_deprecations · audit_ingress_tls · audit_loadbalancers · get_node_health · list_pod_disruption_budgets
Multi-cluster: Set multi_cluster=true to loop over every kubeconfig context and produce one combined report — each finding is prefixed with the originating cluster name.
Output: Files are saved under KUBECRAFT_OUTPUT_DIR/compliance/ as kubecraft-compliance-{framework}-{timestamp}.{md,pdf,docx}. When the web UI is running, the chat response includes a Download link served by /api/v1/files/... (path-traversal protected, scoped to the output dir).
Note: This is an evidence-aggregation tool, not a substitute for a qualified auditor. Findings flagged 🔍 manual review require human verification (e.g., kube-apiserver flags, organizational controls outside the cluster).
Output beautification
Assistant replies and tool outputs are rendered with GitHub-flavored markdown, including:
Mermaid diagrams — fenced
```mermaidblocks (returned byvisualize_*tools) are rendered as interactive SVG with a toolbar: Copy source, Copy as PNG, Download PNG, Toggle source, Fullscreen. Mermaid is lazy-loaded so the bundle stays slim for users who never see a diagram.PNG renders — every
render_*tool output (cluster topology, namespace, network, app architecture, premium architecture, GPU dashboard / metrics / sparkline) gets the same toolbar: Copy PNG, Download, Open in new tab, Fullscreen. Click the image to open it fullscreen; click the backdrop or press Esc to dismiss.3D HTML topology (
render_3d_topology, Pro) gets a matching panel: Open viewer (in-page iframe overlay), New tab (standalone Blob URL), Download (.htmlfile), Copy (HTML source). Includes a size readout (e.g. "342 KB · self-contained Three.js HTML").Syntax-highlighted fenced code blocks (highlight.js, common-language bundle)
Per-codeblock Copy button on hover
JSON auto-pretty-print when fenced as
```jsonWide tables with sticky headers + horizontal scroll wrapper
Status emojis (
✅ ❌ ⚠️ 🟢 🟡 🔴 ⏳) automatically rendered as tinted chips for fast scanning
Run web mode
Web mode has no authentication yet — bind it to localhost only (
-p 127.0.0.1:8080:8080, or-e KUBECRAFT_HTTP_HOST=127.0.0.1with--network=host); never publish it on a shared or public network.
Linux / WSL2 (recommended — uses host networking so the container can reach 127.0.0.1 clusters like kind/k3d/minikube):
docker run --rm --network=host \
-v ~/.kube:/home/mcp/.kube:ro \
-e KUBECONFIG=/home/mcp/.kube/config \
-e KUBECRAFT_MODE=http \
-e KUBECRAFT_HTTP_HOST=127.0.0.1 \
-e KUBECRAFT_LLM_PROVIDER=anthropic \
-e ANTHROPIC_API_KEY=sk-ant-... \
kubecraft-mcp:latestOpen http://localhost:8080.
Docker Desktop (Windows / macOS — --network=host is a no-op there; use host.docker.internal to reach a localhost cluster):
docker run --rm -p 127.0.0.1:8080:8080 --add-host=host.docker.internal:host-gateway \
-v ~/.kube:/home/mcp/.kube:ro \
-e KUBECONFIG=/home/mcp/.kube/config \
-e KUBECRAFT_MODE=http \
-e ANTHROPIC_API_KEY=sk-ant-... \
kubecraft-mcp:latestThen rewrite your kubeconfig to use host.docker.internal instead of 127.0.0.1 for the cluster URL — see Troubleshooting below.
The same image still runs MCP stdio mode by default — KUBECRAFT_MODE=http (or --http) opts into the web UI.
Provider configuration
Provider | Env vars |
Anthropic Claude (default) |
|
OpenAI |
|
Azure OpenAI |
|
The Settings page shows whether the active provider is configured and lists every supported provider.
Tool surface limits per provider
The 73-tool Community build fits every provider's limit. With KubeCraft Pro installed, KubeCraft exposes 140 tools, but OpenAI and Azure OpenAI cap tools at 128 entries per request (Anthropic has no practical limit). KubeCraft handles this transparently with a smart tool selector (kubecraft_mcp/llm/tool_selector.py):
Anthropic — receives every tool, every turn. No filtering.
OpenAI / Azure OpenAI — receives a relevant subset of ≤128 tools per turn, chosen by:
Always-include core (~15 tools): cluster discovery, diagnostics,
apply_manifest, etc.Category routing: keyword classifier on your most recent prompt + last few user messages → matches against a tool/category map.
Priority padding: any remaining slots are filled by global priority order (most universally useful tools first).
You'll see the selected count in the server log on every turn (e.g. Tool subset for openai: 128/140 tools). If the LLM ever says it can't find a tool you expected, rephrase with stronger keywords ("audit my RBAC for risky bindings" rather than "check permissions") to surface the right category.
Develop the UI locally
The UI lives at ui/ inside this repo (not a separate project). For local dev:
# Terminal 1 — Python backend
KUBECRAFT_MODE=http ANTHROPIC_API_KEY=... python -m kubecraft_mcp
# Terminal 2 — Vite dev server (proxies /api/* to :8080)
cd ui && npm install && npm run dev
# → http://localhost:5173For production builds, the Dockerfile bundles npm run build output into /app/ui/dist, served by FastAPI under /. No separate dev server needed.
Environment Variables
Variable | Description |
| Path to kubeconfig file |
| Directory for saving diagrams and 3D HTML files. Saved files are auto-opened in the default browser/viewer. Pre-created as |
| Pro ( |
| Pro ( |
| Pro ( |
| Pro ( |
| OpenTelemetry OTLP endpoint for trace export |
| Pro: ArgoCD server URL for sync/rollback actions (e.g. |
| Pro: ArgoCD API token for authenticated REST operations ( |
| Prometheus base URL for |
| Optional Bearer token for Prometheus |
| Optional basic auth for Prometheus (used instead of token when both are set) |
| Loki base URL for |
| Optional Bearer token for Loki |
| Optional basic auth for Loki |
| Optional |
| KubeCraft Pro license key (overrides file-based license; unused by the Community build) |
| Email address for KubeCraft Pro license registration |
|
|
| Bind address for web mode (default |
| Port for web mode (default |
| Optional label shown in the UI header to distinguish multiple deployments |
|
|
| Override the default model for the active provider |
| API key for Anthropic Claude provider |
| Optional Anthropic API base URL (proxies, mirrors) |
| API key for OpenAI provider |
| Optional OpenAI base URL (compatible endpoints, proxies) |
| Azure OpenAI configuration (deployment-based; |
| Comma-separated CORS allow-list for web mode (default |
Project Structure
kubecraft-mcp-server/
├── Dockerfile
├── pyproject.toml
├── kubecraft_mcp/
│ ├── server.py # MCP server entry point (73 Community tools)
│ ├── registry.py # Tool registry (ToolSpec: schema + handler + tier + kind)
│ ├── plugins.py # Entry-point plugin loader (how KubeCraft Pro adds its tools)
│ ├── licensing.py # Edition seam: reports Community edition; KubeCraft Pro adds trials + license keys
│ ├── observability.py # OpenTelemetry tracing + server stats
│ ├── k8s/
│ │ ├── client.py # Kubernetes API client wrapper
│ │ ├── formatters.py # Resource formatting utilities
│ │ ├── mermaid.py # Mermaid diagram generation
│ │ ├── metrics_backend.py # Prometheus/Loki query backend
│ │ ├── renderer.py # Shared colour palette for the Pillow renderers
│ │ ├── gpu_utils.py # GPU extended-resource detection helpers
│ │ ├── gpu_renderer.py # Pillow PNG dashboards for GPU allocation / metrics
│ │ └── logo_gen.py # Programmatic KubeCraft logo generator
│ └── tools/
│ ├── cluster.py # Cluster-level tools
│ ├── diagnostics.py # Pod diagnostics and logs
│ ├── gateway_api.py # Gateway API (HTTPRoute, GRPCRoute)
│ ├── gpu.py # GPU workloads, readiness, Prometheus, nvidia-smi
│ ├── helm.py # Helm releases + values (read-only)
│ ├── multicluster.py # Multi-cluster context management
│ ├── openshift.py # OpenShift-specific tools
│ ├── platform_posture.py # Storage, cert-manager, NetworkPolicy, endpoints
│ ├── policy_budgets.py # PodDisruptionBudget listing
│ ├── policy_engines.py # Kyverno / Gatekeeper policy summaries
│ ├── rbac_inspector.py # RBAC role/binding inspection
│ ├── operators.py # CRD & operator discovery (4 tools)
│ ├── network_advanced.py # IngressClasses, service mesh, CNI, CoreDNS, DNS lookup
│ ├── render.py # PNG rendering (mermaid.ink + Pillow GPU dashboards) + auto-open
│ ├── resources.py # Resource listing and describe
│ ├── storage_advanced.py # CSI drivers
│ ├── visualization.py # Mermaid text diagram tools
│ ├── workloads.py # DaemonSet, StatefulSet, CronJob/Job listing
│ ├── argocd.py # ArgoCD detection + app/project listing (CRD-based)
│ ├── flux.py # Flux CD integration (CRD-based)
│ └── tekton.py # Tekton CI/CD integration (CRD-based)
├── kubecraft_mcp/llm/ # Multi-provider LLM bridge (web mode)
│ ├── base.py # Provider ABC + streaming event types
│ ├── tool_bridge.py # MCP tool → Anthropic/OpenAI tool_use translation
│ ├── anthropic_provider.py # Claude (default) — drives the tool_use loop
│ ├── openai_provider.py # OpenAI function calling
│ └── azure_provider.py # Azure OpenAI (deployment-based)
├── kubecraft_mcp/web/ # FastAPI HTTP/SSE server bundled with the chat UI
│ ├── app.py # FastAPI factory + uvicorn entry point
│ ├── storage.py # SQLite (sessions, messages, audit, saved)
│ ├── tool_runner.py # Async wrapper that executes any registered MCP tool
│ ├── static.py # Serves the built UI from /app/ui/dist
│ ├── templates_data.py # Curated template library (159 prompts × 27 categories)
│ └── routes/
│ ├── chat.py # POST /api/v1/ask (SSE streaming + tool orchestration)
│ ├── sessions.py # Session CRUD
│ ├── config.py # /api/v1/config (provider, instance metadata)
│ ├── audit.py # /api/v1/audit (tool invocation log)
│ ├── saved.py # Saved questions + suggested-questions starter prompts
│ ├── templates.py # /api/v1/templates (curated library)
│ ├── files.py # /api/v1/files (download exported reports / artifacts)
│ └── kubecraft.py # /api/v1/contexts, /api/v1/license, /api/v1/tools
├── kubecraft_mcp/__main__.py # Dispatcher: stdio (default) | http (KUBECRAFT_MODE=http)
├── ui/ # React/TypeScript chat UI (Vite + Tailwind + Zustand)
│ ├── src/
│ │ ├── App.tsx # Routes: /chat, /templates, /saved, /history, /audit, /settings
│ │ ├── pages/ # ChatPage, TemplatesPage, SavedPage, HistoryPage, AuditPage, SettingsPage
│ │ ├── components/ # Header, MessageCard, MarkdownView (highlight.js), ToolInvocationCard, SuggestionsPicker, ContextPicker, CopyButton
│ │ ├── store/chat.ts # Zustand chat store with streaming reducers
│ │ └── lib/{api,stream,format,copy,icons}.ts(x)
│ ├── package.json
│ ├── vite.config.ts # Proxies /api/* → :8080 in dev
│ └── tailwind.config.js # KubeCraft brand palette
└── .cursor/
└── mcp.json # Cursor MCP configurationTroubleshooting
Windows: "Permission denied" on /output (diagrams not saved)
If you see warnings like Permission denied: '/output/index.html' in the MCP server logs, diagrams still work inline but the optional file-save to your host directory fails. This is a Docker Desktop volume-mount permissions issue.
Fix: Ensure the host directory exists before starting the container:
mkdir C:\Users\<user>\kubecraft-diagramsThen confirm your config maps it correctly:
"-v", "C:\\Users\\<user>\\kubecraft-diagrams:/output"If the error persists, check that Docker Desktop has file-sharing access to the drive (Settings → Resources → File sharing). Alternatively, use a named Docker volume:
"-v", "kubecraft-output:/output"Note: Diagrams are always returned inline via MCP regardless of whether the file-save succeeds. The file-save is a convenience for hosts like Claude Desktop that don't render MCP images natively.
Diagrams don't auto-open in browser
Auto-open uses webbrowser.open() which requires the container to reach the host display. Inside Docker, this only works with X11 forwarding or host networking on Linux. On Windows/macOS Docker Desktop, open the saved files from your host-mounted KUBECRAFT_OUTPUT_DIR directory instead, or use the dashboard at <KUBECRAFT_OUTPUT_DIR>/index.html (auto-refreshes every 5 seconds).
Kubernetes API server unreachable (connection refused)
If tools fail with errors like:
HTTPSConnectionPool(host='127.0.0.1', port=53842): Max retries exceeded ...
[Errno 111] Connection refused…the cause is that your kubeconfig points to a localhost endpoint on the host (typical for kind, k3d, minikube, or kubectl proxy), but inside the container 127.0.0.1 is the container's own loopback — which has nothing listening.
Diagnose first:
kubectl config view --minify -o jsonpath='{.clusters[0].cluster.server}'
# → e.g. https://127.0.0.1:53842 ← that's the smoking gunFix on Linux / WSL2 — use host networking:
docker run --rm --network=host -e KUBECRAFT_MODE=http -e KUBECRAFT_HTTP_HOST=127.0.0.1 ... kubecraft-mcp:latest--network=host shares the container's network namespace with the host so 127.0.0.1:53842 resolves correctly. Note: with --network=host you don't need -p 127.0.0.1:8080:8080 (and Docker will reject combining the two).
Fix on Docker Desktop (Windows / macOS) — --network=host is a no-op:
⚠️ TLS gotcha: kind/k3d/minikube apiserver certificates have SANs only for
127.0.0.1,localhost, andkubernetes. After rewriting the URL tohost.docker.internal, Python rejects the cert withSSL: CERTIFICATE_VERIFY_FAILED — Hostname mismatch. You must therefore also disable TLS verification in the container-only kubeconfig copy. This is acceptable for local dev because these certs are self-signed anyway — but never do it for production clusters.
Add the host-gateway alias when you
docker run:docker run --rm -p 127.0.0.1:8080:8080 --add-host=host.docker.internal:host-gateway ...Make a container-only kubeconfig copy that rewrites the URL and turns off TLS verification:
# On the host: sed -e 's|https://127\.0\.0\.1:|https://host.docker.internal:|' \ -e '/certificate-authority-data:/d' \ ~/.kube/config > ~/.kube/config.docker sed -i 's|^\(\s*\)server: https://host.docker.internal|\1insecure-skip-tls-verify: true\n\1server: https://host.docker.internal|' \ ~/.kube/config.dockerMount the rewritten file:
docker run --rm -p 127.0.0.1:8080:8080 --add-host=host.docker.internal:host-gateway \ -v ~/.kube/config.docker:/home/mcp/.kube/config:ro \ -e KUBECRAFT_MODE=http -e ANTHROPIC_API_KEY=... \ kubecraft-mcp:latest
💡 WSL2 users: skip this section. WSL2's Docker engine supports
--network=hostnatively — use the Linux fix above. You keep proper TLS verification and your kubeconfig stays untouched.
Fix for remote clusters (EKS / AKS / GKE / OpenShift):
These already have routable hostnames, so this issue only affects local clusters. If you see it against a remote cluster, check whether your kubeconfig has been overridden by a kubectl proxy session.
Requirements
Docker
A kubeconfig with access to your target cluster
Cursor, Claude Desktop, Claude Code, or any MCP-compatible AI assistant
License
The KubeCraft MCP Server Community Edition in this repository is open source under the MIT License — all 73 Community tools, no trial, no license key.
KubeCraft Pro is a separately licensed add-on from CloudCraft Labs that registers 67 additional tools (140 total). Pro includes a 30-day trial and commercial license keys; see cloudcraftlabs.io for details.
In the Community build,
get_license_inforeports the Community edition andregister_licenseexplains that registration applies to KubeCraft ProWith Pro installed, the same two tools manage the Pro trial and license
Available Tools
73 toolsargocd_detectDetect ArgoCDA
Detect whether ArgoCD is installed and report application/project counts and REST API config status.
Inputs: no named parameters.
argocd_list_appsList ArgoCD ApplicationsB
List ArgoCD Applications with sync status, health, source repo, revision, and target namespace.
Inputs: namespace.
argocd_list_projectsList ArgoCD ProjectsA
List ArgoCD AppProjects with allowed source repos, destination namespaces, and role count.
Inputs: no named parameters.
count_custom_resourcesCount Custom ResourcesA
Cluster-wide CR census: count instances of every CRD. Catches operator bloat — thousands of abandoned CronJobs, sprawling VirtualServices, stale ApplicationSets. Returns top N by count.
Inputs: group, top_n, min_count.
describe_crdDescribe a CRDA
Detail on a single CRD: full version list, conversion strategy, printer columns, subresources, validation summary, instance count per version, and risk flags (no schema, preserveUnknownFields, multi-version with no conversion webhook).
Inputs: name (required).
describe_resourceDescribe ResourceA
Return the full spec of a Kubernetes resource as YAML or JSON. Supported kinds: pod, service, deployment, replicaset, statefulset, daemonset, configmap, secret, ingress, namespace, node, persistentvolumeclaim.
Inputs: kind (required), name (required), output, namespace.
detect_cniDetect CNI PluginA
Detect the cluster CNI plugin from node annotations, known DaemonSets (Calico, Cilium, Flannel, AWS VPC CNI, Azure CNI, Weave, Antrea, etc.), and pod CIDRs.
Inputs: no named parameters.
detect_operatorsDetect OperatorsA
Detect operators running on the cluster by combining signals: known API groups, OLM ClusterServiceVersions, Deployment naming patterns (*-operator, *-controller, *-manager), and operator-style labels. Reports each operator's source, managed CRDs, ServiceAccount, deployment health.
Inputs: no named parameters.
detect_service_meshDetect Service MeshA
Detect installed service meshes (Istio, Linkerd, Cilium, Contour, Kuma, Consul Connect) by API groups. For Istio/Linkerd: shows namespace injection labels and sidecar container counts from a pod sample.
Inputs: no named parameters.
diagnose_corednsDiagnose CoreDNSA
Check CoreDNS deployment health: replica readiness, Corefile configuration (plugins, forwarding), kube-dns Service ClusterIP and endpoint count. Flags single-replica or degraded states.
Inputs: no named parameters.
diagnose_podDiagnose PodA
Comprehensive pod diagnosis: status, conditions, container states, events, and recent logs in one call.
Inputs: name (required), namespace.
dns_lookupDNS Lookup (cluster view)A
Resolve a hostname from inside the cluster by execing nslookup/getent/python in a running pod. Compares cluster-DNS view to external DNS to detect split-horizon issues.
Inputs: hostname (required), record_type.
flux_detectDetect Flux CDA
Detect whether Flux CD is installed and report source/kustomization/helmrelease counts.
Inputs: no named parameters.
flux_list_helmreleasesList Flux HelmReleasesB
List Flux HelmReleases with ready status, chart name, version, release name, and values summary.
Inputs: namespace.
flux_list_kustomizationsList Flux KustomizationsA
List Flux Kustomizations with ready status, source reference, path, and last applied revision.
Inputs: namespace.
flux_list_sourcesList Flux SourcesA
List Flux GitRepositories and HelmRepositories with ready status, URL, and artifact revision.
Inputs: namespace.
get_cluster_infoGet Cluster InfoA
Return cluster version, node count, API server URL, and overall health status.
Inputs: no named parameters.
get_eventsGet EventsB
Fetch recent Kubernetes events, optionally filtered by namespace, resource, or type.
Inputs: limit, namespace, event_type, resource_name.
get_gpu_promql_referenceGPU PromQL ReferenceA
Markdown reference for DCGM and common GPU-related PromQL examples (no live query). Pair with prometheus_query for execution.
Inputs: no named parameters.
get_license_infoLicense InformationA
Show current KubeCraft license status, type, expiry, hardware ID, email, and purchase/renewal instructions.
Inputs: no named parameters.
get_node_healthGet Node HealthA
Structured node conditions (Ready, memory/disk/PID/network pressure) with unhealthy nodes first and short remediation hints. Read-only.
Inputs: no named parameters.
get_pod_logsGet Pod LogsB
Fetch logs for a specific pod/container.
Inputs: name (required), previous, container, namespace, +1 more.
get_resource_usageGet Resource UsageA
Fetch CPU/memory usage for pods via the metrics API (requires metrics-server).
Inputs: namespace.
get_server_statsGet Server StatsA
Return KubeCraft MCP server stats: total calls, errors, average latency per tool, and uptime.
Inputs: no named parameters.
gpu_cluster_readinessGPU Cluster ReadinessC
Heuristic scan for GPU device plugins, GPU operator workloads, and GPU-related CRDs.
Inputs: no named parameters.
helm_get_valuesGet Helm Release ValuesB
Show user-supplied values for a specific Helm release.
Inputs: release (required), namespace.
helm_listList Helm ReleasesB
List Helm releases with status, chart, app version, and revision number.
Inputs: namespace, all_namespaces.
inspect_rbacInspect RBACA
Read-only RBAC review: heuristics for risky ClusterRole/Role rules (wildcards, escalate/bind/impersonate) and a sample of ClusterRoleBindings.
Inputs: namespace.
list_contextsList Kubeconfig ContextsA
List all kubeconfig contexts with cluster, user, namespace, and which is active.
Inputs: no named parameters.
list_crdsList CustomResourceDefinitionsA
Inventory every CRD with group, kind, scope, served versions, stored version, age, and an owner hint (Helm release / OLM CSV / known operator). Optional count_instances includes per-CRD instance counts (slower).
Inputs: group, count_instances.
list_cronjobsList CronJobsA
List CronJobs with schedule, suspend status, active job count, and last schedule time. Omit namespace for all namespaces. Read-only.
Inputs: namespace.
list_csi_driversList CSI DriversA
List installed CSI drivers with their capabilities (attach, capacity tracking, pod info, fsGroup policy) and per-node registration status from CSINode objects.
Inputs: no named parameters.
list_daemonsetsList DaemonSetsA
List DaemonSets with desired/ready/available/updated counts, node selector, and update strategy. Omit namespace for all namespaces. Read-only.
Inputs: namespace.
list_deploymentsList DeploymentsA
List deployments in a namespace with replica counts, strategy, and age.
Inputs: namespace.
list_gateway_apiList Gateway API ResourcesA
If gateway.networking.k8s.io is installed, list Gateways, HTTPRoutes, and GRPCRoutes. Omit namespace for all namespaces. Read-only.
Inputs: namespace.
list_gpu_workloadsList GPU WorkloadsA
List pods that request or limit GPU extended resources (e.g. nvidia.com/gpu) with node, phase, requests, and limits.
Inputs: namespace.
list_hpasList HPAsA
List HorizontalPodAutoscalers with scaling target, min/max/current replicas, metrics, and current utilization.
Inputs: namespace.
list_ingress_classesList Ingress ClassesA
List IngressClass resources with controller, default status, and parameter references. Identifies which IngressClass is the cluster default.
Inputs: no named parameters.
list_ingressesList IngressesA
List ingress resources in a namespace with hosts, paths, and TLS config.
Inputs: namespace.
list_jobsList JobsA
List Jobs with completion status, duration, and succeeded/failed counts. Omit namespace for all namespaces. Read-only.
Inputs: namespace.
list_namespacesList NamespacesA
List all namespaces with status, age, and labels.
Inputs: no named parameters.
list_nodesList NodesA
List cluster nodes with roles, status, capacity, and allocatable resources.
Inputs: no named parameters.
list_pod_disruption_budgetsList PodDisruptionBudgetsA
List PDBs with minAvailable/maxUnavailable and current vs desired healthy pods. Omit namespace for all namespaces. Read-only.
Inputs: namespace.
list_podsList PodsA
List pods in a namespace with status, restarts, age, and container images.
Inputs: namespace, label_selector.
list_resource_quotasList Resource QuotasB
List ResourceQuotas showing used vs hard limits, and LimitRanges showing min/max/default resource constraints per namespace.
Inputs: namespace.
list_resourcesList Resources (Generic)B
Generic resource lister — fetches any Kubernetes resource by kind and API version.
Inputs: kind (required), namespace, api_version.
list_servicesList ServicesA
List services in a namespace with type, cluster IP, ports, and selectors.
Inputs: namespace.
list_statefulsetsList StatefulSetsA
List StatefulSets with ready/updated/current counts, update strategy, and headless service name. Omit namespace for all namespaces. Read-only.
Inputs: namespace.
list_storage_overviewList Storage OverviewA
StorageClasses, PVCs, PVs, and VolumeAttachments with phase flags (Pending/Lost, Released/Unbound). Omit namespace to list PVCs in all namespaces. Read-only.
Inputs: namespace.
openshift_detectDetect OpenShift ClusterA
Detect whether the cluster is OpenShift and return OCP version, console URL, and registered OpenShift API groups. Works on any cluster.
Inputs: no named parameters.
openshift_list_buildsList OpenShift BuildConfigsA
List OpenShift BuildConfigs with build strategy, source type, git URI, and build count. Returns a compatibility notice on non-OpenShift clusters.
Inputs: namespace.
openshift_list_projectsList OpenShift ProjectsA
List OpenShift Projects with status, requester, and display name. Returns a compatibility notice on non-OpenShift clusters.
Inputs: no named parameters.
openshift_list_routesList OpenShift RoutesA
List OpenShift Routes with host, path, TLS termination, and target service. Returns a compatibility notice on non-OpenShift clusters.
Inputs: namespace.
register_licenseRegister LicenseA
Register or update your email address and optionally apply a new license key. Binds the license to the current machine's hardware fingerprint. Works even when the license is expired.
Inputs: email (required), license_key.
render_app_architectureRender App Architecture (PNG)A
Render the full KubeOrch-style app architecture as a PNG image. Shows Ingress → Service → Deployment → Pod plus ConfigMaps, Secrets, PVCs.
Inputs: namespace.
render_cluster_topologyRender Cluster Topology (PNG)A
Render the cluster topology diagram as a PNG image. Shows nodes, namespaces, and pod distribution as a visual image.
Inputs: no named parameters.
render_gpu_dashboardRender GPU Allocation Dashboard (PNG)A
Render a PNG dashboard of GPU extended resources per node (allocatable) vs sum of pod requests. Requires nodes with GPU resources or workloads requesting GPUs.
Inputs: no named parameters.
render_gpu_metricsRender GPU Utilization Chart (PNG)A
Render a PNG bar chart from Prometheus DCGM metric DCGM_FI_DEV_GPU_UTIL. Requires KUBECRAFT_PROMETHEUS_URL and DCGM exporter.
Inputs: no named parameters.
render_gpu_sparklineRender GPU Metrics Sparkline (PNG)A
PNG sparkline from a Prometheus range query (default DCGM_FI_DEV_GPU_UTIL, last hour). Requires KUBECRAFT_PROMETHEUS_URL.
Inputs: step, query, duration_seconds.
render_namespaceRender Namespace (PNG)A
Render a namespace diagram as a PNG image. Shows deployments, services, pods, and their connections.
Inputs: namespace.
render_networkRender Network Map (PNG)A
Render the service-to-pod network map as a PNG image. Shows how services route to backend pods via label selectors.
Inputs: namespace.
summarize_network_policiesSummarize NetworkPoliciesA
List NetworkPolicies with pod selector summary, ingress/egress rule counts, and a possible default-deny ingress heuristic. Omit namespace for all namespaces. Read-only.
Inputs: namespace.
summarize_policy_enginesSummarize Policy EnginesA
Read-only summary: Kyverno PolicyReports / ClusterPolicyReports and Gatekeeper constraint violation counts when those API groups exist.
Inputs: no named parameters.
switch_contextSwitch Kubeconfig ContextA
Switch the active kubeconfig context. All subsequent tool calls will use this cluster.
Inputs: context (required).
tekton_detectDetect TektonA
Detect whether Tekton is installed and report pipeline/task/run counts.
Inputs: no named parameters.
tekton_list_pipelinesList Tekton PipelinesB
List Tekton Pipelines with task count and last PipelineRun status.
Inputs: namespace.
tekton_list_runsList Tekton PipelineRunsA
List recent Tekton PipelineRuns with status, duration, start time, and task run count.
Inputs: limit, namespace.
tekton_list_tasksList Tekton TasksA
List Tekton Tasks with step count and parameter count.
Inputs: namespace.
visualize_app_architectureVisualize App ArchitectureA
Full KubeOrch-style architecture diagram showing ALL resource types in a namespace: Ingress → Service → Deployment → Pod, plus ConfigMaps, Secrets, PVCs, and how they wire together via selectors, env refs, and volume mounts.
Inputs: namespace.
visualize_cluster_topologyVisualize Cluster TopologyB
Generate a high-level Mermaid diagram of nodes, namespaces, and pod distribution across the cluster.
Inputs: no named parameters.
visualize_fluxVisualize Flux CD (Mermaid)A
Generate a Mermaid diagram of Flux sources flowing into Kustomizations and HelmReleases with ready status colors.
Inputs: namespace.
visualize_namespaceVisualize NamespaceA
Generate a Mermaid diagram showing deployments, services, and pods within a namespace and their connections via selectors.
Inputs: namespace.
visualize_networkVisualize NetworkB
Generate a Mermaid diagram mapping services to their backend pods via label selectors.
Inputs: namespace.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 73 tools
Most tools have distinct purposes, but there are pairs like render_app_architecture/visualize_app_architecture, render_namespace/visualize_namespace, render_network/visualize_network, and render_cluster_topology/visualize_cluster_topology that overlap significantly, causing potential confusion for an agent.
Tool names predominantly follow verb_noun pattern (e.g., list_pods, describe_crd, diagnose_pod). Some deviations include longer prefixes like argocd_list_apps or get_gpu_promql_reference, but overall the pattern is consistent.
73 tools is heavy but justifiable for a comprehensive Kubernetes diagnostics and visualization server. Some tools could be merged (e.g., render/visualize pairs), and a few are very niche (get_gpu_promql_reference), but the count remains within a reasonable range for the scope.
The tool set is comprehensive for observability and diagnostics: it covers list, describe, diagnose, detect, render, and visualize for a wide range of resources. However, it lacks CRUD operations, which is likely intentional for a read-only diagnostic server, leaving minor gaps in lifecycle management.
Related MCP Connectors
The Google GKE MCP server is a managed Model Context Protocol server that provides AI applications with tools to manage Google Kubernetes Engine (GKE) clusters and Kubernetes resources. It exposes a structured, discoverable interface that allows AI agents to interact with GKE and Kubernetes APIs, enabling them to inspect cluster configurations, retrieve Kubernetes resource YAMLs, monitor operations like cluster upgrades, diagnose issues, and optimize costs—all without needing to parse text output or use complex kubectl commands.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
MCP server that lets your AI assistant build and deploy apps, hosting each one at a live URL.
MCP server for building and testing AI agents with multi-model experimentation and insights.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceA Model Context Protocol server that enables AI assistants to interact with Kubernetes clusters through natural language, supporting core Kubernetes operations, monitoring, security, and diagnostics.169 npm972MIT
- FlicenseNot gradedqualityDmaintenanceA Model Control Protocol server that extends AI assistants with Kubernetes operations capabilities, allowing for managing deployments, pods, services and other K8s resources.2-
- AlicenseNot gradedqualityDmaintenanceAn MCP server that enables AI assistants to interact with Kubernetes clusters by translating natural language into kubectl and Helm operations. It allows users to query, manage, and diagnose Kubernetes resources and cluster states through a seamless integration.20Apache 2.0
- AlicenseNot gradedqualityDmaintenanceAn MCP server that lets AI assistants safely inspect and operate on Kubernetes clusters through natural conversation.13 PyPIMIT