Overview
What is Kubernetes MCP?
A Kubernetes-focused Model Context Protocol (MCP) server built in Go. It exposes Kubernetes operations as MCP tools and supports stdio, sse, and streamable transports, working with both local kubeconfig and in-cluster configuration.
How to use Kubernetes MCP?
Build the binary from source with Go 1.24+ (go build -o kubernetes-mcp ./cmd/kubernetes-mcp), then run it with one of three transport commands: server transport stdio, server transport sse, or server transport streamable, optionally specifying a kubeconfig path. For network transports, configure port, health port, allowed origins, and base URL via flags. Deploy in-cluster using manifest files under /deploy/kubernetes or run via Docker.
Key features of Kubernetes MCP
- Generic resource CRUD for any Kubernetes API group prefix.
- Core cluster utilities: list nodes, namespaces, get pod logs.
- Advanced tools: apply/validate/diff manifests, search resources.
- Prompt tools for YAML generation, querying, troubleshooting.
- Metrics tools to retrieve node/pod metrics and top consumers.
- Multiple transports (stdio, SSE, StreamableHTTP) with health endpoints.
Use cases of Kubernetes MCP
- AI assistants performing Kubernetes resource operations (list, get, create, update, delete).
- Automated cluster debugging: fetch pod logs, analyze events, troubleshoot nodes.
- Infrastructure as code workflows: apply, validate, diff manifests via MCP.
- Real-time cluster monitoring: retrieve resource metrics and top consumers.
- Integrated Kubernetes prompt-based help for YAML and troubleshooting queries.
FAQ from Kubernetes MCP
What transports does Kubernetes MCP support?
It supports stdio, sse, and streamable (StreamableHTTP). Each transport can be selected via the server transport subcommand.
What runtime and dependencies are required?
Go 1.24+ is needed to build from source. For operation, access to a Kubernetes cluster is required either via a local kubeconfig file or an in-cluster service account.
Does Kubernetes MCP support all Kubernetes API resources?
Yes, it provides generic resource operations (LIST, GET, CREATE, DELETE, etc.) for any API group prefix. Currently the K8S prefix is registered, and operations depend on cluster API availability and RBAC permissions.
Where is the data stored? Is authentication handled?
The server does not persist data; all operations are performed against the target