# mcp-k8s-go

> MCP Server

This repository provides a Golang-based MCP server that connects to Kubernetes, offering tools to list contexts, namespaces, nodes, and resources within a specified context and namespace, including custom mappings.

## Overview

- **Category:** System Tools
- **Language:** Go
- **Stars:** 386
- **Forks:** 16
- **Owner:** strowk
- **GitHub:** https://github.com/strowk/mcp-k8s-go
- **Created:** 2024-12-01T07:00:54+00:00
- **Updated:** 2025-03-28T22:37:32+00:00
- **Source:** https://model-context-protocol.com/servers/kubernetes-mcp-server-golang-resource-management

## Setup

## Setup
To use this MCP server with Claude Desktop, you have several options for installation:

**Using Smithery:**
```bash
npx -y @smithery/cli install @strowk/mcp-k8s --client claude
```

**Using mcp-get:**
```bash
npx @michaellatman/mcp-get@latest install @strowk/mcp-k8s
```

**Manually with prebuilt binaries:**

**Prebuilt from npm:**
```bash
npm install -g @strowk/mcp-k8s
```
Then add the following configuration to `claude_desktop_config.json` file:
```json
{
  "mcpServers": {
    "mcp_k8s": {
      "command": "mcp-k8s",
      "args": []
    }
  }
}
```

**From GitHub releases:**
Download the latest release, unpack the archive, put the binary `mcp-k8s-go` in your PATH, and add the following configuration to the `claude_desktop_config.json` file:
```json
{
  "mcpServers": {
    "mcp_k8s": {
      "command": "mcp-k8s-go",
      "args": []
    }
  }
}
```

**Building from source:**
```bash
go get github.com/strowk/mcp-k8s-go
go install github.com/strowk/mcp-k8s-go
```
Then add the following configuration to the `claude_desktop_config.json` file:
```json
{
  "mcpServers": {
    "mcp_k8s_go": {
      "command": "mcp-k8s-go",
      "args": []
    }
  }
}
```

## Tools

## Available Tools

1.  resource: K8S contexts as read from kubeconfig configurations
2.  tool: list-k8s-contexts
3.  tool: list-k8s-namespaces in a given context
4.  tool: list-k8s-nodes in a given context
5.  tool: list-k8s-resources in a given context and namespace for specified resource kind (includes custom mappings for resources like pods, services, deployments)
6.  tool: get-k8s-resource in a given context and namespace for specified name and resource kind
7.  tool: list-k8s-events in a given context and namespace
8.  tool: get-k8s-pod-logs in a given context and namespace for specified pod
9.  prompt: list-k8s-namespaces in a given context
10. prompt: list-k8s-pods in current context and with given namespace
