mcp-kubernetes
Allows MCP clients to inspect and operate Kubernetes clusters, with tools for listing contexts, namespaces, pods, deployments, services, nodes, and events, fetching pod logs, scaling and restarting deployments, setting deployment images, creating namespaces, applying manifests, deleting resources, and executing commands in pods, governed by configurable access modes and security flags.
Click on "Install 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., "@mcp-kuberneteslist pods in the staging context for the web 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.
mcp-kubernetes
A Model Context Protocol server for Kubernetes. It lets an MCP-capable client (Claude Desktop, Claude Code, etc.) inspect and operate Kubernetes clusters across multiple contexts — with behaviour controlled entirely by flags.
The design goal is safe by default: it starts read-only, can be scoped to an allowlist of namespaces and contexts, protects system namespaces from mutation, and gates the dangerous operations (delete, apply, exec) behind explicit opt-ins.
Features
Multi-cluster — every tool accepts an optional
context; scope which contexts are usable with an allowlist.Access modes —
read-only→read-write→admin, layered so a mode never exposes tools above its level.Security flags — namespace allowlist, protected namespaces, context allowlist, plus independent opt-ins for delete / apply / exec, dry-run, and JSON audit logging (see below).
Standard auth — uses your kube-config (or in-cluster service account). No credentials are stored by the server.
Related MCP server: k8s-mcp-go
Security model
Concern | Flag | Default | Effect |
What can the server do at all? |
|
|
|
Which namespaces are in scope? |
| (all) | When set, any operation on a namespace outside the list is refused. |
Which namespaces are read-only forever? |
|
| Can be read but never mutated or deleted, regardless of mode. |
Which clusters are reachable? |
| (all) | When set, only these kube-config contexts may be targeted. |
Can it delete? |
|
|
|
Can it apply manifests? |
|
|
|
Can it exec into pods? |
|
|
|
Preview without touching the cluster |
|
| Write/admin tools validate + log intent, then return without calling the API. |
Audit trail |
|
| Emits a JSON line to stderr per guarded operation ( |
The layers are independent — e.g. admin mode with all three opt-ins false can restart and scale deployments but can neither delete resources nor exec into pods.
Tools
Read (read-only+): list_contexts, list_namespaces, list_pods, get_pod, get_pod_logs, list_deployments, list_services, list_nodes, list_events, get_resource
Write (read-write+): scale_deployment, restart_deployment, set_deployment_image, create_namespace, apply_manifest (needs K8S_ALLOW_APPLY)
Admin (admin): delete_resource (needs K8S_ALLOW_DELETE), exec_in_pod (needs K8S_ALLOW_EXEC)
Use with your MCP client
Works with Claude Code, Claude Desktop, Cursor, OpenAI Codex CLI, Windsurf, VS Code (Copilot), and any other MCP client — see docs/CLIENTS.md for per-client setup.
Install
npm install
npm run buildRun with Claude Desktop / Claude Code
Add to your MCP client configuration:
{
"mcpServers": {
"kubernetes": {
"command": "node",
"args": ["/absolute/path/to/mcp-kubernetes/dist/index.js"],
"env": {
"KUBECONFIG_PATH": "/Users/you/.kube/config",
"K8S_MODE": "read-only",
"K8S_CONTEXT_ALLOWLIST": "staging",
"K8S_NAMESPACE_ALLOWLIST": "app,web"
}
}
}
}Bump K8S_MODE to read-write for scaling/restarts, and to admin (plus the relevant K8S_ALLOW_* flag) only when you intend to allow deletes or exec.
Develop
npm run dev # watch mode
npm test # unit tests for the security policy
npm run typecheckPublishing
This server ships a server.json for the official MCP registry and an mcpName for npm ownership validation. See PUBLISHING.md for publishing to npm and listing on the MCP registry, Smithery, Glama, Cursor, and PulseMCP.
License
MIT
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceAn MCP server that enables interaction with multiple Kubernetes clusters simultaneously, providing comprehensive tools for cluster management, resource operations, and diagnostics across different environments.
- AlicenseNot gradedqualityAmaintenanceSafe, read-only-by-default Kubernetes access for AI agents via MCP. Provides explicit readonly, readwrite, and dangerous permission modes, plus MCPB bundles for desktop clients.2MIT
- FlicenseNot gradedqualityDmaintenanceEnables Kubernetes cluster introspection via MCP tools, such as listing pods, namespaces, nodes, and events.4
- AlicenseNot gradedqualityCmaintenanceAn MCP server for generating Kubernetes manifests (deployments, services, configmaps, secrets, ingresses, namespaces) and performing kubectl operations like apply, delete, get, describe, logs, and exec.MIT
Related MCP Connectors
Managed Keycloak from any MCP client: clusters, realms, apps, SSO, users, domains, audit events.
Remote MCP for A2A caller identity, scope policy, verdict receipts, and audit history.
Remote MCP for Copilot CLI switch gate MCP, structured receipts, audit logs, and reviewer-ready evid
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/dockndevai/mcp-kubernetes'
If you have feedback or need assistance with the MCP directory API, please join our Discord server