🎯 Kubernetes MCP Server

🎯 Kubernetes MCP Server

By hariohmprasath GitHub

AI-powered MCP server understands natural language queries about your Kubernetes cluster

kubernetes ai
Overview

What is Kubernetes MCP Server?

Kubernetes MCP Server is an AI-powered control plane that allows users to manage their Kubernetes clusters through natural language queries.

How to use Kubernetes MCP Server?

To use the server, ensure your Kubernetes environment is configured, then interact with it by asking questions in natural language about your cluster's status and management.

Key features of Kubernetes MCP Server?

  • AI-powered diagnostics and recommendations for pod management.
  • Intelligent Helm chart management and release upgrades.
  • Real-time event monitoring and bottleneck detection.
  • Secure command execution within pods.

Use cases of Kubernetes MCP Server?

  1. Monitoring cluster health and diagnosing issues.
  2. Managing application deployments and troubleshooting pods.
  3. Performing Helm release management and tracking configurations.

FAQ from Kubernetes MCP Server?

  • Can I use natural language to interact with the server?

Yes! The server is designed to understand natural language queries.

  • What are the prerequisites for using the server?

You need JDK 17 or later, Gradle 7.x or later, and a configured Kubernetes environment.

  • Is the server secure?

Yes! It includes features like secure command execution and namespace isolation.

Content

🎯 Kubernetes MCP Server

Spring Boot Kubernetes Kotlin License

Your AI-Powered Kubernetes Control Plane

    ⎈ K8s MCP Server
    ├── 🤖 AI-Powered
    ├── 🔍 Smart Diagnostics
    ├── 🛡️ Enhanced Security
    └── 🚀 Developer Friendly

✨ Overview

This is a Spring Boot-based MCP server that combines the power of AI with cluster management capabilities.

🎁 Features

🔄 Pod Management

  • 📋 List and analyze pods in real-time
  • 📝 Smart log analysis with error pattern detection
  • 🔍 AI-powered pod diagnostics with recommendations
  • ⚡ Secure command execution in pods

🎯 Job Management

  • 📋 List and analyze jobs in any namespace
  • 🔍 Get detailed job status and execution history
  • 🗑️ Clean up completed or failed jobs

⎈ Helm Integration

  • 📦 Intelligent chart management
  • 🔄 Seamless release upgrades
  • 🗃️ Repository management
  • 📊 Configuration tracking

📈 Event Analysis

  • 🎯 Real-time event monitoring
  • 🚨 Smart bottleneck detection
  • 📱 Live deployment tracking

🛠️ Prerequisites

RequirementVersion
☕ JDK17 or later
🐘 Gradle7.x or later
⎈ KubernetesConfigured ~/.kube/config
🎡 HelmCLI installed

Note: MCP tool always uses the kubeconfig file from ~/.kube/config, so make sure it is properly configured.

🏗️ Building the Project

./gradlew clean build

🤝 Integration with Claude Desktop

  1. Install Claude Desktop
  2. Configure the MCP server connection:
   {
    "mcpServers": {
      "spring-ai-mcp-k8s": {
        "command": "java",
        "args": [
          "-Dspring.ai.mcp.server.stdio=true",
          "-Dspring.main.web-application-type=none",
          "-Dlogging.pattern.console=",
          "-jar",          
          "<<jar-location>>"
        ]
      }
    }
  }

Note: Make sure to pick the fat jar with all the dependencies

Integration with Other MCP Hosts

The server follows the standard MCP protocol and can be integrated with any MCP host that supports Spring-based MCP servers. Configure your host to point to the server's URL.

🗣️ Natural Language Interactions

💡 Just ask questions naturally - no need to memorize commands!

This AI-powered MCP server understands natural language queries about your Kubernetes cluster. Here are examples of questions you can ask:

🏥 Cluster Health and Diagnostics

📊 What's the overall health of my cluster?
🔍 Are there any resource bottlenecks in the 'production' namespace?
🚨 Show me problematic pods in the 'dev' namespace with recommendations
📅 What events happened in the cluster in the last hour?

📱 Application Management

📋 List all pods in the 'default' namespace and their status
❓ Why is the 'auth-service' pod failing to start?
📝 Show me the logs from the 'payment-processor' pod with error highlighting
📈 What's using the most resources in the 'monitoring' namespace?

🔍 Show me the status of all jobs in the 'default' namespace
🎯 List completed jobs in the 'data-processing' namespace
🗑️ Clean up failed jobs in the 'etl' namespace

⎈ Helm Release Management

📦 What Helm releases are installed in the 'staging' namespace?
⚡ Install the 'prometheus' chart from the official repository
⚙️ What values are configured for the 'elasticsearch' release?
🔄 Update the 'kafka' release to version 2.0.0

Note: I have noticed sometimes LLM will try and generate kubectl commands on the fly, since we would like to stick with the existing MCP tools you can suffix the prompt with "use existing MCP tools, dont generate kubectl commands"

🌟 Unique Features

What makes our MCP server special? Let's dive in!

🔍 Advanced Diagnostics

FeatureDescription
🤖 Intelligent Pod AnalysisAutomatically detects common failure patterns and provides targeted recommendations
📊 Resource Bottleneck DetectionProactively identifies resource constraints across namespaces
🎯 Smart Event AnalysisCategorizes events by severity and impact, helping prioritize issues

🛡️ Enhanced Security

FeatureDescription
🔒 Secure Command ExecutionBuilt-in validation and sanitization for pod exec commands
🏰 Namespace IsolationStrong namespace-based access controls
📝 Audit LoggingComprehensive logging of all operations with context

⎈ Helm Integration

FeatureDescription
🎯 Smart Chart ManagementValidates chart compatibility before installation
Value ValidationChecks Helm values against schema before applying
📊 Release TrackingMonitors release health and configuration drift

👩‍💻 Developer Experience

FeatureDescription
🗣️ Natural Language InterfaceNo need to memorize kubectl commands
💡 Contextual HelpProvides relevant suggestions based on cluster state
🔍 Rich Error InformationDetailed error messages with troubleshooting steps

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.


Made with ❤️ by a naive k8s and MCP fan
No tools information available.

A Model Context Protocol server for integrating HackMD's note-taking platform with AI assistants.

YouTube MCP Server
YouTube MCP Server by IA-Programming

YouTube MCP Server is an AI-powered solution designed to revolutionize your YouTube experience. It empowers users to search for YouTube videos, retrieve detailed transcripts, and perform semantic searches over video content—all without relying on the official API. By integrating with a vector database, this server streamlines content discovery.

youtube ai
View Details

MCP Deep Research Server using Gemini creating a Research AI Agent

research ai
View Details
MCP-Mealprep
MCP-Mealprep by JoshuaRL

This project takes a number of MCP servers from GitHub locations, packages them together with this repo's GHCR container, and launches them with docker-compose to run as a stack for ML/AI resources.

docker ai
View Details

BioMCP: Biomedical Model Context Protocol

bioinformatics ai
View Details
MySQL MCP Server
MySQL MCP Server by designcomputer

A Model Context Protocol (MCP) server that enables secure interaction with MySQL databases

Toolbase
Toolbase by Toolbase-AI

A desktop application that adds powerful tools to Claude and AI platforms