Cloud & InfrastructureFreeactiveReviewed by MCPIndex

Kubernetes MCP Server

MCP server for complete Kubernetes and OpenShift cluster management via AI including pods, deployments, services, and logs.

Looking for more MCP servers? Browse the full MCP tools directory or explore more tools in Cloud & Infrastructure.

Reviewed by MCPIndex

MCPIndex assessment

Kubernetes MCP converts the most credential-sensitive system in your infrastructure into an agent surface — which makes it simultaneously the highest-value and highest-consequence server in this directory. The read-only ServiceAccount plus dedicated kubeconfig pattern is not a recommendation, it is the entry fee. Deployed with discipline, it compresses incident triage from thirty minutes of terminal archaeology into one reasoning pass. Deployed casually, it gives a language model delete rights to your production workloads. There is no third option.

Quick overview

Your kubeconfig is not a config file — it is a master key that happens to be YAML, and Kubernetes MCP hands that key to a probabilistic system. Everything about deploying this server follows from that sentence. The capability is genuinely transformative: an agent that can list pods, stream logs, read events, and describe deployments turns incident response from a ten-terminal kubectl ballet into a single reasoning pass — why is checkout 502ing becomes list pods, notice the CrashLoopBackOff, pull previous-container logs, read the OOMKill event, and correlate with the memory limit in the deployment spec, all before a human finishes VPN-ing in. The architectural reality the README buries: the server authenticates with whatever kubeconfig context is active, which means the agent's effective permissions are whatever cluster-admin credentials you last used for debugging — and kubectl delete is just a tool call away from a misunderstood prompt. The only sane deployment posture borrows from least-privilege doctrine: a dedicated ServiceAccount with a read-only ClusterRole, a kubeconfig that can touch nothing else, and a context name that does not lie to you. Deployed that way, this server is the best SRE assistant money cannot buy. Deployed with your admin kubeconfig, it is a resume-generating event with a natural-language interface.

Best for

The teams and workflows that benefit most from this tool.

CrashLoopBackOff and 502 incident triage

Cluster health summaries and event correlation

Log retrieval from current and previous containers

Read-only auditing of deployments, quotas, and limits

What this MCP server is best for

  • Monitoring pods, deployments, services, and namespaces through Kubernetes MCP Server when you need quick visibility into a live Kubernetes cluster.
  • Useful for debugging failed rollouts, CrashLoopBackOff errors, image pull failures, unhealthy services, and resource limit issues without jumping between kubectl commands.
  • Best for platform and DevOps teams that want faster incident response, cluster inspection, and day-to-day operational troubleshooting from an AI assistant.

When to choose it

Choose Kubernetes MCP Server when you want an MCP server focused on Cloud & Infrastructure and need tighter integration with your existing tools.

Good fit

kubernetesk8sopenshiftdevopscloudinfrastructure

Limitations

Things to watch before choosing this tool.

Inherits kubeconfig context — wrong-cluster reads return plausible, wrong data

Managed-cluster tokens expire mid-session without exec plugins in env

RBAC denials can surface as empty lists instead of errors

Any write capability must be removed at the RBAC layer, not the prompt layer

Kubernetes MCP Server Configuration

Use the following configuration as a starting point for Claude Desktop or any compatible MCP client, then replace placeholder credentials with your own values.

claude_desktop_config.json
{
  "mcpServers": {
    "kubernetes": {
      "command": "npx",
      "args": ["-y", "kubernetes-mcp-server@latest"],
      "env": {
        "KUBECONFIG": "/Users/you/.kube/mcp-readonly-config"
      }
    }
  }
}

How to set up Kubernetes MCP Server

These setup steps cover the typical installation flow for this MCP server.

  1. 1

    Create a dedicated ServiceAccount in the target cluster and bind it to a read-only ClusterRole (get, list, watch on pods, deployments, services, events, logs) — this is your blast-radius ceiling.

  2. 2

    Generate a separate kubeconfig file (e.g. ~/.kube/mcp-readonly-config) containing ONLY the token for that ServiceAccount and the intended cluster — never point the server at your daily-driver kubeconfig.

  3. 3

    Pro-Tip: The fatal flaw 90% of developers commit is letting the server inherit their default kubeconfig, where current-context silently points at whatever cluster they touched last — often production. The agent then inspects or mutates prod while every prompt says staging, and nothing warns anyone because the credentials are valid. Fix it at the file layer: a single-purpose kubeconfig with one cluster, one context, one read-only identity. If the file cannot reach prod, neither can a hallucination.

  4. 4

    Pass the dedicated file explicitly via the KUBECONFIG env var in your client config — do not rely on the default ~/.kube/config resolution.

  5. 5

    Add a ResourceQuota and LimitRange audit before connecting: the agent can read them, and they are usually the actual answer to why will my pod not schedule.

  6. 6

    Verify with: List pods in the default namespace and flag any that are not Running. A correct setup returns live pod phases in seconds.

Compatibility

Supported environments for Kubernetes MCP Server.

Claude Desktop

Yes

Cursor

Yes

VS Code

Yes

Authenticates via kubeconfig — deploy ONLY with a dedicated read-only ServiceAccount kubeconfig. Verify active context at the start of every session.

Frequently asked questions

Common questions for Kubernetes MCP Server.

The agent reports a namespace as completely empty — but kubectl shows twenty pods, and no error appears anywhere. Why?

The silent failure of context confusion. The server resolved a different cluster context than the one you are mentally holding — your kubeconfig current-context points at staging (or a dead kind cluster from last month), the credentials authenticate perfectly, and the cluster truthfully reports an empty namespace. Nothing errors because nothing is wrong from the API's perspective; you are simply interrogating the wrong cluster with total confidence. The engineering fix: at session start, have the agent read and report the active context and cluster server URL before any resource query — treat context verification as step zero of every incident workflow. If the empty-namespace symptom appears, wrong context is the diagnosis nine times out of ten, and the tenth is RBAC silently filtering list results.

Can it stream logs from crashed containers?

Yes — including previous-container logs via the previous flag, which is the single most valuable capability for CrashLoopBackOff diagnosis: the current container has no logs because it never lived, and the truth always sits in the previous instance.

How do I let it troubleshoot without letting it delete anything?

RBAC, not prompting. Bind the ServiceAccount to a role with only get, list, watch verbs — the API server then rejects delete and patch calls with 403s the agent cannot talk its way around. A prompt saying do not delete anything is a suggestion; a missing RBAC verb is a wall.

Does it work with managed clusters (EKS, GKE, AKS)?

Yes, with one friction point: managed clusters use short-lived exec-plugin credentials (aws eks get-token, gke-gcloud-auth-plugin). The binary for that plugin must exist in the MCP server process environment, or authentication fails when the cached token expires mid-session.

Kubernetes MCP Server vs Competitors

FeatureKubernetes MCP ServerCompetitor
Incident diagnosis flow Pods, events, and previous-container logs in one reasoning pass Copy-pasting kubectl output into a chat window, one command at a time
Live resource introspection Direct API access to current cluster state Prompt-based tools reason over stale pasted snapshots
Cross-resource correlation Agent joins events, logs, and specs dynamically Human assembles the correlation manually
Credential lifetime handling Depends on exec-plugin binaries in the process env Interactive kubectl sessions re-auth transparently
GitOps workflow depth Live-cluster view only — no drift or PR workflows Flux and Argo CD own the desired-state story

Related Guides