8000 GitHub - ajeetraina/mcp-kubernetes-docker-desktop: MCP Server for kubernetes management commands
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

ajeetraina/mcp-kubernetes-docker-desktop

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Managing Kubernetes cluster running on Docker Desktop using Model Context Protocol (MCP)

MCP Server that can connect to a Kubernetes cluster running on Docker Desktop and manage it.

Prerequisite

  • Docker Desktop with Kubernetes enabled
  • Install Claude Desktop
  • Install Bun on your Macbook

Install Bun

curl -fsSL https://bun.sh/install | bash

Ensure that bun CLI is accessible:

bun --help
Bun is a fast JavaScript runtime, package manager, bundler, and test runner. (1.2.0+b0c5a7655)

Usage: bun <command> [...flags] [...args]

Commands:
  run       ./my-script.ts       Execute a file with Bun
            lint                 Run a package.json script
  test                           Run unit tests with Bun
  x         eslint               Execute a package binary (CLI), installing if needed (bunx)
  repl                           Start a REPL session with Bun
  exec                           Run a shell script directly with Bun

  install                        Install dependencies for a package.json (bun i)
  add       @shumai/shumai       Add a dependency to package.json (bun a)
  remove    is-array             Remove a dependency from package.json (bun rm)
  update    hono                 Update outdated dependencies
  outdated                       Display latest versions of outdated dependencies
  link      [<package>]          Register or link a local npm package
  unlink                         Unregister a local 
..
...

Install and Run Bun:

Bun is a fast JavaScript runtime, package manager, bundler, and test runner.

The bun install command is Bun's equivalent of npm install or yarn install. It manages dependencies for your project.

bun install
bun install v1.2.0 (b0c5a765)

+ @types/node@22.10.1
+ shx@0.3.4
+ typescript@5.7.2
+ vitest@2.1.8
+ @kubernetes/client-node@0.20.0
+ @modelcontextprotocol/sdk@1.0.1
+ zod@3.23.8

159 packages installed [2.72s]

Open Claude Desktop

Open Settings > Developer > Edit Config

Usage with Claude Desktop

{
  "mcpServers": {
    "kubernetes": {
      "command": "npx",
      "args": ["mcp-server-kubernetes"]
    }
  }
}

The server will automatically connect to your current kubectl context. Make sure you have:

  1. kubectl installed and in your PATH
  2. A valid kubeconfig file with contexts configured
  3. Access to a Kubernetes cluster configured for kubectl (e.g. minikube, Rancher Desktop, GKE, etc.)
image image

Accessing Claude Desktop

Open Claude Desktop > Click on "Hammer" sign and see if it detects your Kubernetes configuration.

image image

List of Kubernetes Available Tools

image

Prompt: Can you list out number of nodes in the Kubernetes cluster

image

Prompt: Can you list out all the services and deployments in the kubernetes cluster

image

Features

  • Connect to a Kubernetes cluster
  • List all pods
  • List all services
  • List all deployments
  • Create a pod
  • Delete a pod
  • List all namespaces
  • Port forward to a pod
  • Get logs from a pod for debugging
  • Choose namespace for next commands (memory)
  • Support Helm for installing charts

About

MCP Server for kubernetes management commands

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
3297

Languages

  • JavaScript 67.7%
  • TypeScript 30.5%
  • Dockerfile 1.8%
0