kubectl-mcp-server

MCP server for Kubernetes: the agent reads cluster state, diagnoses pod failures and runs operations through kubectl

MCP server

High risk

We rate an entry high when the tool writes to external systems, handles money, production databases or secrets, or runs arbitrary commands. The CLI installs it only with your consent.

Why this level

  • Runs real kubectl operations against the cluster, including mutating ones
  • Its scope equals the kubeconfig permissions
  • An agent mistake can affect a live cluster
All reasons and checks

rohitg00/kubectl-mcp-server

Install

In your terminal, with SkillFoxx CLI

npx skillfoxx add mcp/kubectl-mcp-server

Detects the agents on your machine, checks the risk and pins the version.

Other ways to install

This entry is high risk, so there is no one-click install. Review the code and add the config by hand.

Run in a terminal

claude mcp add --transport stdio kubernetes -- npx -y kubectl-mcp-server

Or add to the file .mcp.json, in the project

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

If the file already exists, add the server inside the mcpServers key.

Add to the file ~/.cursor/mcp.json, for all projects

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

If the file already exists, add the server inside the mcpServers key. For a single project, put the same block into .cursor/mcp.json.

Run in a terminal

code --add-mcp '{"name":"kubernetes","type":"stdio","command":"npx","args":["-y","kubectl-mcp-server"]}'

Or add to the file .vscode/mcp.json, in the project

{
  "servers": {
    "kubernetes": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "kubectl-mcp-server"
      ]
    }
  }
}

If the file already exists, add the server inside the servers key.

Run in a terminal

codex mcp add kubernetes -- npx -y kubectl-mcp-server

Or add to the file ~/.codex/config.toml, for all projects

[mcp_servers.kubernetes]
command = "npx"
args = ["-y", "kubectl-mcp-server"]

If the file already exists, append the block to the end.

Add to the file ~/.gemini/settings.json, for all projects

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

If the file already exists, add the server inside the mcpServers key.

Add to the file ~/.config/devin/mcp_config.json, for all projects

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

If the file already exists, add the server inside the mcpServers key. Legacy Cascade keeps the MCP config in ~/.codeium/windsurf/mcp_config.json.

Formerly Windsurf.

Add to the file cline_mcp_settings.json, for all projects

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

If the file already exists, add the server inside the mcpServers key. Open the settings file in Cline: MCP Servers tab, Configure MCP Servers.

Add to the file .roo/mcp.json, in the project

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

If the file already exists, add the server inside the mcpServers key.

A fork of Roo Code, same .roo folders.

Add to the file opencode.json, in the project

{
  "mcp": {
    "kubernetes": {
      "type": "local",
      "command": [
        "npx",
        "-y",
        "kubectl-mcp-server"
      ]
    }
  }
}

If the file already exists, add the server inside the mcp key.

Add to the file ~/.config/zed/settings.json, for all projects

{
  "context_servers": {
    "kubernetes": {
      "command": "npx",
      "args": [
        "-y",
        "kubectl-mcp-server"
      ]
    }
  }
}

If the file already exists, add the server inside the context_servers key.

Add to the file .codeassistant/mcp.json, in the project

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

If the file already exists, add the server inside the mcpServers key.

You will need: Node.js

Checked against the repository on Sep 25, 2026, commit 14f9c13.

Text for your agent

Add a kubernetes MCP server to your client config with command npx and args -y kubectl-mcp-server. Make sure your kubeconfig points at the right cluster and context.

Other ways from the author
npx -y kubectl-mcp-server

Runs without a system install. Requires Node.js.

This is third-party code. Review the repository files before installing.

What it does

The server connects Kubernetes to an agent through your existing kubeconfig. The agent sees pods, deployments and namespaces, explains why a pod is crashing, works through network problems and creates or scales resources. It installs via npx, pip or docker and fits Claude Desktop, Cursor, Windsurf and other MCP clients. It supports the stdio transport for local use and sse to run as a networked service. The repository also ships skill sets on Kubernetes topics for agents that read them.

Who it is for. For devops engineers and developers who operate Kubernetes clusters and want to drive them from an agent.

Good fit when

  • You need to quickly find why a pod or deployment is failing
  • You want to inspect cluster state without typing kubectl by hand
  • You want to create or scale a resource from a chat with the agent

Not a fit when

  • You have no cluster access or rights in the kubeconfig
  • You do not want to give an agent write access to a live cluster
  • You need guarantees that the agent will not run a dangerous operation without confirmation

Example request

Show all pods in the kube-system namespace and explain why nginx-deployment is crashing

Limitations

It works against the cluster and permissions set in your kubeconfig, so its scope equals that context's rights. The pip install needs Python 3.9 or newer, the npx path needs Node.js. The server runs real kubectl operations, including mutating ones, so the risk of a mistake is on the user.

How to disable. Remove the kubernetes entry from your MCP client config. If installed via pip or npm, uninstall the kubectl-mcp-server package.

MCP

Transport
stdio, sse
Authentication
not required
Environment variables
Environment variables
KUBECONFIG
Path to a kubeconfig file when you need one other than the environment default

Security check

  • Runs real kubectl operations against the cluster, including mutating ones
  • Its scope equals the kubeconfig permissions
  • An agent mistake can affect a live cluster

README in short

The README leads with an npx quick start, plus pip installs and docker images from Docker Hub and GHCR. It documents configs for Claude Desktop, Cursor, Windsurf and running via python -m kubectl_mcp_tool.mcp_server with KUBECONFIG. It includes example prompts for troubleshooting, deployments and networking, plus the CLI commands info, tools and call. The project is listed in the CNCF Landscape and is MIT licensed.

FAQ

How do I run it without a system install?

Run npx -y kubectl-mcp-server so nothing is installed globally. There are also pip and a docker image.

Where does it get cluster access?

From your kubeconfig. Set the KUBECONFIG variable to point at a specific config file.

Editors’ pick

An MCP server built into the Netdata agent: metrics, logs, alerts and live process, service and container data for an AI assistant

MCP serverMedium riskNo VPN needed80.7KRepository stars
Editors’ pick

GitHub's official MCP server: code, issues, pull requests, Actions and security alerts straight from the agent

MCP serverHigh risk33.3KRepository stars

Agent Skills for Google products

Agent Skills for Google products and technologies

Editors’ pick

Official Google skill collection for working with Google Cloud, BigQuery, GKE, ads and analytics from an agent

SkillHigh risk20.5KRepository stars
Official

AWS's official MCP server suite: docs, IaC, containers, serverless, databases, cost and monitoring

MCP serverHigh risk9.7KRepository stars
Foxx AIkubectl-mcp-server

I am Foxx AI and I have already vetted this tool. Ask about install, setup or anything else, and I will keep it simple.