Scholar RAG MCP — Claude Code MCP server
Turns a folder of academic PDFs into a searchable knowledge base: semantic chunk search, section-by-section reading, and per-paper add or remove.
claude mcp add --env SCHOLAR_RAG_DATA_DIR=<SCHOLAR_RAG_DATA_DIR> --env SCHOLAR_RAG_CHAT_BASE_URL=<SCHOLAR_RAG_CHAT_BASE_URL> --env SCHOLAR_RAG_EMBED_BASE_URL=<SCHOLAR_RAG_EMBED_BASE_URL> --env SCHOLAR_RAG_RERANK_BASE_URL=<SCHOLAR_RAG_RERANK_BASE_URL> --transport stdio scholar-rag-mcp -- uvx scholar-rag-mcpWhat Scholar RAG MCP does
Scholar RAG MCP ingests a directory of papers through MinerU, pulls out metadata, marks up section structure, splits the text into chunks and embeds them. Storage is Qdrant, either launched for you or pointed at an existing instance. An agent can then search chunks, narrow results by doc_id, section, year or journal, and page through full text.
Eleven tools are exposed over stdio: list_kbs, create_kb, delete_kb, add_document, remove_document, get_document, get_document_text, list_documents, search_documents, search_chunks, get_job. Creating a knowledge base and adding papers run as background jobs, so progress comes back through get_job, and a job interrupted by a restart is picked up again. Reading returns the outline first and pages on demand, which keeps the context window from filling up.
Three OpenAI-compatible endpoints are required up front: chat, embed and rerank. SCHOLAR_RAG_CHAT_MODEL, SCHOLAR_RAG_EMBED_MODEL and SCHOLAR_RAG_RERANK_MODEL are mandatory — the model-serving script exits and lists whichever ones are missing. The bundled scripts/serve_models.sh drives vLLM and runs only on Linux with CUDA; on Windows or macOS you supply your own server, such as Ollama or LM Studio. The rerank endpoint has to answer on /v1/rerank, otherwise you are left with the embed-only fallback.
What it helps with
- build a local knowledge base from a folder of paper PDFs
- find the relevant passage by meaning rather than keywords
- read one section of a paper without loading the whole file
- add or drop a single paper from an existing knowledge base
- filter search results by year, journal or section
Example prompts for the agent
- Create a knowledge base called
papersand ingest every PDF in./articles - Search
papersfor chunks about evaluation methods and tell me which papers they came from - Show the outline of
doc_id=42, then open the experiments section
How to install Scholar RAG MCP
Platform CLI
claude mcp add --env SCHOLAR_RAG_DATA_DIR=<SCHOLAR_RAG_DATA_DIR> --env SCHOLAR_RAG_CHAT_BASE_URL=<SCHOLAR_RAG_CHAT_BASE_URL> --env SCHOLAR_RAG_EMBED_BASE_URL=<SCHOLAR_RAG_EMBED_BASE_URL> --env SCHOLAR_RAG_RERANK_BASE_URL=<SCHOLAR_RAG_RERANK_BASE_URL> --transport stdio scholar-rag-mcp -- uvx scholar-rag-mcpReplace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from scholar-rag-mcp <command>
Platform CLI
codex mcp add scholar-rag-mcp --env SCHOLAR_RAG_DATA_DIR=<SCHOLAR_RAG_DATA_DIR> --env SCHOLAR_RAG_CHAT_BASE_URL=<SCHOLAR_RAG_CHAT_BASE_URL> --env SCHOLAR_RAG_EMBED_BASE_URL=<SCHOLAR_RAG_EMBED_BASE_URL> --env SCHOLAR_RAG_RERANK_BASE_URL=<SCHOLAR_RAG_RERANK_BASE_URL> -- uvx scholar-rag-mcpReplace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from scholar-rag-mcp <command>
Config file
{
"mcpServers": {
"scholar-rag-mcp": {
"command": "uvx",
"args": [
"scholar-rag-mcp"
],
"env": {
"SCHOLAR_RAG_DATA_DIR": "<SCHOLAR_RAG_DATA_DIR>",
"SCHOLAR_RAG_CHAT_BASE_URL": "<SCHOLAR_RAG_CHAT_BASE_URL>",
"SCHOLAR_RAG_EMBED_BASE_URL": "<SCHOLAR_RAG_EMBED_BASE_URL>",
"SCHOLAR_RAG_RERANK_BASE_URL": "<SCHOLAR_RAG_RERANK_BASE_URL>"
}
}
}
}Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from scholar-rag-mcp <command>
Config file
{
"servers": {
"scholar-rag-mcp": {
"type": "stdio",
"command": "uvx",
"args": [
"scholar-rag-mcp"
],
"env": {
"SCHOLAR_RAG_DATA_DIR": "<SCHOLAR_RAG_DATA_DIR>",
"SCHOLAR_RAG_CHAT_BASE_URL": "<SCHOLAR_RAG_CHAT_BASE_URL>",
"SCHOLAR_RAG_EMBED_BASE_URL": "<SCHOLAR_RAG_EMBED_BASE_URL>",
"SCHOLAR_RAG_RERANK_BASE_URL": "<SCHOLAR_RAG_RERANK_BASE_URL>"
}
}
}
}Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from scholar-rag-mcp <command>
Platform CLI
gemini mcp add -e SCHOLAR_RAG_DATA_DIR=<SCHOLAR_RAG_DATA_DIR> -e SCHOLAR_RAG_CHAT_BASE_URL=<SCHOLAR_RAG_CHAT_BASE_URL> -e SCHOLAR_RAG_EMBED_BASE_URL=<SCHOLAR_RAG_EMBED_BASE_URL> -e SCHOLAR_RAG_RERANK_BASE_URL=<SCHOLAR_RAG_RERANK_BASE_URL> scholar-rag-mcp uvx scholar-rag-mcpReplace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from scholar-rag-mcp <command>
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about Scholar RAG MCP
How do I install Scholar RAG MCP in Claude Code?
Run `claude mcp add scholar-rag-mcp -e SCHOLAR_RAG_CHAT_BASE_URL=<SCHOLAR_RAG_CHAT_BASE_URL> -e SCHOLAR_RAG_EMBED_BASE_URL=<SCHOLAR_RAG_EMBED_BASE_URL> -e SCHOLAR_RAG_RERANK_BASE_URL=<SCHOLAR_RAG_RERANK_BASE_URL> -- uvx scholar-rag-mcp`, replacing the placeholders with your endpoint addresses.
What does Scholar RAG MCP do?
It parses paper PDFs, chunks and embeds them into Qdrant. Through 11 tools an agent searches the collection, reads papers section by section, and manages the knowledge bases themselves.
What does the server need to run?
Three OpenAI-compatible services: chat, embed and rerank. The model-name variables are required, and the rerank endpoint must support /v1/rerank.