Super RAG MCP Server

Super RAG MCP Server

Enables AI agents to perform offline cybersecurity research and penetration testing by querying a local knowledge base of curated security data, with tools for searching, answering, and status checking.

Category
访问服务器

README

<div align="center">

🛡️ Super RAG

An offline, agentic AI for penetration testing — your private cybersecurity brain.

Ask pentest questions, run reconnaissance, and exploit-chain over 61,000+ chunks of curated security knowledge — entirely on your own machine. No cloud. No telemetry. No data leaves your box.

Python Offline Vector DB LM Studio MCP License: MIT PRs Welcome

</div>


💡 Why Super RAG?

Enterprise security copilots (Microsoft Security Copilot, CrowdStrike Charlotte) live in the cloud, cost a fortune, and are built for defenders. Super RAG flips that:

  • 🔒 Fully offline — runs against a local LLM in LM Studio. Perfect for air-gapped labs, sensitive engagements, and regions with restricted cloud access.
  • ⚔️ Built for offensive reasoning — not just "summarize this alert," but "I see Apache 2.4.49 — what's my next move?" and it chains recon → vuln-ID → exploitation.
  • 📚 Grounded in real knowledge — indexes 1,110 hand-curated notes plus HackTricks, PayloadsAllTheThings, the OWASP cheat sheets, and hundreds of CTF write-ups. Every answer is cited back to its source file.
  • 🧩 Plugs into your agents — exposed as an MCP server, so Hermes, OpenClaw, Claude Desktop, or any MCP client gains a cybersec_search tool instantly.

⚠️ For authorized use only. This is a tool for pentesters, CTF players, and security researchers operating with explicit written permission. See Responsible Use.


✨ Features

🔎 13-strategy hybrid retrieval Dense vectors + full-text BM25, fused with RRF, then multi-hop, corrective, context-aware and re-ranking passes — tuned per pentest phase.
🤖 Agentic pentest loop reason → act → observe → reflect, with stuck-loop detection and a hybrid mode (auto-recon, manual approval before exploitation).
🍯 Evasion awareness Built-in honeypot, WAF (8 vendors), and firewall detection — so the agent doesn't waste moves on a tarpit.
🛡️ Hallucination guard A command registry validates every tool invocation against known-good flags before anything runs.
📝 Report generation One command turns findings into a professional pentest report or a HackerOne-style bug-bounty submission, with CVSS and evidence.
🔌 MCP integration One shared server, many agents — cybersec_search, cybersec_answer, cybersec_status.
🎓 Fine-tune ready Extracts real HTB/VulnHub write-up reasoning into JSONL (never fabricated scenarios).

🏗️ Architecture

flowchart LR
    subgraph Knowledge["📚 Knowledge (61,552 chunks)"]
        V["1,110 curated notes"]
        D["HackTricks · PayloadsAllTheThings · OWASP"]
        W["CTF / HTB write-ups"]
    end
    subgraph Engine["🧠 Super RAG"]
        I["ingest.py<br/>chunk + embed (parallel)"]
        Q[("Qdrant<br/>hybrid index")]
        R["rag_engine.py<br/>13 RAG strategies"]
    end
    subgraph Local["💻 LM Studio (localhost:1234)"]
        E["nomic-embed-text"]
        L["gpt-oss-20b"]
    end
    A["agent.py<br/>pentest loop"]
    M["rag_mcp.py<br/>MCP server :8765"]

    V & D & W --> I --> Q
    I -.embeddings.-> E
    Q --> R --> L
    R --> A
    R --> M
    M --> Hermes & OpenClaw & Claude["Claude Desktop"]

Three tiers, depth over scale: embedded Qdrant (no Docker) for hybrid search → 13 combined RAG strategies for context assembly → a local LLM for generation.


🔬 The 13 RAG strategies (combined on every query)

Most projects use #1 and wonder why retrieval is mediocre. Super RAG layers 13, each earning its place in a pentest workflow:

# Strategy What it buys you
4 Hybrid (vector + BM25, RRF-fused) Semantic recall and exact-string recall for CVE-2024-1086, --no-preauth, SeDebugPrivilege
17 Multi-Hop Port 389 → LDAP enum → user list → AS-REP roast → hash → crack, each hop informed by the last
9 Agentic The agent decides when and what to retrieve mid-engagement
6 Memory-Augmented Remembers what was tried hours ago, so it never re-runs a dead path
3 Corrective Detects weak retrieval and re-queries with reformulated terms
8 Context-Aware Filters to the target environment (Windows/AD vs web vs cloud)
18 Reasoning re-rank Keyword-overlap boost so the most useful chunk floats up, not just the most similar
13 Adaptive Broad scope during recon, narrow and precise during exploitation
21 Hierarchical General → specific drill-down, mirroring the ATT&CK structure
5 Speculative Pre-fetches likely follow-ups in the background to cut latency
11 Self-RAG Builds on its own prior answers across a session
24 Few-Shot Pulls a real write-up where someone exploited the same service/version
14 Citation-Aware Every fact carries its source path — essential for bug-bounty reports

🏆 Model benchmark (16 local models, real pentest scenario)

We benchmarked every model in LM Studio on a 2-turn pentest tool-use scenario (recon → exploit chain), measuring speed, accuracy, and valid tool-loops — ejecting each model between runs for clean numbers.

Rank Model tok/s Tool-loops Verdict
🥇 openai/gpt-oss-20b 165 2/2 Only model fast, accurate and emitting clean tool calls. 12 GB.
🥈 qwen3.6-35b reasoning-distilled 139 2/2 ✅ Correct chains, needs fence-stripping
gemma-4-26b / glm-4.7-flash 156 / 125 0/2 ❌ Fast & accurate, but think without emitting usable tool calls

Key finding: raw "accuracy" is misleading for agents — several high-scoring models produced empty output because they reasoned internally without ever emitting an actionable tool call. The metric that matters is valid tool-loops, and gpt-oss-20b wins it. Reproduce with python model_benchmark.py.


🚀 Quick start

Prerequisites

  • LM Studio on localhost:1234 (local server enabled) with nomic-embed-text-v1.5 (embeddings) + any chat model loaded — bring your own local model
  • Python 3.10+ (tested on 3.14.5)
  • A GPU is recommended (built on an RTX 5090; the embedder + a 12 GB chat model fit in 24 GB VRAM — but smaller models work too)

📦 Batteries included: 1,110 curated notes ship in ./vault, so it works the moment you clone. setup.py then pulls in the public doc corpora (HackTricks, PayloadsAllTheThings, OWASP, CTF write-ups) for the full ~60k-chunk brain.

# 1. Clone
git clone https://github.com/test-center-ai/super-rag.git
cd super-rag

# 2. Install (no torch, no Docker, no HuggingFace needed)
pip install -r requirements.txt

# 3. Bootstrap — clone the public doc repos + check LM Studio
python setup.py              # or: python setup.py --minimal  (bundled notes only)

# 4. Build the index (resumable; minutes with parallel embedding)
python main.py ingest

# 5. Ask anything
python main.py query "how do I exploit Apache 2.4.49 path traversal"
python main.py query "AS-REP roasting — what tool and command?"

# 6. Run the agentic pentest loop (hybrid: auto-recon, manual exploit approval)
python main.py pentest 10.10.10.5 --scope 10.10.10.0/24

# 7. Generate a report, or check health
python main.py report
python main.py status

Use your own notes instead? Point it anywhere: SUPERRAG_VAULT=/path/to/your/notes python main.py ingest. Any folder of Markdown works.

Pick a model: set CHAT_MODEL in config.py. Our 16-model benchmark crowned openai/gpt-oss-20b for agentic tool-use; google/gemma-4-12b-qat is a great lighter pick for plain Q&A.


🤝 Use it from your AI agents (MCP)

Super RAG runs as one shared MCP server (rag_mcp.py, HTTP @ 127.0.0.1:8765/mcp) so multiple agents can query it concurrently:

python rag_mcp.py        # or let Startup\SuperRAG-MCP.cmd auto-start it

Tools exposed: cybersec_search(query, phase) · cybersec_answer(question) · cybersec_status()

Register it in any MCP client:

// Claude Desktop / OpenClaw style
"mcp": { "servers": { "cybersec-rag": {
  "url": "http://127.0.0.1:8765/mcp", "transport": "streamable-http"
}}}
# Hermes style (config.yaml)
mcp_servers:
  cybersec-rag: { url: http://127.0.0.1:8765/mcp, enabled: true }

See INTEGRATION.md for the full Hermes + OpenClaw walkthrough.


🎬 It works — real agent output

Scenario: black-box target, nmap reveals Apache httpd 2.4.49.

STEP 1  recon       → nmap -sS -A 10.10.10.5          ✓ correct first move (2.9s)
STEP 2  enumerate   → gobuster on :80 (Apache live)    ✓ methodical (3.3s)
STEP 3  exploit     → curl --path-as-is "…/cgi-bin/.%2e/…/bin/bash" -d 'reverse shell'
                      ✓ textbook CVE-2021-41773 mod_cgi RCE (4.9s)
        sources: htb-cpts/initial-access-exploitation.md, oswe/file-inclusion-upload.md, HackTricks

The model followed correct methodology, grounded each step in the vault, and produced a working exploit chain — fully offline.


📁 Project layout

super-rag/
├── main.py              # CLI: ingest · query · pentest · report · extract · status
├── config.py            # paths, model IDs, chunking, timeouts, tool registry
├── ingest.py            # vault → chunks → parallel embed → Qdrant  (~14× faster pipeline)
├── rag_engine.py        # the 13 RAG strategies + RRF fusion
├── agent.py             # ReAct+Reflect pentest loop, scope + approval gates
├── detector.py          # honeypot / WAF / firewall detection
├── memory.py            # attack-surface graph, findings, stuck-loop tracking
├── report.py            # pentest report + bug-bounty submission generators
├── llm.py               # one streaming chat helper (works for every model)
├── rag_mcp.py           # MCP server for agent integration
├── model_benchmark.py   # the 16-model benchmark harness
├── extract_training.py  # real write-ups → fine-tuning JSONL
└── tools/               # registry + nmap/gobuster/ffuf parsers

🧰 Tech stack

Python 3.14 · Qdrant (embedded) · LM Studio (OpenAI-compatible local API) · nomic-embed-text-v1.5 · gpt-oss-20b · MCP / FastMCPzero cloud dependencies.


🔐 Responsible use

  • Authorized targets only. Super RAG does not enforce authorization — that is your legal responsibility. Use it on systems you own or have explicit written permission to test (engagements, CTFs, labs).
  • Hybrid mode gates exploitation behind a manual [y/N] approval. Don't bypass it.
  • Indexed external repos are reference-only and untrusted — never execute code pulled from them.
  • This project is for defensive learning, authorized testing, and CTF/education. Don't be a criminal.

🛣️ Roadmap

  • [ ] Qdrant server mode (Docker) for fully-concurrent multi-agent access
  • [ ] GRPO fine-tune of a 7–14B specialist on extracted real write-ups
  • [ ] Web UI (the CLI works today)
  • [ ] Auto-scoping from engagement rules-of-engagement files

🤝 Contributing

Issues and PRs welcome — new tool parsers, RAG strategies, and detector signatures especially. Keep it defensive, keep it cited.

📄 License

MIT — see LICENSE.

<div align="center"> <sub>Built for the offline, the air-gapped, and the curious. ⭐ Star it if it helped.</sub> </div>

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选