RAG_MCP

RAG_MCP 是一个基于 RAG(检索增强生成)技术的 MCP 服务器,专为语义 PDF 搜索设计。它集成了 OCR、FAISS 和 transformers 技术,能够通过 MCP 客户端提供智能答案检索服务。该服务适用于需要从 PDF 文档中提取和检索信息的场景,如文档分析、知识管理等。

  • by mytechnotalent
  • 1 星标
  • 更新于
在 GitHub 查看 mytechnotalent/RAG_MCP

使用说明

基本能力

产品定位

RAG_MCP 是一个基于 RAG 技术的 MCP 服务器,专注于语义 PDF 搜索,适用于文档分析和知识管理场景。

核心功能

  • 支持语义 PDF 搜索
  • 集成 OCR、FAISS 和 transformers 技术
  • 通过 MCP 客户端提供智能答案检索

适用场景

  • 文档分析
  • 知识管理
  • 信息检索

工具列表

  • tesseract:OCR 工具,用于从 PDF 中提取文本
  • FAISS:高效的相似性搜索库
  • transformers:自然语言处理模型库

常见问题解答

无明确常见问题解答部分。

使用教程

使用依赖

curl -LsSf https://astral.sh/uv/install.sh | sh
uv init rag_mcp
cd rag_mcp
uv venv
source .venv/bin/activate
uv pip install -r requirements.txt
brew install tesseract

安装教程

  1. 创建虚拟环境并安装依赖(见使用依赖部分)
  2. 配置 MCP 客户端(Claude 或 Cursor)
    • Claude 配置:
      code ~/Library/Application\ Support/Claude/claude_desktop_config.json
      
      添加以下配置:
      {
          "mcpServers": {
              "rag": {
                  "command": "/Users/XXX/.local/bin/uv",
                  "args": [
                      "--directory",
                      "/Users/XXX/Documents/RAG_MCP",
                      "run",
                      "rag.py"
                  ]
              }
          }
      }
      
    • Cursor 配置:
      code ~/.cursor/mcp.json
      
      添加以下配置:
      {
          "mcpServers": {
              "rag": {
                  "command": "/Users/XXX/Documents/RAG_MCP/start.sh",
                  "args": []
              }
          }
      }
      
  3. 使 MCP 服务器可执行:
    chmod +x start.sh
    chmod +x rag.py
    

调试方式

  1. 运行 MCP 服务器(Claude Desktop):
    uv run rag.py
    
  2. 运行 MCP 客户端并查询:
    Parse the pdfs and tell me about 18 Church St. and what significance it has.