rapid7-mcp
README.md
# rapid7-mcp ยท Gemini SOC AI Assistant



An intelligent **NLP AI Chat Assistant** and unified MCP server for Rapid7 (**InsightIDR** and **InsightVM**). Designed with a modern **Google Gemini-style UI/UX**, it retains monthly security operations data and allows analysts, CISOs, and stakeholders to query any metric, incident, user risk, or SLA trend using natural language with **automatic interactive chart and graph generation**.
---
## โจ Features
- **Google Gemini Chat UI/UX:** Clean, elegant dark aesthetic with Gemini sparkle branding, responsive prompt chips, metric KPI cards, and smooth markdown formatting.
- **Dynamic Charts & Graphs:** Every quantitative query dynamically renders interactive visualizations:
- ๐ **Horizontal Bar Charts:** Top risky users ranked by UBA risk score.
- โฑ๏ธ **SLA Comparison Charts:** Achieved closure rates vs 90% SLA targets per priority level.
- ๐ **CVSS Distribution Breakdown:** Severity distribution across exploitable vulnerabilities.
- ๐ **Multi-Month Investigation Trajectory:** 4-month historical volume and priority trends.
- ๐ฏ **Attack Trends:** Frequency rankings of top triggered detection rules.
- **Retained Monthly SOC Telemetry:** High-fidelity retention of monthly SOC reports (including October 2026 for NAPSA / StarLabs SOC):
- **Top Risky Users:** Chikwa Luputa, Chusi Mwanza, Priscilla Samakesa, James Phiri, Yvonne Admin, etc.
- **SLA & MTTR:** Target vs actual closure rates, Mean Time to Resolution (2h 50m 47s), and pending closures.
- **Incident Attribution:** Phishing / malicious link clicks (Office 365), administrator impersonation, and impossible travel.
- **Event Source Health:** Real-time health, connection timeouts, and prescribed fixes for Active Directory WMI, SQL Server, and Cisco syslog.
- **Vulnerability Management:** Total exploitable count (476,361), CVSSv3 breakdown, and top CVEs.
- **Seamless Rapid7 Connection:**
- 1-click toggle between **Retained Monthly Archive** (instant zero-credential exploration) and **Live Rapid7 Insight Platform API**.
- Built-in connection tester verifying API keys and platform regions in seconds.
- Dual reasoning mode: Built-in local semantic NLP (offline & instant) or external LLMs (Google Gemini API, OpenAI, DeepSeek).
---
## ๐ Quick Start
### 1. Launch the Gemini SOC Chat UI
```bash
streamlit run app.py
```
Open your browser at `http://localhost:8501`.
### 2. Example Natural Language Questions to Ask
- *"Who were the top 5 risked users last month?"*
- *"Did we meet our SLAs for High and Medium priority incidents in October?"*
- *"Show exploitable vulnerabilities by CVSS score"*
- *"Which event sources currently have issues?"*
- *"Compare investigations over the last 4 months"*
- *"Which users clicked on malicious Office 365 links?"*
- *"What were the top 10 detection rules triggered?"*
---
## ๐ก๏ธ Architecture
```text
User (SOC Analyst / Manager / CISO)
โ Plain Natural Language Query
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Gemini SOC Chat Interface (app.py) โ
โ - Gemini Dark Surface & Sparkle Theme โ
โ - Interactive Altair / Native Streamlit Charts โ
โ - Instant 1-Click Connection & Period Selector โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโดโโโโโโโโโโโโโโ
โผ โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Built-in SOC NLP Engine โ โ LLM Agent (Gemini/OpenAI)โ
โ (Offline, Zero-Config) โ โ via Rapid7 MCP Tools โ
โโโโโโโโโโโโโโฌโโโโโโโโโโโโโโ โโโโโโโโโโโโฌโโโโโโโโโโโโโโโโ
โ โ
โโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Rapid7 MCP Telemetry & Storage โ
โ โข Retained Monthly Data Store (October 2026 NAPSA) โ
โ โข Live Rapid7 InsightIDR REST APIs โ
โ โข Live Rapid7 InsightVM REST APIs โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
```
---
## โ๏ธ Configuration & Connection
Configure via the Streamlit sidebar or `.env`:
```env
# Rapid7 Live API (Optional โ Retained mode works out-of-the-box)
IDR_REGION=us
IDR_API_KEY=your_insight_platform_api_key
# LLM API (Optional โ Built-in engine works offline)
GEMINI_API_KEY=your_gemini_api_key
# or
OPENAI_API_KEY=your_openai_api_key
```
---
## ๐ License
MIT License.