SuperAPI AI Directory

mcp-k8s-go

mcp-k8s-go is an MCP server that connects to Kubernetes, developed by strowk and hosted on GitHub. It allows users to interact with a Kubernetes cluster through the MCP protocol, providing three types of functionality: prompts, resources, and tools. Users can use natural language or clients (such as Claude Desktop) to list contexts, namespaces, nodes, Pods, etc., and perform operations such as getting events, viewing logs, running commands, and creating and modifying resources. The tool supports multiple installation methods: automatic installation via Smithery or mcp-get, using precompiled binaries from npm, npx, downloading GitHub releases, building from source, or using Docker images. Its core features include browsing Kubernetes resources, managing contexts and namespaces, operating Pods and Services, getting events and logs, executing commands in Pods, etc. During configuration, the configuration file path can be specified via the KUBECONFIG environment variable, and command-line options are supported, such as restricting accessible contexts (--allowed-contexts), read-only mode (--readonly), and hiding sensitive information (--mask-secrets). This server is suitable for developers and operations personnel who need to integrate AI assistants with Kubernetes clusters, and can simplify cluster operations and monitoring.

Open website

About this tool

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:

  1. Automatic installation via Smithery
  2. Automatic installation via mcp-get
  3. Install precompiled binaries using npm, or run via npx
  4. Download the binary file for the corresponding platform from GitHub Releases
  5. Build from source (requires Golang)
  6. 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.