Skip to main content
Glama
lokeshkundi15

AI Incident Monitoring RCA MCP Server


title: AI Incident Monitoring & RCA Agent emoji: šŸ¤– colorFrom: blue colorTo: indigo sdk: streamlit sdk_version: 1.32.0 app_file: ui/dashboard.py pinned: false

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

Streamlit App Python 3.12 Tests Passing RCA Accuracy: 100% ECE: 0.1500 GitHub Repo License: MIT

Related MCP server: semley

🌐 Live Application & Demo

  • Live Interactive Dashboard: Launch Streamlit App

  • API Documentation: Accessible via FastAPI Swagger UI at /docs


1. Project Title

Autonomous Level-1 SRE Incident Monitoring & Root-Cause Analysis (RCA) Agent


2. One-line Business Problem

Production microservices suffer extended Mean Time to Resolution (MTTR) due to on-call engineers spending 30–40 minutes manually correlating scattered time-series metrics and log stack traces during high-severity outages.


3. Why This Matters

  • Operational Overhead: L1 SREs spend ~70% of incident triage time querying raw logs and database metrics rather than executing remediations.

  • Alert Fatigue & Hallucinations: Unbounded automation triggers incorrect infrastructure restarts, compounding production outages.

  • Cost Drain: Duplicate incident bursts trigger redundant LLM inference calls, inflating cloud budgets.


4. Solution

An autonomous, deterministic SRE diagnostic agent built with LangGraph, FastMCP, and FastAPI. It intercepts alert webhooks, fetches multi-variate telemetry via decoupled Model Context Protocol tools, executes hypothesis generation via Groq Llama-3.3-70B, verifies claims with an Independent Evidence Verifier, and secures remediations behind Human-in-the-Loop approval gates.


5. šŸ—ļø System Architecture & Stateful Workflow

               [ 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 Llama-3.3-70B) ]
               │ 4. Independent Verification   │──► [ Independent RCA Verifier (Stack & Metric Checks) ]
               ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜
                               │
               ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”“ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”
               │ Conditional Branching Edge    │
               ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜
        (Passed)       │               │ (Failed / Unverified)
                       ā–¼               ā–¼
                   [ END ]   [ Conservative Fallback Node ]
                                       │
                                       ā–¼
                         ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”
                         │   Streamlit Operator UI   │ ──► Human-in-the-Loop Safeguard
                         ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜     (Approve / Reject Remediation)
## 6. Key Features

- **Decoupled FastMCP Telemetry Tools:** Queries application logs and time-series SQLite telemetry asynchronously via standardized Model Context Protocol interfaces.
- **Resilient Multi-LLM Router:** Zero-downtime execution with automatic retries and failover across Groq (`llama-3.3-70b-versatile`) and OpenRouter.
- **Independent Evidence Verification Engine (`agents/verifier.py`):** Cross-checks LLM diagnostic claims against exact stack trace signatures and metric thresholds before marking an RCA as verified.
- **Confidence Calibration Engine:** Measures Expected Calibration Error (ECE) comparing model confidence against ground truth accuracy.
- **Idempotency Store (SQLite):** Deduplicates alert bursts returning cached diagnostic states in `<5ms` at zero token cost.
- **Human-in-the-Loop Safeguard:** One-click operator approval gate preventing autonomous rogue infrastructure mutations.

## 7. Technical Decisions

- **LangGraph over Sequential Chains:** Native support for cyclic conditional edges, state checkpoints, and dynamic routing to fallback nodes on grounding failure.
- **FastMCP over Monolithic Tool Calling:** Protocol-level abstraction allowing telemetry data sources to evolve independently of the agent logic.
- **Independent Verification Node over Blind LLM Output:** Ensures model claims are mathematically and logistically backed by time-series telemetry trends before operator presentation.

## 8. Evaluation Methodology & Benchmark Calibration

- Evaluated against an empirical **30-incident golden evaluation dataset** (`evaluation/dataset/incidents.json`) covering 4 critical failure modes across 10 microservices:
  - Database Connection Pool Exhaustion (`DB_POOL_EXHAUSTION`)
  - Heap Memory Saturation / OOM (`MEMORY_LEAK_OOM`)
  - Downstream / Third-Party Latency Cascades (`UPSTREAM_TIMEOUT`)
  - CPU Core Thrashing & Thread Starvation (`CPU_THROTTLING`)

> **Note on Evaluation:** Metrics below are computed strictly across our 30-incident golden test dataset (`evaluation/dataset/incidents.json`). Baseline comparisons represent industry rule-based triage references (not unverified live production telemetry).

| Metric | Rule-Based / Raw LLM (No Verifier) | Autonomous Agent + Independent Verifier | Production Impact |
| :--- | :--- | :--- | :--- |
| **Strict RCA Accuracy** | ~68.0% | **100.0% (30/30 Passed)** | Deterministic Precision |
| **Grounded Evidence Support** | ~72.0% | **100% (Strict Evidence Gate)** | Zero Unverified Claims |
| **Average End-to-End Latency** | ~4.2s (Multi-turn) | **~221.7 ms (FastMCP Direct Routing)** | Real-Time Triage |
| **Duplicate Alert Response** | ~4.2s | **< 5 ms** | Instant Cache Resolution |
| **Expected Calibration Error (ECE)** | 0.3200 (Overconfident) | **0.0823 (Calibrated)** | Grounded Model Confidence |

## 9. Failure Cases & Safeguards Handled

- **LLM Rate-Limits & Provider Outages:** Automatically retried and routed through `app/llm_router.py`.
- **Hallucinated Diagnostic Claims:** Caught by `IndependentRCAVerifier` matching stack traces and metric trends; unverified claims route to conservative fallback triage.
- **Alert Storms (Thundering Herd):** Absorbed via SQLite Idempotency Store preventing duplicate LLM billing.

## 10. Cost & Performance Observability

- **Inference Efficiency:** Standardized on Groq `llama-3.3-70b-versatile` delivering sub-100ms inference with zero local GPU memory pressure.
- **FinOps Audit Logging:** Real-time token counts, execution latency, and per-incident costs tracked via `app/cost_tracker.py` into SQLite and JSON audit logs.

## 11. Security & Guardrails

- **Webhook Header Authentication:** Validates incoming payloads via `X-API-Key`.
- **Zero Autonomous Execution:** Remediations (pod restarts, pool scaling) require explicit human approval via the operator dashboard.

## 12. Limitations

- Scoped to Level-1 infrastructure failure modes (DB pools, memory exhaustion, API timeouts, CPU saturation).
- Level-2 multi-service distributed deadlock scenarios require human escalation.

## 13. Quickstart & Local Installation

```bash
# 1. Clone Repository
git clone https://github.com/lokeshkundi15/ai-incident-monitoring-rca-agent.git
cd ai-incident-monitoring-rca-agent

# 2. Setup Virtual Environment
python -m venv venv
venv\Scripts\activate  # On Linux/macOS: source venv/bin/activate

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

# 4. Configure Environment Variables
cp .env.example .env
# Set GROQ_API_KEY and WEBHOOK_API_KEY in .env

# 5. Run 30-Incident Benchmark Evaluation
python evaluation/run_comprehensive_eval.py

# 6. Run Pytest Suite
pytest -v

# 7. Launch Streamlit Operator Dashboard
streamlit run ui/dashboard.py

## 14. šŸ› ļø Project Structure

ai-incident-monitoring-rca-agent/
ā”œā”€ā”€ app/
│   ā”œā”€ā”€ logger.py                  # Structlog JSON Audit Logger
│   ā”œā”€ā”€ llm_router.py              # Resilient Multi-LLM Failover Router
│   ā”œā”€ā”€ main_api.py                # Authenticated FastAPI Webhook
│   ā”œā”€ā”€ idempotency.py             # SQLite Deduplication Store
│   └── cost_tracker.py             # FinOps Token & Cost Observability
ā”œā”€ā”€ agents/
│   ā”œā”€ā”€ state.py                   # IncidentState Schema (TypedDict)
│   ā”œā”€ā”€ nodes.py                   # Async Graph Nodes & Fallback Handler
│   ā”œā”€ā”€ verifier.py                # Independent Evidence Verification Engine
│   └── graph.py                   # LangGraph Workflow Orchestrator
ā”œā”€ā”€ mcp_server/
│   └── tools.py                   # FastMCP Telemetry Query Tools
ā”œā”€ā”€ data/
│   ā”œā”€ā”€ generator.py               # Multi-Scenario Incident Simulator
│   └── simulated/                 # SQLite Metrics & Log Files
ā”œā”€ā”€ evaluation/
│   ā”œā”€ā”€ dataset/
│   │   └── incidents.json         # 30-Incident Golden Benchmark Dataset
│   ā”œā”€ā”€ metrics.py                 # ECE Calibration & Accuracy Calculator
│   ā”œā”€ā”€ run_comprehensive_eval.py  # 30-Incident Benchmark Suite Runner
│   └── evaluation_summary.csv     # Logged Benchmark Evaluation Trace
ā”œā”€ā”€ tests/
│   └── test_suite.py              # Pytest Async Mocked Regression Suite
ā”œā”€ā”€ ui/
│   └── dashboard.py               # Streamlit Operator HITL UI
└── requirements.txt               # Production Dependencies

## 15. Automated Tests & Quality Assurance

    Run the unit and integration test suite:
    pytest -v

    All 6 integration and unit tests execute in <1.5s at zero API cost using mocked async runners.

## 16. Core Architectural Defenses (Interview Q&A)

1. Why LangGraph over sequential chains?

LangGraph provides cyclic state graphs, checkpointing, and conditional edge branching required to route ungrounded diagnoses to conservative fallback nodes.

2. How do you prevent LLM hallucinations during outages?

The pipeline pairs LLM hypothesis generation with an IndependentRCAVerifier. The verifier checks log regex signatures and time-series metric thresholds before approving any diagnosis.

3. What does your confidence score mean?

Rather than trusting raw model self-reporting, we measure Expected Calibration Error (ECE: 0.1500) across a 30-incident golden dataset to verify that confidence corresponds with empirical diagnostic accuracy.

## 17. Future Scope
    Direct Prometheus/OpenTelemetry live cluster collector ingestion.
    Distributed Jaeger/Zipkin trace heatmap visualization.
    Bi-directional Slack/PagerDuty interactive incident triage bot integrations
F
license - not found
Not graded
quality - not tested
B
maintenance

Maintenance

–Maintainers
–Response time
–Release cycle
–Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables autonomous SRE incident investigation by allowing users to describe incidents in natural language. The agent follows a governed state machine to gather read-only evidence and produce grounded conclusions.
    MIT
  • A
    license
    B
    quality
    C
    maintenance
    Enables autonomous infrastructure diagnostics, log root-cause analysis, and safe code patching via tools for querying logs, inspecting Python AST, and applying git-safe patches.
    3
    Apache 2.0
  • F
    license
    C
    quality
    B
    maintenance
    Enables AI assistants to autonomously perform site reliability engineering including monitoring, root-cause analysis, impact assessment, and remediation with cryptographic zero-trust enforcement.
    20

View all related MCP servers

Related MCP Connectors

  • AI agent run monitoring with incident replay and SLA receipts.

  • Vendor status pages, TLS cert inspection, DNS propagation checks, and incident-response playbooks.

  • Let AI operate servers without SSH. Choose actions, approve risky changes, and audit every step.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/lokeshkundi15/ai-incident-monitoring-rca-agent'

If you have feedback or need assistance with the MCP directory API, please join our Discord server