mcp-kubernetes
A Model Context Protocol (MCP) server that enables AI assistants to interact with Kubernetes clusters. It serves as a bridge between AI tools (like Claude, Cursor, and GitHub Copilot) and Kubernetes, translating natural language requests into Kubernetes operations and returning the results in a format the AI tools can understand.
claude mcp add --transport stdio feiskyer-mcp-kubernetes-server docker run -i --rm --mount type=bind,src=/home/username/.kube/config,dst=/home/mcp/.kube/config ghcr.io/feiskyer/mcp-kubernetes-server
How to use
The mcp-kubernetes-server acts as a bridge between AI assistants that support the Model Context Protocol (MCP) and your Kubernetes cluster. It translates natural language requests into kubectl commands or Kubernetes API calls, executes them against your cluster, and returns structured results that can be consumed by your AI assistant. With this server, you can ask questions about resource status, fetch resource details, and perform read-only or write operations depending on your configuration and the capabilities you enable.
To use it, configure the MCP server in your AI client (as shown in the Docker example in the README). Once started, you can issue natural language prompts such as asking for the status of a deployment, listing pods in a namespace, or diagnosing issues with a pod. The server exposes tools for both read operations (k8s_get, k8s_describe, k8s_logs, k8s_events) and command execution (kubectl, helm). Depending on your transport (stdio, sse, or streamable-http), the AI client will manage the connection and handle responses from the server.
How to install
Prerequisites:
- A working Kubernetes cluster
- A kubeconfig file configured to access your cluster
- kubectl in your PATH
- helm in your PATH
- Python 3.11 or newer for direct uvx usage (optional)
Option 1: Docker (recommended if you want a quick start)
- Ensure Docker is installed and running.
- Place your kubeconfig at the path referenced in the docker command (adjust /home/username/.kube/config as needed).
- Run the server using the example configuration:
# Ensure environment is ready, then start the container with your kubeconfig bind-mount
Option 2: UVX (Python/uv) (requires Python 3.11+ and uv)
- Install uv if it's not installed:
curl -LsSf https://astral.sh/uv/install.sh | sh
- Install kubectl and helm if not already installed (as described in prerequisites).
- Run the server with uvx using the provided command:
uvx mcp-kubernetes-server
Option 3: Kubernetes cluster prerequisites (for both methods)
- Ensure kubeconfig is available and points to the correct cluster/context
- Ensure kubectl can access the cluster (kubectl get nodes should work)
- Optionally install Helm if you plan to manage charts via the server
Configuration example (Docker):
{
"mcpServers": {
"kubernetes": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"--mount", "type=bind,src=/home/username/.kube/config,dst=/home/mcp/.kube/config",
"ghcr.io/feiskyer/mcp-kubernetes-server"
]
}
}
}
Additional notes
- The KUBECONFIG environment variable can be used to specify your kubeconfig path if you prefer not to bind-mount the file.
- For Docker setups, ensure the kubeconfig path used in the mount matches your actual kubeconfig location.
- The server supports multiple tools (kubectl, helm, and various k8s read tools). You can adjust permissions to allow or restrict write/delete capabilities using the server’s options.
- If you encounter transport-related connection issues, verify your MCP client is configured to use stdio, SSE, or streamable-http as appropriate for your setup.
- Common debugging tips: check that kubectl works from the host, ensure the container has network access to the cluster API server, and verify that the container’s mounted kubeconfig has the correct permissions.
Related MCP Servers
mcp -qdrant
An official Qdrant Model Context Protocol (MCP) server implementation
mcp-pinecone
Model Context Protocol server to allow for reading and writing from Pinecone. Rudimentary RAG
mcp-rquest
A MCP server providing realistic browser-like HTTP request capabilities with accurate TLS/JA3/JA4 fingerprints for bypassing anti-bot measures. It also supports converting PDF and HTML documents to Markdown for easier processing by LLMs.
pfsense
pfSense MCP Server enables security administrators to manage their pfSense firewalls using natural language through AI assistants like Claude Desktop. Simply ask "Show me blocked IPs" or "Run a PCI compliance check" instead of navigating complex interfaces. Supports REST/XML-RPC/SSH connections, and includes built-in complian
davinci -professional
An enterprise-grade MCP server that exposes the full functionality of DaVinci Resolve and DaVinci Resolve Studio (through version 20) to either Claude Desktop or Cursor MCP clients. Fully configured and tested as a Claude Desktop Extension making installation as easy as clicking a button. Supports both Windows and Macintosh.
mcp man
a cli/mcp server tool for managing mcp server json config file with version control, profiles and multi-client support