mcpField
M
mcp-k8s

mcp-k8s

Remote
github.com/beastpuCloud & Infra0Updated 77w ago
Repository

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

  1. 01Connect to and manage Kubernetes clusters
  2. 02View, cordon, uncordon, and restart nodes
  3. 03View and delete pods, retrieve logs
  4. 04Execute commands in pods
  5. 05Manage OpenKruise resources and ConfigMaps
  6. 06Switch between cluster contexts

Use cases

  1. 01Manage Kubernetes clusters from Cursor IDE
  2. 02Inspect pod logs and run commands in pods
  3. 03Change node status or restart nodes
  4. 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.

Endpointhttp://127.0.0.1:8686/sse
Copy install command
Claude CodeTerminal
Cursor.cursor/mcp.json
VS Code.vscode/mcp.json
Claude Desktopclaude_desktop_config.json
Windsurf~/.codeium/windsurf/mcp_config.json

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 README

mcp-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 code
    • clientset/: Kubernetes client related code
    • pod/: Pod operations
    • node/: Node management
    • context/: Cluster context management
    • kruise/: OpenKruise resource management
    • configmap/: ConfigMap management
  • main.go: Application entry point

Comments

Markdown supported

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.