AI Incident Monitoring RCA MCP Server

AI Incident Monitoring RCA MCP Server

Provides telemetry tools for retrieving recent logs and system metrics to support root-cause analysis of infrastructure incidents. Enables autonomous incident triage with grounded verification and human-in-the-loop remediation.

Category
Visit Server

README

šŸ¤– Enterprise AI System Monitoring & Autonomous RCA Agent

An autonomous, production-inspired Level-1 SRE Incident Triage Agent built with LangGraph, FastMCP, and FastAPI. It intercepts infrastructure alerts via authenticated webhooks, dynamically queries application stack traces and time-series metrics via FastMCP tools, performs grounded root-cause analysis, and provides human-in-the-loop remediation guardrails.

Key Metric: Cuts manual incident triage time from 40 minutes to under 3 seconds (~99.5% MTTR reduction) while eliminating hallucinations using a deterministic Grounding Verification Guardrail.


šŸ—ļø System Architecture

[ External Alerting / Prometheus ] │ (Authenticated HTTP POST / X-API-Key) ā–¼ ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā” │ FastAPI Webhook API │ ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜ │ (Idempotency Check via SQLite) ā–¼ ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā” │ LangGraph State Machine │ ā”œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¤ │ 1. Ingest Incident │ │ 2. Fetch Telemetry ───────┼───► [ FastMCP Server Tools ] │ 3. Analyze Root Cause ────┼───► [ Resilient LLM Router (Groq / OpenRouter) ] │ 4. Verify Grounding │ ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜ │ ā–¼ ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā” ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā” │ Streamlit Operator UI │ ───► │ Human-in-the-Loop Safeguard │ ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜ │ (Approve / Reject Remediation) │ ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜


⭐ Core Enterprise Features

  1. Multi-Incident Failure Simulation: Built-in telemetry engine generating realistic multi-variate metrics for Database Pool Exhaustion, Heap Memory Leaks (OOM), and Upstream API Latency Cascades.

  2. Deterministic LangGraph Orchestration: Async state-machine workflow executing sequential DAG steps (ingest → fetch → analyze → verify).

  3. Decoupled FastMCP Tool Architecture: Isolated Model Context Protocol server exposing get_recent_logs() and get_system_metrics() without polluting core agent logic.

  4. Zero-Hallucination Grounding Safeguard: Programmatic verification node cross-referencing LLM claims against raw stack trace evidence before marking diagnostics as valid.

  5. Resilient Multi-Provider LLM Router: 15-second timeout limits with exponential backoff retries and automatic failover from primary (Groq Llama 3.1 8B) to secondary (OpenRouter).

  6. Webhook Authentication & Idempotency Store: Secured with X-API-Key headers and SQLite-backed deduplication (DUPLICATE_CACHED) to prevent duplicate LLM calls on repeated alerts.

  7. FinOps Token & Cost Observability: Real-time token usage, execution latency, and dollar cost tracking per incident logged via structlog and SQLite.

  8. Automated Pytest Regression Suite: Mocked async test suite running regression checks in < 1s without spending paid API credits.


šŸ“Š Evaluation & Benchmark Performance

Evaluated against evaluation/eval_dataset.json across realistic incident scenarios:

Metric Benchmark Result
Total Test Scenarios 3 / 3 Passed
Root Cause Accuracy Score 100.0%
Grounding Guardrail Pass Rate 100.0% (0% Hallucination Rate)
Average AI Execution Speed ~2.8 seconds
MTTR Reduction Efficiency 99.5% Faster than Manual Triage

šŸš€ Quickstart & Setup

Prerequisites

  • Python 3.11+
  • Docker & Docker Compose (Optional for containerization)
  • Free Groq API Key

Local Installation

# 1. Clone Repository
git clone [https://github.com/lokeshkundi15/ai-incident-monitoring-rca-agent.git](https://github.com/lokeshkundi15/ai-incident-monitoring-rca-agent.git)
cd ai-incident-monitoring-rca-agent
Linkedin Profile : https://www.linkedin.com/in/lokesh-kundi-3a08b9318/

# 2. Create Virtual Environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# 3. Install Dependencies
pip install -r requirements.txt

# 4. Environment Variables Setup
cp .env.example .env
# Edit .env and paste your GROQ_API_KEY and WEBHOOK_API_KEY


Running the Services:

# Start FastAPI Webhook Server
python app/main_api.py

# In a new terminal, launch the Streamlit Operations Dashboard
streamlit run ui/dashboard.py

# Execute Evaluation Suite
python evaluation/evaluate.py

# Run Automated Test Suite
pytest -v

Running via Docker:
docker-compose up --build

šŸ› ļø Project Structure:

ai-incident-monitoring-rca-agent/
ā”œā”€ā”€ app/
│   ā”œā”€ā”€ logger.py          # Structlog JSON Audit Logger
│   ā”œā”€ā”€ llm_router.py      # Resilient Fallback LLM Router
│   ā”œā”€ā”€ main_api.py        # Authenticated FastAPI Webhook
│   ā”œā”€ā”€ idempotency.py     # SQLite Deduplication Store
│   └── cost_tracker.py    # FinOps Token & Cost Observability
ā”œā”€ā”€ agents/
│   ā”œā”€ā”€ state.py           # IncidentState Schema
│   ā”œā”€ā”€ nodes.py           # Async Graph Nodes
│   └── graph.py           # LangGraph Workflow Orchestrator
ā”œā”€ā”€ mcp_server/
│   └── tools.py           # FastMCP Telemetry Tools
ā”œā”€ā”€ data/
│   ā”œā”€ā”€ generator.py       # Multi-Scenario Incident Simulator
│   └── simulated/         # SQLite Metrics & Log Files
ā”œā”€ā”€ evaluation/
│   ā”œā”€ā”€ eval_dataset.json  # Benchmark Scenarios
│   └── evaluate.py        # Quantitative Evaluation Runner
ā”œā”€ā”€ tests/
│   └── test_suite.py      # Pytest Async Regression Suite
ā”œā”€ā”€ ui/
│   └── dashboard.py       # Streamlit Operator UI
ā”œā”€ā”€ Dockerfile
ā”œā”€ā”€ docker-compose.yml
└── requirements.txt

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