mcp-k8s logo

mcp-k8s

by beastpu

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.

View on GitHub

Last updated: N/A

What is mcp-k8s?

mcp-k8s is a lightweight Kubernetes management tool that simplifies Kubernetes resource operation, especially within the Cursor IDE, by providing both SSE and stdio modes for cluster management.

How to use mcp-k8s?

To use mcp-k8s, first build the application using go build -o k8s. Then, you can run it in either stdio mode (for command-line interaction using ./k8s -mode=stdio) or SSE mode (starting an HTTP server for API access using ./k8s -mode=sse -address=:8686). Configure your Cursor IDE with the provided mcp.json snippet, pointing to the SSE server URL.

Key features of mcp-k8s

  • 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

Use cases of mcp-k8s

  • Managing Kubernetes clusters from within the Cursor IDE

  • Quickly viewing and managing Kubernetes nodes and pods

  • Retrieving pod logs and executing commands within pods

  • Managing OpenKruise resources like CloneSets and AdvancedStatefulSets

  • Managing ConfigMaps

  • Switching between multiple Kubernetes cluster contexts

FAQ from mcp-k8s

What are the requirements to run mcp-k8s?

You need Go 1.18+, a Kubernetes cluster, and a valid kubeconfig file.

How do I build the application?

Run go build -o k8s in the project root directory.

What are the different running modes?

The application supports stdio mode for command-line interaction and SSE mode for API access.

How do I start the application in SSE mode?

Run ./k8s -mode=sse -address=:8686.

How do I start the application in stdio mode?

Run ./k8s -mode=stdio.