kubeaid-mcp
Exposes a Kubernetes cluster to MCP-compatible AI clients, providing tools for listing contexts, namespaces, pods, deployments, nodes, events, and more. Supports write operations (apply, patch, delete, scale, rollout) and exec commands when enabled.
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., "@kubeaid-mcp list pods in the default namespace"
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.
kubeaid-mcp
An MCP (Model Context Protocol) server that exposes a Kubernetes cluster to any
MCP-compatible AI client (Claude Code, Claude Desktop, Cursor, ...). The client
launches the server as a subprocess and talks to it over stdio (JSON-RPC 2.0);
the server translates tool calls into Kubernetes API calls via
@kubernetes/client-node.
Built in TypeScript on the NitroStack MCP framework.
See design.md for the architecture.
Demo

Related MCP server: MCP Remote Server for Kubernetes
Tools
Tool | Description |
| List the kubeconfig contexts (clusters) the server can target. |
| List namespaces in a cluster, with status. |
| List pods in a namespace (or all namespaces), with derived status, ready count, restarts and age. |
| Pod status, per-container state (waiting/termination reasons, last restart), and recent events. |
| Tail a container's logs; |
| List deployments with ready/up-to-date/available replica counts and age. |
| List cluster nodes with Ready status, roles, version and internal IP. |
| Recent events in a namespace (or all), sorted oldest to newest. |
| Fetch any resource kind (incl. CRDs) by kind/plural/short-name and name. |
Every tool accepts an optional context argument to target a specific
kubeconfig context. Omit it to use the server's default context.
Write tools (opt-in)
These are registered only when KUBEAID_ALLOW_WRITES=true. Each accepts an
optional dry_run to simulate the change server-side without persisting it.
Tool | Description |
| Create or update resources from a YAML/JSON manifest (server-side apply). |
| Patch an existing resource (strategic / merge / json). |
| Delete a resource by kind and name. |
| Set a deployment's replica count. |
| Rolling-restart a deployment/statefulset/daemonset. |
| Run a command inside a container (only with |
Prompts
Prompts are user-invoked workflow templates (surfaced as slash commands / menu items in the client). Unlike tools, a prompt does not touch the cluster — it returns a message that guides the model through a task using the tools above.
Prompt | Arguments | What it does |
|
| Walk through describe → logs to find why a pod is unhealthy and suggest a fix. |
|
| Find every unhealthy workload in a namespace and investigate each. |
|
| High-level health sweep: nodes, pods across all namespaces, recent warnings. |
|
| Review recent Warning events and explain what they mean. |
Installation
Requires Node.js 20+. Build the server once, then register it with your AI client(s).
1. Build the server
git clone https://github.com/1shubham7/kubeaid-mcp-ts.git
cd kubeaid-mcp-ts
npm install
npm run build # compiles TypeScript to dist/ (entry: dist/index.js)Note the absolute path to the entry point — the AI clients need it:
echo "$(pwd)/dist/index.js"For local iteration you can also run npm run dev (NitroStack's dev server with
hot reload), which is handy with NitroStudio as a
visual MCP client.
2. Register with Claude Code
claude mcp add kubeaid -- node "$(pwd)/dist/index.js"With no KUBEAID_CONTEXT set, the server follows your kubeconfig's
current-context live, so kubectl config use-context <name> switches the target
cluster without re-registering. Pin a fixed default by adding
-e KUBEAID_CONTEXT=kind-kubeaid if you'd rather it never move.
Read tools only are exposed by default. To enable the mutating tools
(apply/patch/delete/scale/rollout), pass -e KUBEAID_ALLOW_WRITES=true, and list
any production contexts as protected so they can never be written to:
claude mcp add kubeaid \
-e KUBEAID_ALLOW_WRITES=true \
-e KUBEAID_PROTECTED_CONTEXTS=prod-cluster,another-prod-cluster \
-- node "$(pwd)/dist/index.js"3. Register with Claude Desktop
Recent Claude Desktop builds gate local MCP servers behind a setting, so order matters:
Enable local MCP: Settings → Developer → Local MCP servers. Local stdio servers are off by default; opening/enabling this is required.
Edit the config: on that page click Edit Config — it opens the file the app actually reads (
~/.config/Claude/claude_desktop_config.jsonon Linux; macOS~/Library/Application Support/Claude/; Windows%APPDATA%\Claude\). Add a top-levelmcpServerskey, using the absolute path from step 1:{ "mcpServers": { "kubeaid": { "command": "node", "args": ["/home/you/kubeaid-mcp-ts/dist/index.js"] } } }If the file already has other keys (e.g.
preferences), keep them and addmcpServersalongside — don't overwrite the file.Fully quit and reopen Claude Desktop. Closing the window is not enough on Linux — the process must actually exit. The server then appears under Settings → Developer → Local MCP servers.
Enabling writes: add the options via an env block — e.g. make the local
cluster writable while protecting production:
{
"mcpServers": {
"kubeaid": {
"command": "node",
"args": ["/home/you/kubeaid-mcp-ts/dist/index.js"],
"env": {
"KUBEAID_CONTEXT": "kind-kubeaid",
"KUBEAID_ALLOW_WRITES": "true",
"KUBEAID_PROTECTED_CONTEXTS": "prod-cluster,another-prod-cluster"
}
}
}
}Add "KUBEAID_ALLOW_EXEC": "true" for the exec_command tool, and re-run
step 3 after changing the config.
Notes:
command/argsmust use absolute paths; GUI apps don't inherit your shellPATH, and Node needs the absolute path todist/index.js.Destructive tools carry a
destructiveHint, so Desktop still prompts you per action — the env vars control what's possible; the prompt is your confirmation.If your account is enterprise-managed, an admin policy can disable local MCP entirely, in which case no local config will load.
Safety
The server is read-only by default — the read tools only call non-mutating verbs (get, list, watch, log). Mutating tools exist but are gated:
KUBEAID_ALLOW_WRITES=truemust be set forapply_manifest,patch_resource,delete_resource,scale_deployment, androllout_restartto be exposed at all.KUBEAID_ALLOW_EXEC=true(in addition) is required forexec_command.KUBEAID_PROTECTED_CONTEXTSlists contexts that may never be written to or exec'd into, even with the flags above — put your production contexts here.Tools are annotated (
readOnlyHint/destructiveHint) so clients can prompt before risky actions.
The server authenticates with your kubeconfig credentials, so it can only do what your account is already permitted to do.
Configuration
All configuration is read from the environment at startup. An MCP client passes
these via the server entry's env block (Claude Desktop) or -e flags (Claude
Code). A local .env file also works for development — see
.env.example.
Variable | Default | Meaning |
|
| Path to the kubeconfig file. |
| follows kubeconfig current-context (live) | Pin a fixed default context. Omit it to track current-context live, so |
|
| Per-request timeout for Kubernetes API calls (e.g. |
|
| Expose the mutating tools (apply/patch/delete/scale/rollout). |
|
| Expose |
| none | Comma-separated contexts that may never be written to or exec'd into. |
Development
Drive the server by hand (no AI client needed) to inspect the raw protocol and confirm which tools are registered:
npm run build
KUBECONFIG=~/.kube/config node scripts/drive.mjs # initialize + tools/list + prompts/listAvailable Tools
9 toolsdescribe_podARead-only
Describe a pod: its status, per-container state (including waiting/termination reasons and last restart), and recent events. Use this to diagnose why a pod is not healthy.
Inputs: pod_name (required), namespace (required), context.
describe_resourceARead-only
Fetch any Kubernetes resource by kind and name, including custom resources (CRDs). Returns the resource object with noise (managedFields, last-applied annotation) stripped.
Inputs: kind (required), name (required), context, namespace, +1 more.
get_eventsARead-only
List recent events in a namespace (or across all namespaces if omitted), sorted oldest to newest. Warning-type events surface cluster problems.
Inputs: context, namespace.
get_pod_logsARead-only
Fetch the tail of a pod's container logs. Set previous=true to read logs from a crashed container's prior instance.
Inputs: pod_name (required), namespace (required), lines, context, +2 more.
list_contextsARead-only
List the kubeconfig contexts (clusters) this server can target. The one marked isDefault is used when a tool call omits the context parameter.
Inputs: no named parameters.
list_deploymentsARead-only
List deployments in a namespace (or across all namespaces if omitted), with ready/up-to-date/available replica counts and age.
Inputs: context, namespace.
list_namespacesARead-only
List all namespaces in the Kubernetes cluster, with their status.
Inputs: context.
list_nodesARead-only
List cluster nodes with Ready status, roles, age, kubelet version and internal IP.
Inputs: context.
list_podsARead-only
List pods in a namespace (or across all namespaces if omitted), with derived status, ready count, restarts and age.
Inputs: context, namespace.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 9 tools
Every tool targets a distinct Kubernetes resource or action (e.g., describe_pod vs describe_resource, list_pods vs list_deployments), with no overlapping purposes.
All tools follow a consistent verb_noun pattern with lowercase and underscores (e.g., list_pods, get_events, describe_resource), making them predictable and easy to differentiate.
With 9 tools, the surface is lean yet comprehensive for a diagnostic Kubernetes MCP server, covering essential inspection operations without unnecessary bloat.
The tool set covers core diagnostic workflows—listing, describing, logs, events—but misses operational actions like exec, port-forward, or resource creation. Minor gap given the diagnostic focus.
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.
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
Talk to your public-facing AI from any MCP client — Claude, ChatGPT, Cursor, Cline, Windsurf.
MCP server that lets AI assistants use all OneSchema features exposed via the public API.
Related MCP Servers
- AlicenseAqualityAmaintenanceProvides a set of read-only Kubernetes functions via an MCP server, enabling interaction with Kubernetes clusters through agents or coding assistants like GitHub Copilot.213Apache 2.0
- AlicenseNot gradedqualityDmaintenanceProvides Kubernetes cluster management capabilities through natural language via MCP protocol over HTTP/SSE. Supports Pod, Service, Deployment operations, log retrieval, and resource management with JWT authentication and RBAC permissions.1MIT
- 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.19Apache 2.0
- FlicenseNot gradedqualityDmaintenanceExposes Kubernetes cluster state with specialized telecom awareness of 5G Core network functions and topologies to MCP-compatible LLMs. It enables natural language analysis of 5G workloads, network slices, UPF data planes, and cluster health.-