k8s-mcp-server

MCP.Pizza Chef: reza-gholizade

Twenty-two tools in all: nine read-only Kubernetes views covering resources, descriptions, pod logs, node and pod usage, events and ingresses; four that create, update, restart or delete resources; and nine Helm tools for listing, installing, upgrading, rolling back and removing releases. A real read-only switch exists and simply never loads the changing tools. There is no key to buy, because it reuses whatever cluster access you already have on your machine.

Coding
Data

Use This MCP server To

Read the logs from a pod that keeps restarting See which events fired in a namespace today Check how much memory a node is using Roll back a Helm release that went wrong Restart a deployment without opening a terminal Explore a cluster safely in read-only mode

README

Kubernetes MCP Server

A Kubernetes Model Context Protocol (MCP) server that provides tools for interacting with Kubernetes clusters through a standardized interface.

Hosted deployment

A hosted deployment is available on Fronteir AI.

Features

  • API Resource Discovery: Get all available API resources in your Kubernetes cluster.
  • Resource Listing: List resources of any type with optional namespace and label filtering.
  • Resource Details: Get detailed information about specific Kubernetes resources.
  • Resource Description: Get comprehensive descriptions of Kubernetes resources, similar to kubectl describe.
  • Pod Logs: Retrieve logs from specific pods (optionally from a specific container, or all containers if unspecified).
  • Node Metrics: Get resource usage metrics for specific nodes.
  • Pod Metrics: Get CPU and Memory metrics for specific pods.
  • Event Listing: List events within a namespace or for a specific resource.
  • Resource Creation/Updating: Create new Kubernetes resources or update existing ones from a YAML or JSON manifest.
  • Resource Deletion: It deletes a resource in the Kubernetes cluster based on the provided namespace and kind.
  • Standardized Interface: Uses the MCP protocol for consistent tool interaction.
  • Flexible Configuration: Supports different Kubernetes contexts and resource scopes.
  • Multiple Modes: Run in stdio mode for CLI tools, sse mode, or streamable-http mode for web applications, and --readonly for no change in the cluster.
  • Security: Runs as non-root user in Docker containers for enhanced security.

Prerequisites

  • Go 1.23 or later
  • Access to a Kubernetes cluster
  • kubectl configured with appropriate cluster access

Installation

  1. Clone the repository:

    git clone https://github.com/reza-gholizade/k8s-mcp-server.git
    cd k8s-mcp-server
  2. Install dependencies:

    go mod download
  3. Build the server:

    go build -o k8s-mcp-server main.go

k8s-mcp-server FAQ

Does it need a paid key or account?
No. It reuses the cluster credentials you already have: your kubeconfig file, a cluster token, or the identity it runs under when deployed inside the cluster.
Can it change or delete things in my cluster?
Yes. It can create, update, restart and delete resources, and install, upgrade, roll back or remove Helm releases. Nothing asks you to confirm first.
Is there a safe look-but-don't-touch mode?
Yes, and it genuinely works, because the changing tools are never loaded at all. The flag is --read-only; the feature summary at the top of the instructions misspells it as --readonly, which will not start.
How hard is setup?
Developer level. You either build it from source with Go or run the published container image, then give it access to your cluster.
Can I use this to investigate a broken deployment?
Yes, this is where it shines. Pull the pod logs, list recent events, describe the resource, and check node and pod usage, all in one conversation.
Which apps does it work in?
Anything that runs a local server command or talks to a web address. Install scripts for VS Code are included, and a third party offers a hosted version.
How many tools are there really?
Twenty-two. The written tool list stops at twenty and quietly leaves out two Helm repository tools.