Sign inSign up

mcpk8s/server

By mcpk8s

•Updated 11 months ago

MCP server connecting AI to Kubernetes

Image
Machine learning & AI
Developer tools
0

7.7K

mcpk8s/server repository overview

Golang-based MCP server connecting to Kubernetes


MCP K8S Go

MCP K8S Go Sources⁠ ⚙ Model Context Protocol⁠ ⚙ Kubernetes⁠

latest release badeg npm downloads badge license badge

⁠Features

  • 🗂️ resource: K8S contexts from kubeconfig file
  • 🤖 tool: list-k8s-contexts
  • 🤖 tool: list-k8s-namespaces
  • 🤖 tool: list-k8s-nodes
  • 🤖 tool: list-k8s-resources
    • includes custom mappings for resources like pods, services, deployments
  • 🤖 tool: get-k8s-resource
  • 🤖 tool: list-k8s-events
  • 🤖 tool: get-k8s-pod-logs
  • 🤖 tool: k8s-pod-exec would run command in specified pod
  • 💬 prompt: list-k8s-namespaces
  • 💬 prompt: list-k8s-pods

⁠Browse With Inspector

To use latest published version with Inspector you can run this:

npx @modelcontextprotocol/inspector docker run -i -v ~/.kube/config:/home/nonroot/.kube/config --rm mcpk8s/server:latest

⁠Use With Claude

Demo Usage

Following chat with Claude Desktop demonstrates how it looks when selected particular context as a resource and then asked to check pod logs for errors in kube-system namespace:

successful pods and logs retrieval by Claude
You can configure Claude in `claude_desktop_config.json` file:
{
  "mcpServers": {
    "mcp_k8s": {
      "command": "docker",
      "args": ["run", "-i", "-v", "~/.kube/config:/home/nonroot/.kube/config", "--rm", "mcpk8s/server:latest"]
    }
  }
}
⁠Environment Variables and Command-line Options

The following environment variables are used by the MCP server:

  • KUBECONFIG: Path to your Kubernetes configuration file (optional, defaults to ~/.kube/config)

The following command-line options are supported:

  • --allowed-contexts=<ctx1,ctx2,...>: Comma-separated list of allowed Kubernetes contexts that users can access. If not specified, all contexts are allowed.
  • --help: Display help information
  • --version: Display version information

Tag summary

Content type

Image

Digest

sha256:c683bbd89…

Size

12.8 MB

Last updated

11 months ago

docker pull mcpk8s/server