MCP-RAG Server
MCP-RAG:带有 RAG 的模型上下文协议🚀
使用 GroundX 和 OpenAI 实现的强大而高效的 RAG(检索增强生成),采用现代上下文处理 (MCP) 构建。
🌟 功能
高级 RAG 实现:利用 GroundX 进行高精度文档检索
模型上下文协议:与 MCP 无缝集成,增强上下文处理
类型安全:使用 Pydantic 构建,可进行强大的类型检查和验证
灵活的配置:通过环境变量轻松定制设置
文档提取:支持 PDF 文档提取和处理
智能搜索:具有评分的语义搜索功能
Related MCP server: Chalee MCP RAG
🛠️ 先决条件
Python 3.12 或更高版本
OpenAI API 密钥
GroundX API 密钥
MCP CLI 工具
📦安装
克隆存储库:
git clone <repository-url>
cd mcp-rag创建并激活虚拟环境:
uv sync
source .venv/bin/activate # On Windows, use `.venv\Scripts\activate`⚙️ 配置
复制示例环境文件:
cp .env.example .env在
.env中配置环境变量:
GROUNDX_API_KEY="your-groundx-api-key"
OPENAI_API_KEY="your-openai-api-key"
BUCKET_ID="your-bucket-id"🚀 使用方法
启动服务器
使用以下命令运行检查服务器:
mcp dev server.py文档摄取
要获取新文档:
from server import ingest_documents
result = ingest_documents("path/to/your/document.pdf")
print(result)执行搜索
基本搜索查询:
from server import process_search_query
response = process_search_query("your search query here")
print(f"Query: {response.query}")
print(f"Score: {response.score}")
print(f"Result: {response.result}")使用自定义配置:
from server import process_search_query, SearchConfig
config = SearchConfig(
completion_model="gpt-4",
bucket_id="custom-bucket-id"
)
response = process_search_query("your query", config)📚 依赖项
groundx(≥2.3.0):核心 RAG 功能openai(≥1.75.0):OpenAI API 集成mcp[cli](≥1.6.0):现代上下文处理工具ipykernel(≥6.29.5):Jupyter 笔记本支持
🔒 安全
切勿提交包含 API 密钥的
.env文件对所有敏感信息使用环境变量
定期轮换您的 API 密钥
监控 API 使用情况,防止任何未经授权的访问
🤝 贡献
分叉存储库
创建你的功能分支(
git checkout -b feature/amazing-feature)提交您的更改(
git commit -m 'Add some amazing feature')推送到分支(
git push origin feature/amazing-feature)打开拉取请求
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Ingest, manage, and retrieve documents for RAG-powered AI applications
Self-hosted AI workspace: semantic RAG document search, long-term memory, and AI chat via MCP.
The Needle MCP server enables semantic search on documents stored in files like PDFs, DOCX, and XLSX by connecting AI applications to external data sources. It provides capabilities to create and manage document collections, perform natural language searches on stored content, and retrieve relevant information without requiring exact keyword matches.
Private persistent memory for Claude, ChatGPT & Gemini via MCP - semantic search, zero-code setup.
Related MCP Servers
- FlicenseCqualityDmaintenanceA server that implements Retrieval-Augmented Generation using GroundX and OpenAI, enabling semantic search and document retrieval with Modern Context Processing for enhanced context handling.3-
- AlicenseNot gradedqualityDmaintenanceEnables RAG (Retrieval-Augmented Generation) capabilities with document processing, vector storage, and intelligent Q\&A using OpenAI embeddings and semantic search.MIT
- AlicenseNot gradedqualityDmaintenanceEnables advanced semantic search and document management by integrating the GroundX API with Claude Desktop and GitHub Copilot. It supports local file uploads, website crawling, and Google Drive synchronization for RAG workflows.1MIT
- AlicenseNot gradedqualityDmaintenanceMCP server for document ingestion and semantic search on Qdrant. Enables ingesting local documents, generating embeddings with OpenAI, and performing vector search with metadata filters.Apache 2.0