About mcp-k8s
mcp-k8s is an MCP server for managing Kubernetes clusters and resources from Cursor IDE. It supports both stdio and SSE modes, along with switching between cluster contexts.
Key features
- 01Connect to and manage Kubernetes clusters
- 02View, cordon, uncordon, and restart nodes
- 03View and delete pods, retrieve logs
- 04Execute commands in pods
- 05Manage OpenKruise resources and ConfigMaps
- 06Switch between cluster contexts
Use cases
- 01Manage Kubernetes clusters from Cursor IDE
- 02Inspect pod logs and run commands in pods
- 03Change node status or restart nodes
- 04View or scale OpenKruise workloads
MCP support
The server exposes Kubernetes cluster and resource management tools to MCP clients over stdio or SSE.
Configuration
Remote servers need no local install. Pick your client, then copy the config or install in one click.
http://127.0.0.1:8686/sseclaude mcp add --transport http k8s-sse-server http://127.0.0.1:8686/sse{"mcpServers":{"k8s-sse-server":{"type":"http","url":"http://127.0.0.1:8686/sse"}}}Open in Cursor{"servers":{"k8s-sse-server":{"type":"http","url":"http://127.0.0.1:8686/sse"}}}Open in VS Code{"mcpServers":{"k8s-sse-server":{"type":"http","url":"http://127.0.0.1:8686/sse"}}}{"mcpServers":{"k8s-sse-server":{"serverUrl":"http://127.0.0.1:8686/sse"}}}Run commands in a terminal; paste JSON into the client’s MCP config and restart. Servers that need sign-in will prompt on first connect.
Tools
Details
From the project READMEmcp-k8s
Overview
mcp-k8s is a lightweight Kubernetes management tool providing sse and stdio mode for Kubernetes cluster management. It simplifies Kubernetes resources operation in cursor IDE.
Key Features
- Kubernetes cluster connection and management
- Kubernetes node management (view, cordon, uncordon, restart)
- Pod management (view, delete, log retrieval, command execution)
- OpenKruise resource management (view, describe, and scale CloneSets and AdvancedStatefulSets)
- ConfigMap management
- Multi-cluster context switching
Requirements
- Go 1.18+
- Kubernetes cluster
- Valid kubeconfig file
Build Instructions
In the project root directory, run:
go build -o k8s
Usage
The application supports two running modes:
- stdio mode: For command-line interaction
- SSE mode: Starts an HTTP server for API access
Start in SSE mode:
./k8s -mode=sse -address=:8686
Start in stdio mode:
./k8s -mode=stdio
Cursor mcp.json
{
"mcpServers": {
"k8s": {
"url": "http://127.0.0.1:8686/sse"
}
}
}
Project Structure
biz/: Business logic codeclientset/: Kubernetes client related codepod/: Pod operationsnode/: Node managementcontext/: Cluster context managementkruise/: OpenKruise resource managementconfigmap/: ConfigMap management
main.go: Application entry point
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.