MCP-K8S is a Kubernetes MCP (Model Control Protocol) server that enables interaction with Kubernetes clusters through natural language. It allows you to manage Kubernetes resources and Helm charts using plain language commands instead of memorizing complex kubectl syntax.
You can download the latest binary directly from the GitHub releases page:
# Download from https://github.com/silenceper/mcp-k8s/releases
# Choose the appropriate binary for your platform
Install directly using Go:
go install github.com/silenceper/mcp-k8s/cmd/mcp-k8s@latest
Clone the repository and build the binary:
git clone https://github.com/silenceper/mcp-k8s.git
cd mcp-k8s
go build -o bin/mcp-k8s cmd/mcp-k8s/main.go
docker run --rm -p 8080:8080 -i -v ~/.kube/config:/root/.kube/config ghcr.io/silenceper/mcp-k8s:latest -transport=sse
MCP-K8S supports two communication modes: stdio (default) and SSE.
-kubeconfig
: Path to Kubernetes configuration file (uses default config if not specified)-enable-create
: Enable resource creation operations (default: false)-enable-update
: Enable resource update operations (default: false)-enable-delete
: Enable resource deletion operations (default: false)-enable-list
: Enable resource list operations (default: true)-enable-helm-release-list
: Enable Helm release list operations (default: true)-enable-helm-release-get
: Enable Helm release get operations (default: true)-enable-helm-install
: Enable Helm chart installation (default: false)-enable-helm-upgrade
: Enable Helm chart upgrade (default: false)-enable-helm-uninstall
: Enable Helm chart uninstallation (default: false)-enable-helm-repo-list
: Enable Helm repository list operations (default: true)-enable-helm-repo-add
: Enable Helm repository add operations (default: false)-enable-helm-repo-remove
: Enable Helm repository remove operations (default: false)-transport
: Transport type (stdio or sse) (default: "stdio")-host
: Host for SSE transport (default "localhost")-port
: TCP port for SSE transport (default 8080)For stdio mode, configure your MCP client with the following configuration:
{
"mcpServers": {
"mcp-k8s": {
"command": "/path/to/mcp-k8s",
"args": [
"-kubeconfig", "/path/to/kubeconfig",
"-enable-create",
"-enable-delete",
"-enable-update",
"-enable-list",
"-enable-helm-install",
"-enable-helm-upgrade"
]
}
}
}
Run the server with SSE transport:
./bin/mcp-k8s -kubeconfig=/path/to/kubeconfig -transport=sse -port=8080 -host=localhost -enable-create -enable-delete -enable-list -enable-update -enable-helm-install
Configure your MCP client with:
{
"mcpServers": {
"mcp-k8s": {
"url": "http://localhost:8080/sse",
"args": []
}
}
}
Configure your MCP client with:
{
"mcpServers": {
"mcp-k8s": {
"command": "docker",
"args": [
"run",
"-i",
"-v",
"~/.kube/config:/root/.kube/config",
"--rm",
"ghcr.io/silenceper/mcp-k8s:latest"
]
}
}
}
get_api_resources
: Get all supported API resource types in the clusterget_resource
: Get detailed information about a specific resourcelist_resources
: List all instances of a resource typecreate_resource
: Create new resources (disabled by default)update_resource
: Update existing resources (disabled by default)delete_resource
: Delete resources (disabled by default)list_helm_releases
: List all Helm releases in the clusterget_helm_release
: Get detailed information about a specific Helm releaseinstall_helm_chart
: Install a Helm chart (disabled by default)upgrade_helm_chart
: Upgrade a Helm release (disabled by default)uninstall_helm_chart
: Uninstall a Helm release (disabled by default)list_helm_repositories
: List configured Helm repositoriesadd_helm_repository
: Add a new Helm repository (disabled by default)remove_helm_repository
: Remove a Helm repository (disabled by default)By default, MCP-K8S enables only read operations for both Kubernetes resources and Helm operations. Write operations must be explicitly enabled using command-line flags.
The server also respects the RBAC permissions of the provided kubeconfig, ensuring that operations are limited to the permissions granted to that kubeconfig.
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "mcp-k8s" '{"command":"/path/to/mcp-k8s","args":["-kubeconfig","/path/to/kubeconfig","-enable-create","-enable-delete","-enable-update","-enable-list","-enable-helm-install","-enable-helm-upgrade"]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"mcp-k8s": {
"command": "/path/to/mcp-k8s",
"args": [
"-kubeconfig",
"/path/to/kubeconfig",
"-enable-create",
"-enable-delete",
"-enable-update",
"-enable-list",
"-enable-helm-install",
"-enable-helm-upgrade"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"mcp-k8s": {
"command": "/path/to/mcp-k8s",
"args": [
"-kubeconfig",
"/path/to/kubeconfig",
"-enable-create",
"-enable-delete",
"-enable-update",
"-enable-list",
"-enable-helm-install",
"-enable-helm-upgrade"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect