paper-retrieval
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@paper-retrieval find papers on retrieval-augmented generation for coding agents"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Paper search for coding agents. mustcite-mcp indexes a corpus of AI/ML papers (full text and the citation
graph between them) and serves it to Claude Code, Codex, or any MCP client. One find_papers call runs the whole
retrieval pipeline and returns ranked papers, each with the passage that matches the question and its official URL.
mustcite.com lets people search the corpus that OpenPapers collects; mustcite-mcp gives agents the same corpus, searched in depth. paperlevelup, an agent skill for organizing topic folders of papers and finding the ones you are missing, uses it as its main library search.
Step | Tool | Output |
Collect | PDFs and metadata (official URL, OpenReview id, DOI) for 15 AI/ML venues | |
Extract | GROBID full text, citation contexts, a paper table with references matched to papers in the corpus | |
Index and serve | mustcite-mcp (this repository) | indexes, a search engine, and the MCP tools |
Work with papers | paperlevelup (optional) | an agent workflow on top of the tools |
No data ships with this repository: you build your corpus with the first two tools, on your own machine.
What a search looks like
Ask the agent in plain words; it passes your question to find_papers verbatim and reports every result:
This is a real call on a corpus of about 185k papers. The service ranks; judging which results fit your intent stays with the agent and with you. Other requests it handles:
You ask | Tool |
"papers on X", "which papers do X?" |
|
"work related to this paper", "baselines for Y" |
|
"does this paper use dataset Z?" |
|
"who cites it, and why?" |
|
"summarize this paper" |
|
Related MCP server: paper-search-mcp
How search works
Three text channels: BM25 over full-text passages, dense retrieval over titles and abstracts (Qwen3-Embedding-4B) and over passages (Qwen3-Embedding-0.6B), fused by reciprocal-rank fusion.
Reranking: the top 50 papers are reranked with Qwen3-Reranker-4B.
Citation graph: personalized PageRank and co-citation, seeded from the reranked top, add well-cited work the text missed.
The verbatim question: agents pass the user's words as
original_query. Its results are merged into every follow-up call, so a narrowed query cannot lose them.Evidence: each result carries its passage closest to the query; the agent quotes it.
Optional: a citation-intent model, for
relation_type="baseline"(papers cited as baselines), and an LLM judge (any OpenAI-compatible endpoint) forllm_judge=true.
The configuration was chosen by evaluation on test sets built from the corpus itself (a citation sentence → the papers it cites; a paper → its references). The commands are included (see Evaluation).
Requirements
Linux, Python 3.12, uv.
An NVIDIA GPU with about 20 GB of free memory, for building the embeddings and for serving. The server loads the models on first use and releases the GPU after an idle period.
For about 185k papers: about 30 GB of disk for snapshot and indexes, and about 40 GB of RAM for the server. Smaller corpora need proportionally less.
Setup
Collect papers with OpenPapers for the venues and years you want.
Extract full text and references with masterset-toolkit: GROBID full text, citation contexts, and the dataframe builder (
preprocessing/dataframe_builder/), which writesall_papers_with_refs.parquet. KeepPAPER_UUID_NAMESPACEthe same in both tools.Configure:
cp .env.example .envand setPR_DATA_ROOT: where snapshots, indexes, and logs go;PR_CORPUS_PARQUET: the toolkit'sall_papers_with_refs.parquet(may contain{run_id});PR_FULLTEXT_ROOT: the toolkit's data directory (the parquet'spathcolumn is relative to it);PR_METADATA_DIR: OpenPapers'metadata/directory;PR_SNAPSHOT_RUN_ID: a name for this corpus version, e.g.2026-11;PR_CORPUS_DESCRIPTION: how the tools describe your corpus to agents (optional).
Build:
uv sync uv run paper-retrieval snapshot # paper table, links, citation edges uv run paper-retrieval passages # full text -> passages with citation markers uv run paper-retrieval build --build full # chunks, BM25, citation graph, embeddings (GPU)Every step is resumable and writes a
manifest.json(inputs, parameters, counts) next to its output.Serve (binds to 127.0.0.1 only):
uv run paper-retrieval-server --build full --no-llmConnect an agent. The MCP adapter is a thin stdio process that forwards calls to the server; it registers as
paper-retrieval. On the same machine:claude mcp add paper-retrieval -- /path/to/mustcite-mcp/.venv/bin/paper-retrieval-mcpFrom another machine, run the adapter over SSH (no port is exposed):
claude mcp add paper-retrieval -- ssh <server> /path/to/mustcite-mcp/.venv/bin/paper-retrieval-mcpFor Codex, in
~/.codex/config.toml:[mcp_servers.paper-retrieval] command = "ssh" args = ["<server>", "/path/to/mustcite-mcp/.venv/bin/paper-retrieval-mcp"]Give the agent the guide.
agent/SKILL.mdtells it how to call the tools and report results (pass the question verbatim, report every result in order, cite the URL). Install it as a skill, or use paperlevelup, which carries the same rules.
When the corpus grows, paper-retrieval rebuild --run-id <new run> runs snapshot, passages, and the full build for
the new run (unchanged papers' vectors are reused) and reloads the running server.
The repository is named after the corpus it was built for; the Python package, the commands, and the MCP server
are named paper-retrieval.
Optional components
Citation intent: set
PR_INTENT_MODELto a directory holding a trained model (model.json+model.npz; seesrc/paper_retrieval/intent.py). Without one,relation_type="baseline"ranks likeany(the response says so), and citation neighbors carry no baseline probability.LLM judge: start the server without
--no-llmand setPR_LLM_BASE_URL,PR_LLM_MODEL, andPR_LLM_API_KEYfor an OpenAI-compatible endpoint (e.g. vLLM).find_papers(llm_judge=true)then adds a relevance judgment to each result.
Evaluation
uv run paper-retrieval build --build eval # papers up to 2024 only
uv run paper-retrieval testsets --version v1 # test queries from 2025 papers
uv run paper-retrieval evaluate --tasks t1 t2 --splits dev --retrievers bm25-paper "rrf:bm25-paper+dense-papers-qwen3-emb-0.6b"T1 asks for the papers a 2025 citation sentence cites; T2 for a 2025 paper's references. Retriever specs are
described in src/paper_retrieval/retrievers.py; the configuration the server runs is in
src/paper_retrieval/serving.py.
Development
This repository is exported from the authors' working repository at each release, so its history has one commit per release (see CHANGELOG.md). Issues and pull requests are welcome: accepted pull requests are applied upstream and appear in the next release, with credit.
uv run pytest # no GPU or data needed; includes an end-to-end run on a synthetic corpus
python3 docs/make_figures.py # regenerate the figuresLicense
MIT (see LICENSE).
Available Tools
7 toolsexact_searchB
Exact, case-insensitive match of a term (method name, dataset name, notation) in titles, abstracts and passages. Without paper_ids, passages are checked among the top 20,000 keyword hits; titles and abstracts in full.
Inputs: term (required), k, paper_ids.
find_papersA
Search the paper corpus (with full text and an in-corpus citation graph) for papers matching a research question. Runs the full pipeline: keyword and embedding search over titles, abstracts and full-text passages, citation-graph expansion, and cross-encoder reranking. This is the main entry point.
ALWAYS pass the user's question verbatim, unchanged, as original_query on every call. Put your own rewrite or sub-question in query. On the first call pass the verbatim question as both. Results for the original question are always fused in, so a narrow rewrite cannot lose them.
Each result has paper_id, title, venue, year, url (cite this), ranks per retrieval channel, and an evidence passage: judge relevance yourself from the title and the passage. If the results clearly miss the question, rephrase and search again.
Inputs: query (required), k, filters, llm_judge, +2 more.
get_citation_neighborsB
In-corpus citation neighbors of a paper: refs (papers it cites) or cited_by (papers citing it), each with P(baseline) of the citation (a classifier of citation intent: baseline / direct comparison / core reference) and the citing sentence. intent: baseline keeps only edges classified as baseline, other the rest.
Inputs: paper_id (required), k, intent, direction.
get_paperA
Metadata, abstract, and section list of a paper. With section (a heading or its number as listed), the full text of that section.
Inputs: paper_id (required), section.
get_research_profileA
The passages to read for a research profile of a paper (problem, method, assumptions, findings, limitations): its abstract, the start of the introduction, method sections, and the conclusion, in document order with passage ids (about 14,000 characters). Summarize them yourself, citing passage ids.
Inputs: paper_id (required).
search_passagesA
Passage-level search over full text (keyword + embedding). Use it to verify a candidate or find where a paper discusses something, optionally restricted to given papers. Returns passages with paper_id, section, text.
Inputs: query (required), k, paper_ids.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
The tools have mostly distinct retrieval goals: broad question search, passage search, exact term matching, related-paper discovery, metadata/section retrieval, citation neighbors, and research-profile extraction. There is some conceptual overlap between search_passages, exact_search, and get_paper with section retrieval, but the descriptions provide clear boundaries for when to use each.
Most names follow a clear verb_noun pattern such as find_papers, search_passages, get_paper, and get_citation_neighbors. exact_search is the main deviation, using an adjective_noun form, but it is still readable and consistent enough overall.
Seven tools is a well-scoped set for a paper retrieval server, with each tool covering a distinct retrieval mode or evidence-gathering need. No tool appears redundant or out of place.
The server covers semantic search, passage verification, exact matching, related work, metadata, citation context, and research-profile extraction. Minor gaps might include author/venue filtering or batch paper comparison, but the core retrieval lifecycle is well represented.
Maintenance
Related MCP Connectors
Search 340M+ academic papers — citation graphs, semantic similarity, and AI literature reviews.
Search 250M scholarly papers and work with your Researchzy library and PDFs from your AI agent.
91Research paper search with real citations and reference formatting for AI assistants
Search arXiv and ACL Anthology, retrieve citations and references, and browse web sources to accel…
Related MCP Servers
- AlicenseNot gradedqualityFmaintenanceEnables AI agents to search academic papers, analyze citations and authors, track trending research, and find semantically related work using free scholarly sources.MIT
- FlicenseAqualityDmaintenanceEnables agents to search papers across Semantic Scholar and arXiv, read and extract text from arXiv PDFs, align records across sources, and produce structured literature-analysis digests.101-
- FlicenseNot gradedqualityCmaintenanceEnables AI agents to search and retrieve academic papers from arXiv and PubMed with citation-grade extraction, providing clean citations and summaries.-
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to search scholarly works, authors, institutions, venues, and concepts, retrieve detailed metadata, and explore citation networks through natural-language requests.112 npmMIT