RAG MCP Server
使用 Python、LangChain、LangGraph 和 LlamaIndex 的 MCP RAG
用于索引文档并使用 RAG(检索增强生成)回答问题的 Model Context Protocol (MCP) 服务器项目。该服务器使用 FastMCP 通过 SSE 通信,LlamaIndex + ChromaDB 用于检索,LangGraph 用于编排,LangChain 用于生成。
架构
Cliente MCP -> SSE (/sse) -> FastMCP
-> ingest_documents(paths)
-> ask_rag(question)
-> LangGraph
-> recuperar contexto (LlamaIndex/Chroma)
-> gerar resposta (LangChain/OpenAI)
-> validar citaçõesRelated MCP server: Antigravity PDF MCP Server
快速开始
cp .env.example .env
# Edite .env e informe OPENAI_API_KEY
docker compose up --buildMCP SSE 端点位于 http://localhost:8000/sse。
文档
要将本地文件夹提供给容器,请在 docker-compose.yml 中取消注释卷 ./docs:/workspace/docs:ro。然后使用类似 /workspace/docs/manual.md 的路径调用该工具。
MCP 工具
ingest_documents
索引 .txt、.md 和 .pdf 文件。
{"paths": ["/workspace/docs/manual.md"]}ask_rag
检索最相关的片段,并使用 [S1]、[S2] 引用进行回答。
{"question": "Quais são os procedimentos de backup?", "top_k": 5}环境变量
变量 | 用途 |
| 与 OpenAI 兼容的 API 密钥 |
| LangChain 生成模型 |
| LlamaIndex 嵌入模型 |
| 兼容端点的可选基础 URL |
| ChromaDB 持久化目录 |
| 向量集合名称 |
| 索引片段的大小 |
| 片段之间的重叠 |
安全
未经 TLS 和身份验证,请勿公开暴露 SSE。仅挂载授权的文档目录,因为摄取工具会读取所指定的路径。
This server cannot be deployed
Maintenance
Related MCP Connectors
Ingest, manage, and retrieve documents for RAG-powered AI applications
Turn documents into structured, AI-ready data by parsing, enriching, chunking, and embedding.
Versioned documentation registry and semantic search for AI tools and coding assistants.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables RAG (Retrieval-Augmented Generation) capabilities with document processing, vector storage, and intelligent Q\&A using OpenAI embeddings and semantic search.-
- FlicenseNot gradedqualityDmaintenanceEnables intelligent ingestion and querying of PDF, Markdown, and text files using hybrid search that combines keyword matching and semantic embeddings with citations.2-
- AlicenseAqualityDmaintenanceEnables document Q&A with grounded citations using the official Gemini File Search API. Upload documents, create stores, and ask questions that return exact passage citations.78 npm2MIT
- FlicenseNot gradedqualityDmaintenanceEnables searching a knowledge base and asking grounded questions with hybrid retrieval, reranking, and cited answers.-