Skip to main content
Glama

Kube MCP

npm version License: MIT

A Model Context Protocol (MCP) server for Kubernetes cluster management. Enables AI assistants to interact with Kubernetes resources.

Quick Start

npx @icy-r/kube-mcp

Related MCP server: Kubernetes MCP Server

MCP Configuration

Add to your MCP client (Claude Desktop, Cursor, etc.):

{
  "mcpServers": {
    "kubernetes": {
      "command": "npx",
      "args": ["-y", "@icy-r/kube-mcp"],
      "env": {
        "KUBEMCP_DEFAULT_NAMESPACE": "default"
      }
    }
  }
}

Custom kubeconfig:

{
  "mcpServers": {
    "kubernetes": {
      "command": "npx",
      "args": ["-y", "@icy-r/kube-mcp"],
      "env": {
        "KUBEMCP_CONFIG_SOURCE": "custom",
        "KUBEMCP_KUBECONFIG_PATH": "/path/to/kubeconfig"
      }
    }
  }
}

Environment Variables

Variable

Description

Default

KUBEMCP_CONFIG_SOURCE

local or custom

local

KUBEMCP_KUBECONFIG_PATH

Custom kubeconfig path

-

KUBEMCP_DEFAULT_NAMESPACE

Default namespace

default

KUBEMCP_RESPONSE_FORMAT

json, toon, auto

auto

Tools

Tool

Actions

k8s_deployments

list, get, scale, restart, get_status, get_metrics

k8s_pods

list, get, delete, get_logs, summarize_logs, get_status

k8s_services

list, get, get_endpoints

k8s_configmaps

list, get, create, update, delete

k8s_secrets

list, get, create, update, delete

k8s_namespaces

list, get, create, delete

k8s_metrics

get_pod_metrics, get_node_metrics

k8s_events

list, get_resource_events, get_recent_events

k8s_audit

get_config, configure, get_session_log, clear_session_log

Safety Features

Destructive actions require explicit confirmation:

{ "action": "delete", "name": "my-pod", "confirm": true }

Preview changes with dry-run:

{ "action": "scale", "name": "my-deployment", "replicas": 5, "dryRun": true }

Development

git clone https://github.com/icy-r/kubemcp.git
cd kubemcp
pnpm install
pnpm build
pnpm test

License

MIT

Available Tools

9 tools
k8s_auditB

Manage audit logging and safety controls. Actions:

  • get_status: Check dry-run mode and session stats

  • set_dry_run: Enable/disable dry-run mode globally

  • get_session_log: View changes made in this session

  • get_stats: Get statistics about operations in this session

  • clear_session: Clear session audit log

  • configure: Update audit settings (requireConfirmation, logToConsole)

Inputs: action (required), enabled, requireConfirmation, logToConsole.

k8s_configmapsA

Manage Kubernetes ConfigMaps. Actions:

  • list: List all ConfigMaps in a namespace

  • get: Get a specific ConfigMap

  • create: Create a new ConfigMap

  • update: Update an existing ConfigMap (requires confirm=true or dryRun=true)

  • delete: Delete a ConfigMap (requires confirm=true or dryRun=true)

Inputs: action (required), name, namespace, data, +2 more.

k8s_deploymentsA

Manage Kubernetes deployments. Actions:

  • list: List all deployments in a namespace

  • get: Get deployment details

  • scale: Scale deployment replicas (requires confirm=true or dryRun=true)

  • restart: Perform rolling restart (requires confirm=true or dryRun=true)

  • get_status: Get rollout status

  • get_metrics: Get aggregated metrics for a deployment

Inputs: action (required), name, namespace, replicas, +2 more.

k8s_eventsB

Get Kubernetes cluster events. Actions:

  • list: Get cluster events with optional filtering

  • get_resource: Get events for a specific resource

  • get_recent: Get recent events sorted by timestamp

Inputs: action (required), namespace, kind, name, +2 more.

k8s_metricsB

Get Kubernetes resource metrics (CPU/Memory). Actions:

  • get_pod_metrics: Get resource metrics for pods

  • get_node_metrics: Get resource metrics for nodes

Inputs: action (required), namespace, podName, nodeName.

k8s_namespacesA

Manage Kubernetes namespaces. Actions:

  • list: List all namespaces in the cluster

  • get: Get details of a specific namespace

  • create: Create a new namespace

  • delete: Delete a namespace (requires confirm=true or dryRun=true)

Inputs: action (required), name, confirm, dryRun.

k8s_podsA

Manage Kubernetes pods. Actions:

  • list: List pods in a namespace with optional label selector

  • get: Get pod details

  • delete: Delete a pod (requires confirm=true or dryRun=true)

  • get_logs: Get logs with filtering (severity, grep, time-based)

  • get_status: Get detailed pod status

  • summarize_logs: Get log summary statistics (90%+ token reduction)

Inputs: action (required), name, namespace, labelSelector, +10 more.

k8s_secretsA

Manage Kubernetes Secrets. Actions:

  • list: List all Secrets in a namespace

  • get: Get a specific Secret (metadata only, no data)

  • create: Create a new Secret

  • update: Update an existing Secret (requires confirm=true or dryRun=true)

  • delete: Delete a Secret (requires confirm=true or dryRun=true)

Inputs: action (required), name, namespace, data, +3 more.

k8s_servicesC

Manage Kubernetes services. Actions:

  • list: List all services in a namespace

  • get: Get service details

  • get_endpoints: Get endpoints for a service

Inputs: action (required), name, namespace.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 9 tools

    Disambiguation5/5

    Each tool targets a distinct Kubernetes resource type (e.g., configmaps, deployments, pods) with clear boundaries. The actions within each tool are well-defined for that resource, preventing overlap or confusion between tools. An agent can easily distinguish between managing pods versus deployments versus services.

    Naming Consistency5/5

    All tool names follow a consistent 'k8s_' prefix with the resource name (e.g., k8s_configmaps, k8s_deployments). Actions within tools use consistent verbs like list, get, create, update, delete. This predictable pattern enhances readability and usability across the entire set.

    Tool Count5/5

    With 9 tools covering core Kubernetes resources (configmaps, deployments, events, metrics, namespaces, pods, secrets, services, plus audit), this is well-scoped for a Kubernetes management server. Each tool serves a distinct purpose, and the count aligns with typical MCP server ranges (3-15 tools).

    Completeness4/5

    The tool set provides comprehensive CRUD/lifecycle coverage for key Kubernetes resources, including audit features. Minor gaps exist, such as no update/delete for services or events, but core operations are covered. Agents can handle most Kubernetes management tasks without dead ends.

    Maintenance

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables advanced management of Kubernetes clusters through natural language interactions. Supports querying, managing, and monitoring pods, deployments, nodes, and logs across multiple contexts and namespaces.
      10
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables interaction with Kubernetes clusters through 32 specialized tools for managing resources, deployments, and services. Provides both CLI and web interfaces for real-time Kubernetes operations powered by Google Gemini.
      5
      -
    • A
      license
      B
      quality
      D
      maintenance
      Enables AI assistants to interact with Kubernetes clusters through 50 specialized tools for comprehensive cluster management. Supports both local kubectl and remote SSH-based execution for managing pods, deployments, services, and other Kubernetes resources.
      49
      MIT