Get the FREE Ultimate OpenClaw Setup Guide →

kubernetes

Model Context Protocol (MCP) server for Kubernetes and OpenShift

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
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):

  1. Ensure Node.js and npm are installed on your machine.
  2. 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
  3. 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].
  4. 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

Sponsor this space

Reach thousands of developers