arxiv-research-mcp
# arxiv-research-mcp
A **Model Context Protocol (MCP) server** that gives any LLM agent (Claude Desktop, Cursor, VS Code, or your own agent loop) tools for **searching, reading, re-ranking and citing arXiv papers**. The agent can then do grounded literature reviews instead of hallucinating references.
## Tools
| Tool | What it does |
|---|---|
| `search_papers(query, max_results, sort)` | arXiv search sorted by relevance or recency |
| `get_paper(arxiv_id)` | Full abstract and metadata plus BibTeX. Accepts an id, `arXiv:` prefix, or abs/pdf URL |
| `find_relevant(question, top_k)` | Pulls a 30-paper candidate pool, then **re-ranks against the full research question** with TF-IDF cosine (title weighted 2×) |
| `cite(arxiv_ids)` | BibTeX for a list of papers |
| prompt `literature_review(topic)` | Template that drives a cited mini-review: find → read → cite |
## Engineering notes
- **Polite client**: enforces arXiv's 1 request / 3 s guideline and caches identical queries in memory, so agents that loop don't hammer the API
- **Robust id parsing**: new-style (`2106.09685v2`), old-style (`hep-th/9901001`), and URL forms
- **Async** httpx client; tests mock HTTP with `respx`, so CI never touches the network
- Two-stage retrieval (cheap recall from arXiv search, then precise re-ranking), the same pattern used in production RAG
## Use it
```bash
pip install git+https://github.com/cjcodezz/arxiv-research-mcp
```
Claude Desktop / Cursor config:
```json
{ "mcpServers": { "arxiv": { "command": "arxiv-research-mcp" } } }
```
Then ask: *"Find the 3 most relevant papers on parameter-efficient fine-tuning for small LLMs and give me BibTeX."*
## Develop
```bash
pip install -e ".[dev]" && pytest -q
npx @modelcontextprotocol/inspector arxiv-research-mcp # MCP Inspector
```
## Roadmap
- Embedding re-ranker (bge-small) behind a flag
- `read_pdf` tool with section-aware chunking
- Semantic Scholar citation-graph tool (`who_cites`)
TDQS
Scored across 4 tools
The four tools mostly target distinct actions: basic search, metadata retrieval, relevance-ranked search, and BibTeX citation. The main overlap is between search_papers and find_relevant, but the descriptions make the distinction reasonably clear.
Names mostly follow a readable snake_case verb-oriented pattern: search_papers, get_paper, find_relevant, and cite. The single-word 'cite' and adjective-style 'find_relevant' are minor deviations, not serious inconsistencies.
Four tools are a reasonable size for a focused arXiv research server, covering search, retrieval, relevance ranking, and citation. The two search-related tools are somewhat specialized, but each has a plausible role.
The surface covers the core research workflow: discovery, metadata lookup, relevance-oriented search, and citation export. Minor gaps remain, such as full-text/PDF content access or broader export options, but core needs are handled.