Sponsored by Deepsite.site

🎯 Kubernetes MCP Server

Created By
hariohmprasath9 months ago
AI-powered MCP server understands natural language queries about your Kubernetes cluster
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
Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
ChatWiseThe second fastest AI chatbot™
WindsurfThe new purpose-built IDE to harness magic
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
DeepChatYour AI Partner on Desktop
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
Tavily Mcp
Serper MCP ServerA Serper MCP Server
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
Playwright McpPlaywright MCP server
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
CursorThe AI Code Editor
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Amap Maps高德地图官方 MCP Server