Aegis MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Aegis MCP ServerSearch the knowledge base for the travel reimbursement policy for一线城市."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
🛡️ Aegis — Enterprise-Grade AI Agent Platform
Multi-format document RAG · Multi-agent collaboration · MCP tool invocation · Fact-checking with self-correction · HITL human approval
Aegis (/ˈiːdʒɪs/, Shield) is an out-of-the-box enterprise-grade AI agent application, designed around two main pillars: "Trustworthy Answers" and "Safe Execution":
Answer side: Multi-agent (Planner → Retriever → Auditor → Answerer) division of labor, every answer goes through Auditor fact-checking; when evidence is insufficient, it states so honestly and never fabricates;
Execution side: Tool invocation is based on the standardized MCP (Model Context Protocol), combined with least-privilege whitelist + human approval for sensitive operations (HITL) to achieve secure isolation.
┌──────────────────────────────────────────────┐
│ 用户 / FastAPI / CLI │
└──────────────────────┬───────────────────────┘
│ 提问
┌──────────────────────▼───────────────────────┐
│ Orchestrator(多智能体编排器) │
│ │
│ ① Planner 规划:拆解子问题 + 工具计划 │
│ ② Retriever 检索:混合检索 + MCP 工具执行 │
│ ③ Answerer 起草:基于证据、带引用 [C1][C2] │
│ ④ Auditor 核查:逐条声明 vs 证据 │
│ └─ revise ─► 带反馈重检/重答(≤3 轮) │
└──────┬──────────────────────────────┬────────┘
│ 语义检索 │ MCP 协议
┌────────────▼───────────┐ ┌───────────▼────────────┐
│ 知识库(RAG) │ │ MCP 工具服务器 │
│ PDF/DOCX/XLSX/PPTX/TXT│ │ calculator / kb_search │
│ → 解析 → 切块 → 向量化 │ │ doc_stats / … │
│ → Chroma + BM25 混合 │ │ 🔒 敏感工具 → HITL 审批 │
└────────────────────────┘ └────────────────────────┘✨ Core Capabilities
Requirement | Implementation |
Multi-format document knowledge ingestion and semantic retrieval | PDF / Word / Excel / PPT / TXT parsing (including tables, slides, page-number positioning); recursive chunking; vector + BM25 hybrid retrieval (RRF fusion); local embeddings with no API Key required |
Multi-agent division of labor | Planner (planning) → Retriever (retrieval + tools) → Answerer (drafting with citations) → Auditor (verification); on audit failure, automatically re-retrieves/answers with feedback, up to N rounds |
MCP-based standardized tool invocation with secure isolation | MCP server implemented on the official |
Auditor fact-checking and self-correction | Verifies each claim against evidence (supported/unsupported/contradicted) line by line, outputs confidence scores and revision suggestions; when evidence is insufficient, explicitly states so and refuses to fabricate, and may autonomously supplement retrieval |
HITL human intervention | Sensitive tools (send email/export/delete) trigger approval-request suspension, with execution resuming after approve/reject; three modes: |
Related MCP server: Works With Agents MCP Server
🚀 Quick Start
# 1. 安装(Python 3.10+)
cd enterprise-rag-agent
pip install -e .
# 2.(可选)配置 LLM —— 默认离线模式无需配置;接入真实模型见下文
cp .env.example .env # 填入 OPENAI 兼容的 API Key(OpenAI/DeepSeek/Ollama 等)
# 3. 一键端到端演示(自动生成 5 种格式样例文档 → 入库 → 问答 → 审批,全部自校验)
aegis demo
# 4. 导入你自己的文档
aegis ingest ./your_docs
# 5. 提问(多智能体流水线)
aegis ask "一线城市出差住宿报销上限是多少?"
# 6. 启动 HTTP 服务(Swagger: http://127.0.0.1:8000/docs)
aegis serveRun the full pipeline with no API Key required: the default embedding model uses a local ONNX
(BAAI/bge-small-zh-v1.5, ~95MB auto-downloaded on first run), and the LLM uses a built-in deterministic
backend for end-to-end verification; to connect a real model, simply configure it in .env.
Connecting a Real LLM
Supports any OpenAI-compatible protocol endpoint:
# OpenAI / DeepSeek / 通义 / 本地 vLLM
AEGIS_LLM_PROVIDER=openai
AEGIS_LLM_BASE_URL=https://api.deepseek.com/v1
AEGIS_LLM_API_KEY=sk-xxxx
AEGIS_LLM_MODEL=deepseek-chat
# 或本地 Ollama(含嵌入,完全离线)
AEGIS_LLM_PROVIDER=ollama
AEGIS_LLM_MODEL=qwen2.5:3b
AEGIS_EMBED_PROVIDER=ollama
AEGIS_EMBED_MODEL=nomic-embed-text📖 Documentation
Document | Content |
Architecture design, multi-agent collaboration protocol, security model | |
Deployment, configuration, LLM integration, MCP stdio mode | |
End-to-end self-verification report and verification methods |
🔌 HTTP API
Method | Path | Description |
POST |
| Upload document for ingestion (multipart) |
POST |
| Batch ingestion by path |
GET |
| Document list |
DELETE |
| Delete document (sensitive → HITL) |
POST |
| Ask a question (multi-agent pipeline) |
GET |
| Session status |
POST |
| Resume session after approval |
GET |
| Approval-request list |
POST |
| Approve/reject ( |
GET |
| MCP tool catalog / manual tool invocation |
GET |
| Health check |
🧩 MCP Tools
Exposed via the standard Model Context Protocol, accessible by any MCP client:
python -m aegis.mcp.server # 标准 stdio 服务Tool | Description | Security Level |
| AST whitelist safe calculation | ✅ Regular |
| Current time | ✅ Regular |
| Knowledge base semantic retrieval | ✅ Regular |
| Knowledge base statistics | ✅ Regular |
| Simulated email sending | 🔒 Sensitive → HITL |
| Export file (sandbox directory) | 🔒 Sensitive → HITL |
| Delete document | 🔒 Sensitive → HITL |
🧪 Testing and Verification
pip install -e ".[dev]"
pytest -q # 单元 + 集成测试(全部离线可跑)
aegis demo # 端到端演示(含 20+ 条自校验断言)📁 Directory Structure
enterprise-rag-agent/
├── aegis/
│ ├── llm/ # LLM 抽象层(OpenAI 兼容 / Ollama / 离线确定性)
│ ├── embeddings/ # 嵌入层(fastembed 本地 / OpenAI / Ollama)
│ ├── ingestion/ # 解析(5 格式)→ 切块 → 入库管道
│ ├── retrieval/ # Chroma 向量库 + BM25 混合检索
│ ├── mcp/ # MCP 服务器 / 客户端 / 安全策略
│ ├── agents/ # Planner / Retriever / Answerer / Auditor
│ ├── hitl/ # 人工审批管理器
│ ├── api/ # FastAPI 服务
│ ├── orchestrator.py # 多智能体编排器(状态机 + 挂起恢复)
│ ├── demo.py # 端到端演示
│ └── cli.py # 命令行入口
├── scripts/make_sample_docs.py # 样例文档生成
├── tests/ # pytest 套件
└── docs/ # 架构 / 部署 / 验证文档⚠️ Security Notes
Sensitive tools are denied by default (
auto_deny); for production environments, it is recommended to keepinteractivehuman approval;export_fileonly allows writing to theexports/sandbox under the data directory;The calculator uses AST whitelist evaluation, with no
evalinjection surface;The project's
send_emailis a simulated implementation; before connecting a real email gateway, implement it yourself and keep HITL approval in place.
📄 License
This server cannot be deployed
Maintenance
Related MCP Connectors
Governed data discovery, exact queries, decisions, simulations, and runtime utilities over MCP.
Zero-secret MCP gateway for AI agents: risk-scored, audited calls with human-in-the-loop approval.
Security & DLP proxy for MCP: tool-poisoning scans, PII redaction on tool args/results. Beta.
All public upAPI operations as MCP tools: web scraping, search, screenshots, PDF, OCR and more.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceA secure MCP gateway for enterprise AI tool execution, enabling governed invocation of business tools with authentication, RBAC, audit logging, PII redaction, and async processing.Apache 2.0
- AlicenseAqualityFmaintenanceProvides 14 MCP tools for AI agent infrastructure, enabling knowledge base queries, skill search, handoffs, blueprint validation, trust scoring, identity verification, SLA validation, and compliance checks.22MIT
- AlicenseNot gradedqualityDmaintenanceEnables MCP-compatible assistants to securely access external systems like Slack through permission-scoped, idempotent tools with tenant isolation, delegated OAuth consent, and an immutable audit trail.MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to securely discover, invoke, and manage tools through a hardened MCP endpoint with protections like injection detection, circuit breakers, retry backoff, response caching, context-window limiting, and state snapshots.3 npmMIT