Golang-based MCP server connecting to Kubernetes Features ⚙ Browse With Inspector ⚙ Use With Claude ⚙ Contributing ↗ ⚙ About MCP ↗ MCP 💬 prompt 🗂️ resource 🤖 tool - 🗂️🤖 List Kubernetes contexts - 💬🤖 List Kubernetes namespaces - 🤖 List, get, create and modify any Kubernetes resources - includes custom mappings for resources like pods, services, deployments - 🤖 List Kubernetes nodes - 💬 Li
Add this skill
npx mdskills install strowk/mcp-k8s-goComprehensive K8s MCP server with extensive tooling and excellent multi-platform installation options
1<h4 align="center">Golang-based MCP server connecting to Kubernetes</h4>23<h1 align="center">4 <img src="docs/images/logo.png" width="180"/>5 <br/>6 MCP K8S Go7</h1>89<p align="center">10 <a href="#features">Features</a> ⚙11 <a href="#browse-with-inspector">Browse With Inspector</a> ⚙12 <a href="#use-with-claude">Use With Claude</a> ⚙13 <a href="https://github.com/strowk/mcp-k8s-go/blob/main/CONTRIBUTING.md">Contributing ↗</a> ⚙14 <a href="https://modelcontextprotocol.io">About MCP ↗</a>15</p>1617<p align="center">18 <a href="https://github.com/strowk/mcp-k8s-go/actions/workflows/dependabot/dependabot-updates"><img src="https://github.com/strowk/mcp-k8s-go/actions/workflows/dependabot/dependabot-updates/badge.svg"></a>19 <a href="https://github.com/strowk/mcp-k8s-go/actions/workflows/test.yaml"><img src="https://github.com/strowk/mcp-k8s-go/actions/workflows/test.yaml/badge.svg"></a>20 <a href="https://github.com/strowk/mcp-k8s-go/actions/workflows/golangci-lint.yaml"><img src="https://github.com/strowk/mcp-k8s-go/actions/workflows/golangci-lint.yaml/badge.svg"/></a>21 <br/>22 <a href="https://github.com/strowk/mcp-k8s-go/releases/latest"><img src="https://img.shields.io/github/v/release/strowk/mcp-k8s-go?logo=github&color=22ff22" alt="latest release badge"></a>23 <a href="https://goreportcard.com/report/github.com/strowk/mcp-k8s-go"><img src="https://goreportcard.com/badge/github.com/strowk/mcp-k8s-go" alt="Go Reference"></a>24 <a href="https://github.com/strowk/mcp-k8s-go/blob/main/LICENSE"><img src="https://img.shields.io/github/license/strowk/mcp-k8s-go" alt="license badge"></a>25</p>2627## Features2829MCP 💬 prompt 🗂️ resource 🤖 tool3031- 🗂️🤖 List Kubernetes contexts32- 💬🤖 List Kubernetes namespaces33- 🤖 List, get, create and modify any Kubernetes resources34 - includes custom mappings for resources like pods, services, deployments35- 🤖 List Kubernetes nodes36- 💬 List Kubernetes pods37- 🤖 Get Kubernetes events38- 🤖 Get Kubernetes pod logs39- 🤖 Run command in Kubernetes pod4041## Browse With Inspector4243To use latest published version with Inspector you can run this:4445```bash46npx @modelcontextprotocol/inspector npx @strowk/mcp-k8s47```4849## Use With Claude5051<details><summary><b>52Demo Usage53</b></summary>5455Following chat with Claude Desktop demonstrates how it looks when selected particular context as a resource and then asked to check pod logs for errors in kube-system namespace:56575859</details>6061To use this MCP server with Claude Desktop (or any other client) you might need to choose which way of installation to use.6263You have multiple options:6465| | <a href="#using-smithery">Smithery</a> | <a href="#using-mcp-get">mcp-get</a> | <a href="#prebuilt-from-npm">Pre-built NPM</a> | <a href="#from-github-releases">Pre-built in Github</a> | <a href="#building-from-source">From sources</a> | <a href="#using-docker">Using Docker</a> |66| ------------ | -------------------------------------- | ------------------------------------ | ---------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------ | ---------------------------------------- |67| Claude Setup | Auto | Auto | Manual | Manual | Manual | Manual |68| Prerequisite | Node.js | Node.js | Node.js | None | Golang | Docker |6970### Using Smithery7172To install MCP K8S Go for Claude Desktop automatically via [Smithery](https://smithery.ai/server/@strowk/mcp-k8s):7374```bash75npx -y @smithery/cli install @strowk/mcp-k8s --client claude76```7778### Using mcp-get7980To install MCP K8S Go for Claude Desktop automatically via [mcp-get](https://mcp-get.com/packages/%40strowk%2Fmcp-k8s):8182```bash83npx @michaellatman/mcp-get@latest install @strowk/mcp-k8s84```8586### Manually with prebuilt binaries8788#### Prebuilt from npm8990Use this if you have npm installed and want to use pre-built binaries:9192```bash93npm install -g @strowk/mcp-k8s94```9596Then check version by running `mcp-k8s --version` and if this printed installed version, you can proceed to add configuration to `claude_desktop_config.json` file:9798```json99{100 "mcpServers": {101 "mcp_k8s": {102 "command": "mcp-k8s",103 "args": []104 }105 }106}107```108109, or using `npx` with any client:110111```bash112npx @strowk/mcp-k8s113```114115For example for Claude:116117```json118{119 "mcpServers": {120 "mcp_k8s": {121 "command": "npx",122 "args": [123 "@strowk/mcp-k8s"124 ]125 }126 }127}128```129130#### From GitHub releases131132Head to [GitHub releases](https://github.com/strowk/mcp-k8s-go/releases) and download the latest release for your platform.133134Unpack the archive, which would contain binary named `mcp-k8s-go`, put that binary somewhere in your PATH and then add the following configuration to the `claude_desktop_config.json` file:135136```json137{138 "mcpServers": {139 "mcp_k8s": {140 "command": "mcp-k8s-go",141 "args": []142 }143 }144}145```146147### Building from source148149You would need Golang installed to build this project:150151```bash152go get github.com/strowk/mcp-k8s-go153go install github.com/strowk/mcp-k8s-go154```155156, and then add the following configuration to the `claude_desktop_config.json` file:157158```json159{160 "mcpServers": {161 "mcp_k8s_go": {162 "command": "mcp-k8s-go",163 "args": []164 }165 }166}167```168169### Using Docker170171This server is built and published to Docker Hub since 0.3.1-beta.2 release with multi-arch images available for linux/amd64 and linux/arm64 architectures.172173You can use latest tag f.e like this:174175```bash176docker run -i -v ~/.kube/config:/home/nonroot/.kube/config --rm mcpk8s/server:latest177```178179Windows users might need to replace `~/.kube/config` with `//c/Users/<username>/.kube/config` at least in Git Bash.180181For Claude:182183```json184{185 "mcpServers": {186 "mcp_k8s_go": {187 "command": "docker",188 "args": [189 "run",190 "-i",191 "-v",192 "~/.kube/config:/home/nonroot/.kube/config",193 "--rm",194 "mcpk8s/server:latest"195 ]196 }197 }198}199```200201### Environment Variables and Command-line Options202203The following environment variables are used by the MCP server:204205- `KUBECONFIG`: Path to your Kubernetes configuration file (optional, defaults to ~/.kube/config)206207The following command-line options are supported:208209- `--allowed-contexts=<ctx1,ctx2,...>`: Comma-separated list of allowed Kubernetes contexts that users can access. If not specified, all contexts are allowed.210- `--readonly`: Disables any tool which can write changes to the cluster211- `--help`: Display help information212- `--version`: Display version information213- `--mask-secrets`: Mask secrets in the output (default: true). Use `--mask-secrets=false` to disable masking214215For example if you are configuring Claude Desktop, you can add the following configuration to `claude_desktop_config.json` file:216217```json218{219 "mcpServers": {220 "mcp_k8s": {221 "command": "mcp-k8s",222 "args": [223 "--allowed-contexts=dev,prod",224 "--readonly"225 ]226 }227 }228}229```230231, which would allow only `dev` and `prod` contexts to be used and would disable any tool which can write changes to the cluster.232233
Full transparency — inspect the skill content before installing.