mcp-k8s-go is an MCP (Model Context Protocol) server used to connect to Kubernetes clusters. It allows AI assistants (such as Claude) to interact with Kubernetes through the MCP protocol and perform common cluster operations.
Main Capabilities
The server provides three types of MCP functionality: prompts, resources, and tools. Specifically, these include:
- List Kubernetes contexts (resources and tools)
- List namespaces (prompts and tools)
- List, get, create, and modify arbitrary Kubernetes resources, including custom mappings for Pods, Services, Deployments, etc.
- List Kubernetes nodes
- List Kubernetes Pods (prompts)
- Get Kubernetes events
- Get Pod logs
- Run commands in Pods
Usage
Users can use this server through MCP-compatible clients (such as Claude Desktop). There are multiple installation methods:
- Automatic installation via Smithery
- Automatic installation via mcp-get
- Install precompiled binaries using npm, or run via npx
- Download the binary file for the corresponding platform from GitHub Releases
- Build from source (requires Golang)
- Use multi-architecture images on Docker Hub (published since 0.3.1-beta.2, supporting linux/amd64 and linux/arm64)
During configuration, the server can be added to the client's configuration file (such as claude_desktop_config.json).
Configuration Options
- Environment variable KUBECONFIG: specifies the Kubernetes configuration file path, defaulting to ~/.kube/config.
- Command-line options:
- --allowed-contexts=<ctx1,ctx2,...>: the list of contexts allowed to be accessed; if not specified, all are allowed.
- --readonly: disables any tools that can write to the cluster.
- --help: displays help information.
- --version: displays version information.
- --mask-secrets: whether to hide sensitive information in the output, defaulting to true; can be disabled with --mask-secrets=false.
Applicable Scenarios
Suitable for developers and operations personnel who need to integrate AI assistants with Kubernetes clusters, for simplifying cluster operations, monitoring, and troubleshooting.
Limitations
There is currently no other limitation information. When using it, ensure that Kubernetes access permissions are properly configured. Windows users in Git Bash may need to replace ~/.kube/config with //c/Users/<username>/.kube/config.