← Back to MCP servers

Community (Red Hat / containers)

Kubernetes MCP Server

MCP server that gives AI coding agents direct access to Kubernetes and OpenShift clusters for pod operations, Helm management, and generic resource CRUD.

Last reviewed Feb 28, 2026

What it does

The Kubernetes MCP Server connects AI coding agents to Kubernetes or OpenShift clusters. Agents can list and manage pods, view logs, exec into containers, run Helm operations, and perform CRUD on generic Kubernetes resources. It uses the Kubernetes API directly (no kubectl wrapper) and supports multiple clusters via kubeconfig context switching.

Available tools

Tool What it does
list_pods List pods in a namespace or across namespaces
get_pod Get pod details
delete_pod Delete a pod
get_pod_logs Stream or fetch pod logs
exec_into_pod Exec into a pod container
run_image Run a container image as a pod
list_resources List generic Kubernetes resources
get_resource Get a specific resource by kind and name
create_resource Create a resource from YAML/JSON
update_resource Update an existing resource
delete_resource Delete a resource
helm_install Install a Helm release
helm_list List Helm releases
helm_uninstall Uninstall a Helm release
list_contexts List kubeconfig contexts for multi-cluster

Tool names may differ by implementation. The containers/kubernetes-mcp-server is a leading implementation.

Setup by tool

Cursor

Ensure kubectl is configured and ~/.kube/config (or KUBECONFIG) points to your cluster. Create .cursor/mcp.json:

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

Alternatively, use mcp-server-kubernetes:

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

Claude Code

Add the same configuration. The server uses the default kubeconfig; set KUBECONFIG in env if your config is elsewhere.

VS Code / GitHub Copilot

Add the server to your MCP client. Ensure the agent runs with access to your kubeconfig.

When to use this

  • Debugging: Agents fetch pod logs and exec into containers during incident response
  • Deployment verification: Check pod status and resource state after deployments
  • Helm workflows: Install, upgrade, or uninstall Helm releases from the IDE
  • Resource inspection: Read deployment, service, or configmap definitions
  • Multi-cluster: Switch contexts to work with dev, staging, or prod clusters

Security considerations

  • The server inherits your kubeconfig permissions; use a restricted context for agents
  • Prefer read-only operations when possible; create/update/delete can affect running workloads
  • Never point agents at production clusters without careful access control
  • Consider a dedicated service account with minimal RBAC for agent use
  • Audit which namespaces and resources the agent can access
  • Exec and log access may expose sensitive data; restrict accordingly