M

MCP智能文档问答

@mytechnotalent/RAG_MCP
1 Stars 144 次浏览 mytechnotalent 更新于 2026-08-23

一个具有OCR功能的检索增强生成服务器,支持语义PDF搜索,允许用户通过任何MCP客户端查询文档内容并获得智能答案。

MCP 服务配置

复制以下 JSON 到 OPClaw 或其他 MCP 客户端的配置文件中即可使用

{
  "mcpServers": {
    "rag": {
      "args": [],
      "command": "/Users/XXX/Documents/RAG_MCP/start.sh"
    }
  }
}

服务介绍

RAG_MCP

一个适用于RAG的MCP服务器,用于语义PDF搜索,支持OCR、FAISS和transformers——可以接入任何MCP客户端,并在您的MCP客户端中检索智能答案。

步骤1:创建虚拟环境并安装依赖

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

步骤2a:向Claude MCP客户端添加配置

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"
            ]
        }
    }
}

步骤2b:向Cursor MCP客户端添加配置

code ~/.cursor/mcp.json
...
{
    "mcpServers": {
        "rag": {
            "command": "/Users/XXX/Documents/RAG_MCP/start.sh",
            "args": []
        }
    }
}

步骤5:使MCP服务器可执行

chmod +x start.sh
chmod +x rag.py

步骤6:运行MCP服务器(Claude桌面版)

uv run rag.py

步骤7:运行MCP客户端并查询

Parse the pdfs and tell me about 18 Church St. and what significance it has.

许可证

Apache License, Version 2.0