MCP Server · Open Source · Python

Research
intelligence
for Claude

An MCP server that gives Claude semantic paper search, full RAG over your library, and a vectorless retrieval pipeline with no embeddings, no GPU, and no paid subscription to get started.

terminal -- no subscription needed
$
6 MCP tools · BM25 + RRF · Groq generation · zero embeddings · free tier
MCP Tools
Six tools.
One research assistant.
01
search_papers
query, max_results?, category?

Live ArXiv search. Returns ranked results with titles, authors, abstracts, and PDF links. Supports category filters like cs.LG, cs.CL.

02
fetch_paper
arxiv_id, add_to_reading_list?

Downloads PDF directly from ArXiv CDN (no rate limiting), extracts text with pymupdf, chunks at 500 words, indexes into BM25. Metadata fetched separately with graceful fallback.

03
query_library
question, top_k?, arxiv_id_filter?

Full vectorless RAG: Groq query expansion into 3 BM25 variants, RRF fusion, sentence-level compression, cited context. Use arxiv_id_filter to scope to one paper.

04
summarize_paper
arxiv_id

Pulls intro, methods, and conclusion chunks. Returns structured context for problem, contribution, results, and limitations.

05
list_library
--

Lists all papers indexed in your local BM25 store with titles, authors, categories, and chunk counts.

06
get_reading_list
--

Your saved reading list with metadata, timestamps, read/unread status, and personal notes, persisted to JSON.

No subscription required
Try it from your terminal.
All features, free.
Two ways to use this
Free terminal vs Claude Pro

Without Claude Pro -- the full ML pipeline runs locally from your terminal. test_local.py runs search, fetch, indexing, RAG queries, and LLM answer generation. test_mcp.py tests the actual MCP protocol stack, byte-for-byte identical to Claude Desktop.

With Claude Pro -- connect to Claude Desktop and research in natural language. Claude calls the 6 tools automatically based on what you ask.

Free LLM generation via Groq
14,400 requests/day. No credit card.

Get a free Groq API key at console.groq.com (60 seconds, no credit card). Set GROQ_API_KEY and the server automatically uses llama-3.1-8b-instant for query expansion and answer generation. Anthropic works as a fallback. Nothing breaks if neither key is set -- retrieval still works fully.

export GROQ_API_KEY=gsk_your_key_here python3 test_local.py -q -p 2005.11401 -Q "what is the main contribution?" -F
Finding your paper ID

The ID is the number at the end of any ArXiv URL:

https://arxiv.org/abs/2301.07041

Version suffixes like v2 are stripped automatically.

Short flags -- faster to type
All flags have one-letter aliases

Every long flag has a short version. Use whichever you prefer.

-s--search     Search ArXiv live -f--fetch      Fetch and index a paper -q--query      RAG query your library -l--library    Show all indexed papers -e--edge       Run edge case tests -a--all        Run everything -i ID--arxiv-id   Paper ID to fetch -p ID--paper      Restrict query to one paper -Q "..."--question   Question to ask -F--full       Full untruncated output -n--no-generate Skip LLM answer generation
1
Clone and install
git clone https://github.com/RatnamOjha/arvix-mcp-server cd arvix-mcp-server python3 -m venv .venv && source .venv/bin/activate pip install -e .
Anaconda users: use the full venv path to avoid conflicts -- /path/to/project/.venv/bin/python3 test_local.py
2
Search ArXiv live
python3 test_local.py -s
Queries the live ArXiv API and returns ranked results with titles, authors, and IDs.
3
Fetch a paper and run RAG
python3 test_local.py -f -i 2005.11401 python3 test_local.py -q -Q "what retrieval method does RAG use?" -F
Fetches the original RAG paper, builds the BM25 index, then runs the full pipeline. -F shows complete untruncated output.
4
Add Groq for full answer generation
export GROQ_API_KEY=gsk_your_key_here python3 test_local.py -q -Q "what is BM25?" -F
Free at console.groq.com. When set, every query returns a cited LLM answer on top of the retrieval context.
5
Run the full suite
python3 test_local.py -a
Runs search, fetch, RAG query, library listing, and all 6 edge case tests in sequence.
1
Fetch your paper
python3 test_local.py -f -i 2301.07041
Downloads PDF directly from ArXiv CDN. No API, no rate limiting. Extracts text with pymupdf, builds BM25 index. Takes about 15 seconds.
2
Ask questions scoped to that paper
python3 test_local.py -q -p 2301.07041 -Q "what problem does this solve?" -F python3 test_local.py -q -p 2301.07041 -Q "what are the limitations?" -F python3 test_local.py -q -p 2301.07041 -Q "what datasets did they use?" -F
-p restricts BM25 search to that paper only. No results bleed in from other indexed papers.
3
Build a multi-paper library
python3 test_local.py -f -i 2301.07041 python3 test_local.py -f -i 2305.10601 python3 test_local.py -f -i 2005.11401 python3 test_local.py -q -Q "how do these papers approach retrieval?" -F
Papers persist at ~/.arxiv-mcp/ between runs. Omit -p to query across your whole library. BM25 scales linearly with no performance penalty.
4
Check your library
python3 test_local.py -l
Lists all indexed papers with titles, authors, chunk counts, and reading list status.
why
What test_mcp.py actually does

Spawns the MCP server as a real subprocess and sends JSON-RPC messages over stdin/stdout -- byte-for-byte identical to what Claude Desktop sends. Handles the initialize handshake, tool listing, and tool calls. If this passes, Claude Desktop integration will work. It is the closest you can get to testing the full MCP stack without a Pro subscription.

1
Test all tools
python3 test_mcp.py
Runs the full MCP handshake, lists registered tools, calls list_library and get_reading_list.
2
Test specific tools
python3 test_mcp.py --tool search_papers python3 test_mcp.py --tool fetch_paper --arxiv-id 2005.11401 python3 test_mcp.py --tool query_library --question "what is BM25?" --paper 2005.11401 python3 test_mcp.py --tool list_library
Each call goes through the full MCP protocol stack including tool registration, JSON-RPC serialization, and response parsing.
Edge cases and fixes
Problems we hit.
How we solved them.
429
ArXiv API rate limiting

The ArXiv metadata API allows roughly 1 request per 3 seconds. Burst fetching triggers HTTP 429 errors that block all requests.

# Old: blocked waiting for API fetch metadata via API, get PDF URL, download # New: guaranteed, no rate limit ever download PDF from https://arxiv.org/pdf/{id} directly fetch metadata separately with graceful fallback
PDF download hits ArXiv CDN directly with no rate limit. If metadata API is unavailable, placeholder values are used and the paper is still fully indexed and queryable. Run the fetch again later to refresh metadata.
PDF
Garbled text from LaTeX PDFs

Physics and math papers use LaTeX-rendered fonts that pdfplumber misreads, producing output like: b e a h A b r o a s instead of real sentences.

pip install pymupdf # pymupdf reconstructs reading order from glyph positions # handles multi-column layouts and LaTeX math fonts # pdfplumber stays as automatic fallback if pymupdf missing # post-processing drops lines with avg token length below 1.8 chars
The 1.8 character threshold is the statistical signature of scrambled LaTeX fonts. Real prose words average 4+ characters per token. The filter removes garbled lines before indexing.
ENV
Anaconda overriding the virtualenv

Seeing both (base) and (.venv) in your prompt means conda is winning and the wrong Python is running.

conda deactivate source .venv/bin/activate which python3 # must show .venv path # Or bypass conda entirely /full/path/.venv/bin/python3 test_local.py -f -i 2005.11401
Always use the full absolute .venv path in your Claude Desktop config. This avoids the conflict entirely regardless of what conda does in your shell.
OUT
Truncated terminal output

Default view shows 600 characters. Long papers or multi-source queries get cut off. Truncated context is never useful.

# Always use -F for full output python3 test_local.py -q -p 2507.07171 -Q "what methods do they use?" -F
-F removes truncation entirely. All examples in this site use -F.
6/6
Automated edge case test suite

Run all 6 edge cases with one command to verify your setup handles every known failure mode.

python3 test_local.py -e # Tests: empty library query, paper not found (404), # vague queries, cross-paper retrieval, bad arxiv_id_filter, # large PDF handling (>40 pages, capped)
All 6 cases produce graceful output rather than crashes. The suite is also useful after making code changes to confirm nothing regressed.
Architecture
How it works
v2 pipeline
Vectorless RAG

Traditional RAG embeds every chunk with a neural model and retrieves by cosine similarity. Vectorless RAG replaces the embedding step with BM25 keyword retrieval -- the same algorithm powering Elasticsearch and Google Scholar. It handles exact technical terms like LoRA, RLHF, KV-cache that dense vectors often miss. Query expansion via Groq (free) generates 3 BM25 variants. Results are fused with Reciprocal Rank Fusion (RRF), then each chunk is compressed to only the relevant sentences. Final answer generated by Groq.

step 01
Groq query expansion
llama-3.1-8b-instant generates 3 domain-specific keyword variants. Free tier, 60s to set up.
step 02
Multi-query BM25
Okapi BM25 scores all chunks against each variant independently. No model, no GPU.
step 03
RRF fusion
score = sum of 1/(60 + rank). Combines 3 lists without score normalization.
step 04
Compression + generation
Sentence BM25 extracts 2-3 relevant sentences. Groq generates a cited final answer.
01
Claude calls a tool

Claude Desktop connects over stdio via MCP. Research questions route to the right tool as structured JSON-RPC.

02
PDF downloaded directly

PDFs fetched from arxiv.org/pdf/{id} -- ArXiv CDN with no rate limit. pymupdf extracts text and handles LaTeX multi-column layouts.

03
Chunking and BM25 index

500-word chunks with 50-word overlap. Each chunk added to Okapi BM25 instantly. No encode() call, no model load, indexing in under 1 second per paper.

04
Multi-query BM25 and RRF

Groq expands the query into 3 variants. Three BM25 searches fused by RRF. Optional arxiv_id_filter scopes search to one paper.

05
Cited answer returned

Compressed chunks formatted as [Source N] citations. Groq generates a grounded answer. Claude presents it in conversation with full attribution.

Tech stack
mcpprotocol
arxivdata source
groq llama-3.1-8bgeneration
BM25 (built-in)retrieval
RRF fusionranking
sentence BM25compression
pymupdfextraction
httpxasync http
jsonpersistence
Claude Pro -- connect to Claude Desktop
Three steps
to connect
1
Clone and install
git clone https://github.com/RatnamOjha/arvix-mcp-server cd arvix-mcp-server python3 -m venv .venv && source .venv/bin/activate pip install -e .
2
Add to Claude Desktop config
{ "mcpServers": { "arxiv-research": { "command": "/absolute/path/to/.venv/bin/python", "args": ["-m", "src.server"], "cwd": "/absolute/path/to/arvix-mcp-server", "env": { "GROQ_API_KEY": "gsk_your_key_here" } } } }
Config at ~/Library/Application Support/Claude/claude_desktop_config.json on macOS. Use the full .venv/bin/python path to avoid Anaconda conflicts. Adding GROQ_API_KEY here enables answer generation inside Claude.
3
Restart Claude Desktop and start researching
"Search for papers on speculative decoding" "Fetch paper 2305.10601 and index it" "What does paper 2507.07171 say about the methodology?" "What does my library say about KV cache optimization?" "Compare the retrieval approaches across my indexed papers"
Claude calls the tools automatically. When you mention a paper ID, it uses arxiv_id_filter to scope the query to that paper.