agentic-k8s-aiops

agentic-k8s-aiops

An MCP server for autonomous Kubernetes troubleshooting and remediation. It enables continuous cluster monitoring, local AI-powered diagnosis via Ollama, and automated kubectl-based fixes.

Category
Visit Server

README

⎈ Agentic K8s AIOps πŸ€–

License Python Kubernetes AI

An autonomous, AI-powered Kubernetes troubleshooting and remediation agent. This tool continuously monitors your Kubernetes cluster, detects anomalies, and leverages local LLMs (via Ollama) to diagnose and automatically fix issuesβ€”all without relying on external cloud APIs.

🌟 Key Features

  • πŸ” Automated Cluster Scanning: Detects CrashLoopBackOff, OOMKilled, ImagePullBackOff, and pending pods.
  • πŸ€– Local AI Diagnosis: Powered by the gemma4:cloud model via Ollama for secure, on-premise AI processing.
  • πŸ› οΈ Autonomous Auto-Remediation: Executes kubectl commands directly to resolve detected issues using a ReAct agent framework.
  • πŸ’» Claude Code Native (MCP): Fully integrated Model Context Protocol (MCP) server for terminal-based interactions.
  • 🎨 Beautiful Web Dashboard: A sleek, dark-themed UI for visualizing cluster health, viewing AI reasoning, and managing self-healing workflows.

πŸ—οΈ Architecture

The platform operates using a modular ReAct (Reasoning and Acting) pattern:

  1. Observation: The k8s_scanner.py module continuously polls the cluster for degraded states.
  2. Thinking: The ai_agent.py evaluates the issue using the local Ollama LLM.
  3. Action: Through the MCP server, the agent executes targeted kubectl commands to remediate the issue.

πŸš€ Quick Start

Ensure you have Python 3.11+, Ollama, and kubectl configured.

# 1. Clone the repository & setup
git clone https://github.com/yuankraj/agentic-k8s-aiops.git
cd agentic-k8s-aiops
bash setup.sh

# 2. Start the local Ollama server
ollama serve

# 3. Launch the Web Dashboard
source .venv/bin/activate
python app.py

# 4. Open in your browser
# http://localhost:8000

πŸ“– Comprehensive Usage Guide

This agent can be run in three different modes:

  1. Web UI Mode (via FastAPI dashboard)
  2. Claude Code Native Mode (via FastMCP terminal server)
  3. Pure Terminal Chat Mode (via Python script)

πŸ‘‰ Check out the USAGE.md file for detailed step-by-step instructions for all execution modes.

πŸ“‚ Project Structure

.
β”œβ”€β”€ app.py            # Main web server (FastAPI)
β”œβ”€β”€ mcp_server.py     # FastMCP Server (Claude Code integration)
β”œβ”€β”€ k8s_scanner.py    # Kubernetes cluster scanner for fault detection
β”œβ”€β”€ ai_agent.py       # Ollama ReAct AI agent with auto-fix tools
β”œβ”€β”€ terminal_chat.py  # Pure terminal interaction script
β”œβ”€β”€ setup.sh          # One-click environment configuration
β”œβ”€β”€ requirements.txt  # Python dependencies
└── static/           # Frontend assets (UI, styling, logic)
    β”œβ”€β”€ index.html    
    β”œβ”€β”€ style.css     
    └── app.js        

🀝 Contributing

Contributions, issues, and feature requests are welcome! Feel free to open an issue or submit a pull request.


Built with ❀️ for resilient Kubernetes operations.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured