kubernetes
Model Context Protocol (MCP) server for Kubernetes and OpenShift
claude mcp add --transport stdio containers-kubernetes-mcp-server npx -y kubernetes-mcp-server@latest
How to use
Kubernetes MCP Server provides a native Go-based MCP implementation that interfaces directly with the Kubernetes API to manage Kubernetes and OpenShift resources via the MCP protocol. It supports generic resource CRUD operations, pod-specific actions (listing, getting, deleting, viewing logs, top metrics, executing commands, and running containers in pods), namespace and events viewing, OpenShift project listing, Helm chart operations (install, list, uninstall), and optional observability with OpenTelemetry. You can run the server using your preferred package manager (via npx for quick start) or deploy as a binary in your environment. Once running, you can configure mcpServers in Claude Desktop, VS Code, Cursor, or Goose CLI to point at the Kubernetes MCP server so your tools can interact with Kubernetes through MCP rather than direct kubectl commands.
How to install
Prerequisites:
- Access to a Kubernetes cluster (or an OpenShift cluster for OpenShift-specific features)
- Node.js and npm installed (for npx-based usage) or a prebuilt binary if you prefer a direct executable
- Optional: Docker or container runtime if you plan to run via container images
Installation steps (npx-based quick start):
- Ensure Node.js and npm are installed on your machine.
- Run the MCP server via npx (no global install required): npm i -g kubernetes-mcp-server 2>/dev/null || true npx -y kubernetes-mcp-server@latest
- If you are configuring through Claude Desktop or VS Code, use the provided example configurations to add the Kubernetes MCP server as an mcpServer entry with command npx and args [-y, kubernetes-mcp-server@latest].
- Verify the server starts and is reachable via its MCP endpoints (see documentation for /openapi or /stats if enabled).
If you prefer to run a container or a Python/PyPI-based setup, check the repository for alternative install methods such as docker run or pip/Python packaging as described in the docs.
Additional notes
Notes and tips:
- This MCP server is a native Go implementation and does not require kubectl or helm to be present on the host when using the native binary distribution.
- When using npx, the latest version of kubernetes-mcp-server is pulled at startup; pin to a version (e.g., kubernetes-mcp-server@latest) if you want stable behavior.
- You can enable observability via OpenTelemetry and access the /stats endpoint for real-time metrics; configure env vars (e.g., OTELEXPORTER) as needed per the docs.
- The server supports multi-cluster operations as defined in your kubeconfig, including in-cluster configurations.
- If you encounter permission or RBAC issues, ensure the service account or user has appropriate permissions to perform the MCP operations against the Kubernetes API server.
- For production deployments, consider deploying the server as a container and configuring proper security (RBAC, NLB/Ingress, TLS) and resource limits.
Related MCP Servers
mcp-proxy
An MCP proxy server that aggregates and serves multiple MCP resource servers through a single HTTP server.
mcp-k8s-go
MCP server connecting to Kubernetes
droidmind
Control your Android devices with AI using Model Context Protocol
mcp-auth-proxy
MCP Auth Proxy is a secure OAuth 2.1 authentication proxy for Model Context Protocol (MCP) servers
podman
Model Context Protocol (MCP) server for container runtimes (Podman and Docker)
mcp-file-context
A Model Context Protocol (MCP) server that provides file system context to Large Language Models (LLMs). This server enables LLMs to read, search, and analyze code files with advanced caching and real-time file watching capabilities.