MCP Server that can connect to a Kubernetes cluster running on Docker Desktop and manage it.
- Docker Desktop with Kubernetes enabled
- Install Claude Desktop
- Install Bun on your Macbook
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
..
...
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 Settings > Developer > Edit Config
{
"mcpServers": {
"kubernetes": {
"command": "npx",
"args": ["mcp-server-kubernetes"]
}
}
}
The server will automatically connect to your current kubectl context. Make sure you have:
- kubectl installed and in your PATH
- A valid kubeconfig file with contexts configured
- Access to a Kubernetes cluster configured for kubectl (e.g. minikube, Rancher Desktop, GKE, etc.)
Open Claude Desktop > Click on "Hammer" sign and see if it detects your Kubernetes configuration.
- 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