List available Kubernetes contexts from kubeconfig
List namespaces in the Kubernetes cluster
List Kubernetes resources of a specific type
Get details of a specific Kubernetes resource
List nodes in the Kubernetes cluster
List pods in a namespace
Get Kubernetes events
Get logs from a Kubernetes pod
Run a command in a Kubernetes pod
Kubernetes MCP is a Model Context Protocol server that provides AI assistants with the ability to interact with Kubernetes clusters. It enables models to list and manage resources, check pod logs, run commands in pods, and navigate between different Kubernetes contexts and namespaces. Built in Go for performance and reliability, this tool bridges the gap between natural language interfaces and Kubernetes operations, making cluster management more accessible through conversational AI. It supports a wide range of Kubernetes resources and operations, allowing AI assistants to help with cluster monitoring, troubleshooting, and management tasks.
Kubernetes MCP provides a bridge between AI assistants and Kubernetes clusters, allowing natural language interaction with your Kubernetes resources. This tool enables AI models to help you manage, monitor, and troubleshoot your Kubernetes environments through conversation.
The simplest way to install Kubernetes MCP is through NPM:
npm install -g @strowk/mcp-k8s
You can also download the pre-built binary from the GitHub releases page.
docker run -v ~/.kube:/home/nonroot/.kube strowk/mcp-k8s-go
Kubernetes MCP uses your existing kubeconfig file to connect to clusters. By default, it will use the configuration at ~/.kube/config
.
For security reasons, you may want to restrict which Kubernetes contexts the MCP can access. You can specify an allowlist using the --context-allowlist
flag:
mcp-k8s-go --context-allowlist=context1,context2
Once installed and configured, you can use Kubernetes MCP with compatible AI assistants like Claude. The MCP provides several capabilities:
To use with Claude Desktop or other Claude interfaces, you'll need to configure the MCP server in your Claude settings. See the Claude documentation for detailed instructions.
For testing or demonstration purposes, you can run the MCP with Inspector:
npx @modelcontextprotocol/inspector npx @strowk/mcp-k8s
When using Kubernetes MCP:
If you encounter issues: