k8s-multicluster-mcp

k8s-multicluster-mcp

An MCP server for interact with multiple Kubernetes clusters simultaneously using multiple kubeconfig files.

11
Stars
2
Forks
2
Releases

Overview

An MCP (Model Context Protocol) server application for Kubernetes operations that provides a standardized API to interact with multiple Kubernetes clusters simultaneously using multiple kubeconfig files. The server supports configuration via MCPO's config.json, where you define an mcpServers.kubernetes entry with the command, arguments, and a KUBECONFIG_DIR environment variable. All kubeconfig files placed in that directory represent individual clusters, enabling cross-cluster management from a single interface. Context selection is achieved by specifying the cluster context in commands, allowing seamless switching between clusters. The MCP server exposes a comprehensive set of tools across core, API discovery, metrics, rollout management, scaling, and resource handling to list contexts or namespaces, retrieve resources, monitor usage, manage deployments, apply changes, patch resources, and diagnose issues. It includes capabilities for node and pod operations, resource creation and labeling, and workload exposure. The README provides usage examples for multi-cluster operations and diagnoses, along with installation steps via Smithery, prerequisites (Python 3.8+, pip, uv), virtual environment setup, dependency installation, environment configuration, and launching app.py.

Details

Owner
razvanmacovei
Language
Python
License
Apache License 2.0
Updated
2025-12-07

Features

Core Cluster Discovery and Inspection

List available contexts, namespaces, and nodes; retrieve resources; describe resources; and discover APIs and CRDs across clusters.

Cross-Cluster Resource Visibility

List and inspect Kubernetes resources across multiple clusters and contexts from a single interface.

API Discovery

Discover available APIs and Custom Resource Definitions (CRDs) within clusters.

Metrics and Telemetry

Display resource usage for nodes and pods; diagnose issues via status, events, and logs.

Rollout Management

Get rollout status and history; undo, restart, pause, and resume rollouts.

Scaling and Autoscaling

Scale resources and configure Horizontal Pod Autoscalers (HPA).

Resource Creation and Modification

Create resources from YAML/JSON, apply changes, patch resources, and update labels/annotations.

Node and Pod Operations

Cordon/uncordon/drain/taint nodes; execute commands in pods.

Audience

DevOpsManage and compare multiple Kubernetes clusters from a single interface using multiple kubeconfigs.
SREsCoordinate cross-cluster reliability and issue diagnosis across dev/stage/prod environments.
Platform teamsEnable centralized multi-cluster Kubernetes operations for platform teams.

Tags

KubernetesMCPmulti-clusterkubeconfigcontextsAPI-discoverymetricsrolloutsscalingresource-managementnode-managementpod-ops