# reza-gholizade/k8s-mcp-server [Health: Active]

**Category:** ☁️ Cloud Platforms  
**Repository:** https://github.com/reza-gholizade/k8s-mcp-server  
**GitHub Stars:** 191  
**Views:** 10  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/reza-gholizade-k8s-mcp-server

## Description
/🏠 - A Kubernetes Model Context Protocol (MCP) server that provides tools for interacting with Kubernetes clusters through a standardized interface, including API resource discovery, resource management, pod logs, metrics, and events.

## Claude Desktop Quick Installation
No generated config for this server: it installs through its own setup steps.

The project's own setup steps (from https://github.com/reza-gholizade/k8s-mcp-server), copied verbatim. Follow them in order; they are not an mcpServers config.

1. Install:

```sh
git clone https://github.com/reza-gholizade/k8s-mcp-server.git
```

2. Install:

```sh
cd k8s-mcp-server
```

3. Install:

```sh
go mod download
```

4. Install:

```sh
go build -o k8s-mcp-server .
```

5. Start the server:

```sh
./k8s-mcp-server --mode stdio
```

6. Start the server:

```sh
SERVER_MODE=stdio ./k8s-mcp-server
```

## Documentation

## What reza-gholizade/k8s-mcp-server does

reza-gholizade/k8s-mcp-server gives MCP-compatible clients access to Kubernetes cluster data and operations. Its Kubernetes tools can discover API resources, list objects with optional namespace and label filters, retrieve individual resources, and produce descriptions comparable to `kubectl describe`.

Operational inspection is also covered. Agents can retrieve pod logs, including logs for a selected container or all containers, query node resource usage, inspect CPU and memory metrics for pods, and list events for a namespace or a particular resource.

The server also supports resource changes from YAML or JSON manifests. It can create or update resources and delete resources using the supplied Kubernetes parameters. Helm-related tools include installing, upgrading, uninstalling, and rolling back releases, as well as adding Helm repositories; these operations are referenced by the server's read-only controls.

## How it works

The server uses the Model Context Protocol to expose Kubernetes operations as agent tools. It can communicate through standard input and output for local client integrations, Server-Sent Events for HTTP applications, or streamable HTTP at the `/mcp` endpoint. With no mode selected, it uses stdio.

Kubernetes authentication is selected automatically in this order: kubeconfig content from `KUBECONFIG_DATA`, a Kubernetes API URL and bearer token, an in-cluster service account, and finally a kubeconfig file. The file-based fallback uses `KUBECONFIG` or the default `~/.kube/config` location. Kubernetes permissions still come from the credentials or service account used by the process.

HTTP modes require a bearer token and bind to loopback by default. The unauthenticated `/healthz` endpoint is available for health checks. Browser access requires explicitly configured allowed origins.

## Setup and configuration

Building locally requires Go 1.23 or newer and access to a Kubernetes cluster. A typical build is:

```bash
git clone https://github.com/reza-gholizade/k8s-mcp-server.git
cd k8s-mcp-server
go mod download
go build -o k8s-mcp-server .
```

Start a local stdio server with:

```bash
./k8s-mcp-server --mode stdio
```

For SSE or streamable HTTP, set `MCP_AUTH_TOKEN` and optionally choose `SERVER_PORT`. HTTP listeners use port 8080 by default for streamable HTTP and can be moved with the port flag or environment variable. Set `SERVER_HOST=0.0.0.0` only when external network access is intentional, and include `Authorization: Bearer <token>` with every MCP request.

To reduce the risk of unintended changes, start with `--read-only`. This disables resource creation and updates plus Helm install, upgrade, uninstall, rollback, and repository-addition operations. Kubernetes and Helm tool groups can also be disabled with `--no-k8s` and the corresponding Helm-category flag.

## Tools and capabilities

- Discover API resources available in the connected cluster.
- List resources by type, namespace, and labels.
- Retrieve resource details and descriptive output.
- Read pod logs for selected or all containers.
- Query node and pod metrics.
- List namespace or resource-specific events.
- Create, update, and delete Kubernetes resources.
- Manage Helm releases and repositories.
- Run in stdio, SSE, or streamable-HTTP modes.

## Limitations and notes

The server's effective capabilities are constrained by Kubernetes RBAC permissions. A deployment example uses a service account with broad permissions, but production deployments should assign only the access required by the tools in use. Setting `KUBERNETES_INSECURE=true` skips TLS verification and is intended for cases where that risk is acceptable. The Docker deployment example runs the process as a non-root user.

A hosted deployment is available through Fronteir AI. Local deployments require Go and Kubernetes access, while in-cluster deployments can use the mounted service account credentials.

_Full upstream README: https://allmcps.com/mcp/reza-gholizade-k8s-mcp-server/readme_

