The `mcp-server-kubernetes` package provides an executable Model Context Protocol (MCP) server designed to facilitate interaction with Kubernetes clusters. It leverages the local `kubectl` installation and `kubeconfig` files to perform operations such as managing pods, deployments, and other Kubernetes resources. The current stable version is 3.5.0, with the project demonstrating an active development cadence through frequent minor and patch releases, as seen with recent updates like 3.4.0 and 3.3.0. A key differentiator is its deep integration into the Claude ecosystem, offering streamlined setup for Claude Code and Claude Desktop through dedicated commands and `.mcpb` extensions. It supports various `kubeconfig` loading strategies, provides an `X-MCP-AUTH` header for basic authentication in streaming server contexts, and includes advanced features like OpenTelemetry distributed tracing support since v3.3.0. This server acts as a crucial bridge for AI agents and developer tools that need programmatic access to Kubernetes management capabilities via the MCP standard, abstracting the complexities of direct `kubectl` interaction.
npm install mcp-server-kubernetesVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to install the MCP Kubernetes server globally, run it directly, and integrate it with Claude Code for local development.
Verify `kubectl` and `helm` installations with `kubectl version` and `helm version`. Ensure `~/.kube/config` is correctly configured or provide a custom path via environment variables (see `ADVANCED_README.md`).
Upgrade to v3.4.0 or newer to benefit from the `kubectl_reconnect` command and associated bug fixes that address stale connections.
Set the `X_MCP_AUTH_TOKEN` environment variable with your desired token before starting the server. Clients must then include `X-MCP-AUTH: <your_token>` in their requests.
Interact with the server by running its command-line executable (`npx mcp-server-kubernetes`) or through an MCP client that manages its process.
Install `kubectl` according to official Kubernetes documentation for your operating system and ensure its executable path is included in your system's PATH.
Ensure you have a valid `kubeconfig` file (default: `~/.kube/config`) and that it contains at least one accessible context. Verify connection with `kubectl get pods` manually. For advanced options, refer to `ADVANCED_README.md` for custom paths or environment variables.
Ensure the client includes an `X-MCP-AUTH` header with the correct token that matches the `X_MCP_AUTH_TOKEN` environment variable set on the server.