Provides a comprehensive set of tools for managing multiple Kubernetes clusters simultaneously using multiple kubeconfig files, including resource management, metrics monitoring, rollout management, cluster operations, diagnostic capabilities, and resource creation across different environments (dev, staging, production).
Multi Cluster Kubernetes MCP Server
An MCP (Model Context Protocol) server application for Kubernetes operations, providing a standardized API to interact with multiple Kubernetes clusters simultaneously using multiple kubeconfig files.
MCPO Server Configuration
Add the following configuration to your MCPO server's config.json
file (e.g., in Claude Desktop):
Replace
/path/to/your/kubeconfigs
with the actual path to your kubeconfig files directory.
The server expects multiple kubeconfig files to be placed in the directory you specified. Each kubeconfig file represents a different Kubernetes cluster that you can interact with.
Installation
Installing via Smithery
To install Multi Cluster Kubernetes Server for Claude Desktop automatically via Smithery:
Prerequisites
- Python 3.8 or higher
- pip package manager
- uv package manager (optional, recommended for faster installation)
Setting up a Local Environment
- Clone the repository
- Create a virtual environment
- Install dependencies
- Configure your environment
- Make sure you have your kubeconfig files ready
- Set the
KUBECONFIG_DIR
environment variable to point to your kubeconfig directory
- Run the application
Multi-Cluster Management
This MCP server is designed specifically to work with multiple Kubernetes clusters:
- Multiple Kubeconfig Files: Place your kubeconfig files in the directory specified by
KUBECONFIG_DIR
- Context Selection: Easily switch between clusters by specifying the context parameter in your commands
- Cross-Cluster Operations: Compare resources, status, and configurations across different clusters
- Centralized Management: Manage all your Kubernetes environments (dev, staging, production) from a single interface
Features
The Kubernetes MCP Server provides a comprehensive set of tools for interacting with Kubernetes clusters:
Cluster Management
- List available Kubernetes contexts
- List namespaces and nodes in a cluster
- List and retrieve detailed information about Kubernetes resources
- Discover available APIs and Custom Resource Definitions (CRDs)
Resource Management
- List and inspect any Kubernetes resource (pods, deployments, services, etc.)
- Get logs from pods
- Get detailed status information about deployments, statefulsets, and daemonsets
- Describe resources with detailed information similar to
kubectl describe
Metrics and Monitoring
- Display resource usage (CPU/memory) of nodes
- Display resource usage (CPU/memory) of pods
- Diagnose application issues by checking status, events, and logs
Rollout Management
- Get rollout status and history
- Undo, restart, pause, and resume rollouts
- Scale and autoscale resources
- Update resource constraints (CPU/memory limits and requests)
Usage Examples
Here are some examples of how to use the Kubernetes MCP Server with AI assistants:
Multi-Cluster Operations
Diagnose Application Issues
Scale Resources
Investigate Resource Usage
Update Resource Limits
Rollback Deployment
Discover API Resources
Describe Resources
Create New Resources
Expose a Deployment
Execute Command in a Pod
Node Maintenance
Apply Configuration
Patch a Resource
Update Labels
Implemented Tools
The server implements the following MCP tools:
Core Tools
k8s_get_contexts
: List all available Kubernetes contextsk8s_get_namespaces
: List all namespaces in a specified contextk8s_get_nodes
: List all nodes in a clusterk8s_get_resources
: List resources of a specified kindk8s_get_resource
: Get detailed information about a specific resourcek8s_get_pod_logs
: Get logs from a specific podk8s_describe
: Show detailed information about a specific resource or group of resources
API Discovery Tools
k8s_apis
: List all available APIs in the Kubernetes clusterk8s_crds
: List all Custom Resource Definitions (CRDs) in the cluster
Metrics Tools
k8s_top_nodes
: Display resource usage of nodesk8s_top_pods
: Display resource usage of pods
Rollout Management Tools
k8s_rollout_status
: Get status of a rolloutk8s_rollout_history
: Get revision history of a rolloutk8s_rollout_undo
: Undo a rollout to a previous revisionk8s_rollout_restart
: Restart a rolloutk8s_rollout_pause
: Pause a rolloutk8s_rollout_resume
: Resume a paused rollout
Scaling Tools
k8s_scale_resource
: Scale a resource to a specified number of replicask8s_autoscale_resource
: Configure a Horizontal Pod Autoscaler (HPA)k8s_update_resources
: Update resource requests and limits
Diagnostic Tools
k8s_diagnose_application
: Diagnose issues with an application
Resource Creation and Management Tools
k8s_create_resource
: Create a Kubernetes resource from YAML/JSON contentk8s_apply_resource
: Apply a configuration to a resource (create or update)k8s_patch_resource
: Update fields of a resourcek8s_label_resource
: Update the labels on a resourcek8s_annotate_resource
: Update the annotations on a resource
Workload Management Tools
k8s_expose_resource
: Expose a resource as a new Kubernetes servicek8s_set_resources_for_container
: Set resource limits and requests for containers
Node Management Tools
k8s_cordon_node
: Mark a node as unschedulablek8s_uncordon_node
: Mark a node as schedulablek8s_drain_node
: Drain a node in preparation for maintenancek8s_taint_node
: Update the taints on a nodek8s_untaint_node
: Remove taints from a node
Pod Operations Tools
k8s_pod_exec
: Execute a command in a container
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
This server cannot be installed
An MCP server that enables interaction with multiple Kubernetes clusters simultaneously, providing comprehensive tools for cluster management, resource operations, and diagnostics across different environments.
- MCPO Server Configuration
- Installation
- Multi-Cluster Management
- Features
- Usage Examples
- Multi-Cluster Operations
- Diagnose Application Issues
- Scale Resources
- Investigate Resource Usage
- Update Resource Limits
- Rollback Deployment
- Discover API Resources
- Describe Resources
- Create New Resources
- Expose a Deployment
- Execute Command in a Pod
- Node Maintenance
- Apply Configuration
- Patch a Resource
- Update Labels
- Implemented Tools
- Contributing
Related MCP Servers
- -securityAlicense-qualityThis project is intended as a both MCP server connecting to Kubernetes and a library to build more servers for any custom resources in Kubernetes.Last updated -323GoMIT License
- -securityAlicense-qualityA read-only MCP server for Kubernetes that allows querying cluster information and diagnosing issues through natural language interfaces like Claude.Last updated -7PythonMIT License
- -securityAlicense-qualityProvides MCP multi-cluster Kubernetes management and operations, featuring a management interface, logging, and nearly 50 built-in tools covering common DevOps and development scenarios. Supports both standard and CRD resources.Last updated -590GoMIT License
- -securityAlicense-qualityProvides MCP multi-cluster Kubernetes management and operations. It can be integrated as an SDK into your own project and includes nearly 50 built-in tools covering common DevOps and development scenarios. Supports both standard and CRD resources.Last updated -121GoMIT License