k8s
MCP server for all of your needs in k8s ☸️
claude mcp add --transport stdio mayukhsobo-k8s-mcp-server docker run -i k8s-mcp-server-image
How to use
The Kubernetes MCP Server provides an interactive interface to manage Kubernetes resources and retrieve or format logs via the MCP protocol. It supports CRUD operations for common Kubernetes resource types (pods, services, namespaces, deployments, etc.), along with endpoints to fetch pod logs, search through logs, and export logs in multiple formats such as plaintext, JSON, CSV, and NDJSON. The server exposes a REST API that mirrors standard Kubernetes interactions, enabling you to create, list, read, and delete resources, as well as query and export logs for analysis or downstream processing. Once running, you can use the included endpoints to perform operations programmatically or build tooling around MCP to integrate Kubernetes data into your workflows.
How to install
Prerequisites:
- Docker (optional for containerized run) or a Go toolchain if building from source
- Access to a Kubernetes cluster with kubectl configured
Installation steps (containerized run):
- Ensure Docker is installed and running.
- Pull or build the MCP server image:
- If you have a prebuilt image: use the image name in the mcp_config (e.g., k8s-mcp-server-image).
- If you need to build locally, create a Dockerfile for the Go server and build the image.
- Run the MCP server (as per mcp_config):
Code block:
# Example: run the MCP server container (adjust image name as needed)
docker run -i k8s-mcp-server-image
Installation steps (from source):
- Install Go 1.24+ from the official Go website.
- Clone the repository and navigate into it:
git clone https://github.com/mayukhsarkar/k8s-mcp-server.git
cd k8s-mcp-server
- Build the binary:
go build -o k8s-mcp-server
- Run the server:
./k8s-mcp-server serve
If you prefer containerized deployment, you can adapt the Docker workflow to containerize the Go binary and run it as described in the first section.
Additional notes
Notes:
- This server requires Go 1.24+ and access to a Kubernetes cluster. Ensure kubectl is configured and can access your cluster.
- The API endpoints provide standard CRUD operations under /api/v1/resources/{resource_type} and log endpoints under /api/v1/logs. You can extend resource types per Kubernetes API compatibility.
- When exporting logs, ensure the client can handle the chosen format (plaintext, JSON, CSV, NDJSON).
- If running in Docker, remember to pass your kubeconfig or cluster credentials into the container if needed, depending on how you configure access (e.g., mounting ~/.kube or configuring in-cluster access).
- The MCP server image name in mcp_config should match the actual deployed image. Adjust resources, RBAC, and network policies as required for your environment.
Related MCP Servers
trpc-agent-go
trpc-agent-go is a powerful Go framework for building intelligent agent systems using large language models (LLMs) and tools.
station
Station is our open-source runtime that lets teams deploy agents on their own infrastructure with full control.
tiger-cli
Tiger CLI is the command-line interface for Tiger Cloud. It includes an MCP server for helping coding agents write production-level Postgres code.
gopls
MCP server for golang projects development: Expand AI Code Agent ability boundary to have a semantic understanding and determinisic information for golang projects.
kubernetes
A Model Context Protocol (MCP) server for the Kubernetes API.
gcp-cost
💰 An MCP server that enables AI assistants to estimate Google Cloud costs, powered by Cloud Billing Catalog API and built with Genkit for Go