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.
README
β Agentic K8s AIOps π€
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:cloudmodel 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:
- Observation: The
k8s_scanner.pymodule continuously polls the cluster for degraded states. - Thinking: The
ai_agent.pyevaluates the issue using the local Ollama LLM. - Action: Through the MCP server, the agent executes targeted
kubectlcommands 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:
- Web UI Mode (via FastAPI dashboard)
- Claude Code Native Mode (via FastMCP terminal server)
- 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
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
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.
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.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
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.
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.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
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.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.