mcp-k8s-go

by @strowk

K8s Go MCP Server

Inspect and manage Kubernetes clusters from Claude Desktop or any stdio MCP client via a native Go server covering contexts, namespaces, pods, logs, events, resource CRUD, and in-pod commands. MIT-licensed, mcp-k8s-go ships via npm, GitHub binaries, go install, or Docker with --readonly and --mask-secrets.

Server facts

mcp-k8s-go

GitHub stars

383

Last commit

Nov 18, 2026

Runtime

go

License

MIT

Tech

Runtime
go
Transports
stdio
Remote access
No
Authentication
Kubernetes kubeconfig (KUBECONFIG / ~/.kube/config)

Activity

GitHub stars
383
Last commit
Data as of

Tags

  • Kubernetes
  • mcp
  • server

Overview

Platform engineers searching for `k8s go mcp` can connect Claude Desktop and other `stdio` MCP clients straight to Kubernetes clusters using `strowk/mcp-k8s-go` (Golang, MIT license), continuously integration-tested from Kubernetes v1.34.13 up to v1.37.2 (including releases v1.35.10 and v1.36.6). Installation adapts to your environment: run prebuilt binaries through npm (`npx @strowk/mcp-k8s` or global npm install), download standalone `mcp-k8s-go` binaries from GitHub Releases with no runtime prerequisite, compile from source with `go install`, or pull multi-arch Docker Hub images (`mcpk8s/server:latest` for `linux/amd64` and `linux/arm64`) with your local kubeconfig mounted into the container's nonroot home directory. Authentication reads `KUBECONFIG` (defaulting to `~/.kube/config`), and interactive browsing works directly with the MCP Inspector CLI.

Combining MCP prompts, resources, and tools, the server lists contexts and namespaces, lists pods and cluster nodes, inspects Kubernetes events and pod logs, runs commands inside pods, and lists, gets, creates, or modifies arbitrary Kubernetes resources (including custom mappings for deployments, services, and pods). Built-in safety flags guard production clusters: `--allowed-contexts=<ctx1,ctx2>` restricts accessible contexts, `--readonly` disables every mutating tool, and `--mask-secrets` defaults to `true` so secret values stay redacted unless explicitly turned off (`--mask-secrets=false`).

Install & configure

Requirements

  • Valid Kubernetes `KUBECONFIG` (defaults to `~/.kube/config`) with cluster access
  • Distribution choice: Node.js (`npx @strowk/mcp-k8s`), standalone GitHub binary (`mcp-k8s-go`), Go (`go install`), or Docker (`mcpk8s/server:latest`)
  • Optional safety flags (`--allowed-contexts=...`, `--readonly`, `--mask-secrets=true` default)
Documented launch / install command
npx @strowk/mcp-k8s

Add `mcp_k8s` to `claude_desktop_config.json` running `npx @strowk/mcp-k8s` (or installed `mcp-k8s` / `mcp-k8s-go` binary with `["--allowed-contexts=dev,prod", "--readonly"]`). For Docker, run `docker run -i -v ~/.kube/config:/home/nonroot/.kube/config --rm mcpk8s/server:latest` (adjusting Windows Git Bash volume paths as `//c/Users/<username>/.kube/config`).

Config file · macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

Windows: %APPDATA%\Claude\claude_desktop_config.json

Use Settings → Developer → Edit Config when available. Do not assume a Linux configuration path; check the client documentation for your platform. Remote servers use the app’s connector flow when supported, not the local stdio file shown here. Merge this example with existing settings; do not overwrite unrelated servers.

Claude Desktop configuration
{
  "mcpServers": {
    "mcp_k8s": {
      "command": "npx",
      "args": [
        "@strowk/mcp-k8s"
      ]
    }
  }
}

Read the Claude Desktop setup guide

Config file · Project: .cursor/mcp.json

User: ~/.cursor/mcp.json

The project path is relative to the workspace root. The tilde denotes your user home directory. Use Cursor’s MCP settings to confirm which configuration and scope your installed version is reading. Merge this example with existing settings; do not overwrite unrelated servers.

Cursor configuration
{
  "mcpServers": {
    "mcp_k8s": {
      "command": "npx",
      "args": [
        "@strowk/mcp-k8s"
      ]
    }
  }
}

Read the Cursor setup guide

Config file · Workspace: .vscode/mcp.json

For user scope, use the “MCP: Open User Configuration” command if available. Do not guess a user configuration path across operating systems, profiles, containers, or remote workspaces; check the client documentation. Merge this example with existing settings; do not overwrite unrelated servers.

VS Code configuration
{
  "servers": {
    "mcp_k8s": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "@strowk/mcp-k8s"
      ]
    }
  }
}

Read the VS Code setup guide

Config file · macOS/Linux: ~/.codeium/windsurf/mcp_config.json

Windows: %USERPROFILE%\.codeium\windsurf\mcp_config.json

Open the MCP configuration through Windsurf’s settings when possible to confirm the active file. Paths can differ in managed or future releases; check the client documentation if this location is not present. Merge this example with existing settings; do not overwrite unrelated servers.

Windsurf configuration
{
  "mcpServers": {
    "mcp_k8s": {
      "command": "npx",
      "args": [
        "@strowk/mcp-k8s"
      ]
    }
  }
}

Read the Windsurf setup guide

Config file · Project scope: .mcp.json at the repository root

The project file uses mcpServers. For user scope, use claude mcp add --scope user rather than assuming .mcp.json in your home directory is the user configuration. Check the client documentation for managed settings and storage details. Merge this example with existing settings; do not overwrite unrelated servers.

Claude Code configuration
{
  "mcpServers": {
    "mcp_k8s": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "@strowk/mcp-k8s"
      ]
    }
  }
}

Read the Claude Code setup guide

Examples are translated from the published configuration. Supply your own credentials and verify requirements in the upstream README. Remote connectors are shown only where a supported configuration format is known.

Use cases

  • Select a specific Kubernetes context as an MCP resource in Claude Desktop and inspect `kube-system` pod logs and cluster events for errors.
  • Lock down cluster diagnostics in production by combining `--allowed-contexts=dev,prod`, `--readonly`, and default-on `--mask-secrets`.
  • List, inspect, create, or modify Kubernetes pods, services, deployments, and arbitrary resources or run commands inside pods during incident triage.
  • Deploy a multi-arch (`linux/amd64`, `linux/arm64`) container or single compiled Go binary without requiring Python or Node.js runtimes on operator workstations.

Strengths

  • Ships as prebuilt npm wrapper (`@strowk/mcp-k8s`), standalone GitHub Release binaries, Go source install, and multi-arch `linux/amd64`/`linux/arm64` Docker images.
  • Built-in cluster safety controls: `--readonly` blocks write tools, `--allowed-contexts` scopes cluster access, and `--mask-secrets` redacts secrets by default.
  • Covers contexts, namespaces, nodes, pods, logs, events, pod command execution, and arbitrary resource CRUD across MCP prompts, resources, and tools.
  • Actively integration-tested against Kubernetes v1.34.13, v1.35.10, v1.36.6, and v1.37.2.

Limitations

  • If `--allowed-contexts` is omitted, every context present in `KUBECONFIG` is accessible by default.
  • The root README lists high-level MCP features rather than documenting exact individual tool names and parameter schemas.
  • Windows Docker setups using Git Bash may require rewriting `~/.kube/config` mounts to `//c/Users/<username>/.kube/config`.

mcp-k8s-go setup notes

  • mcp-k8s-go's stdio example needs a client that launches local processes.

Frequently asked questions

Run the prebuilt npm package by adding `mcp_k8s` under `mcpServers` in `claude_desktop_config.json` with `command: "npx"` and `args: ["@strowk/mcp-k8s"]` (or install globally via `npm install -g @strowk/mcp-k8s` and invoke `mcp-k8s`). You can also use a standalone `mcp-k8s-go` GitHub Release binary, `go install github.com/strowk/mcp-k8s-go`, or Docker (`mcpk8s/server:latest`) mounting `~/.kube/config`.

Related MCP servers