ArXiv API MCP Server Natural Language Access
Query arXiv via natural language using an MCP server that connects to the arXiv API for fast, precise paper discovery and retrieval.
npx -y @prashalruchiranga/arxiv-mcp-serverOverview
This MCP (Model Context Protocol) server provides natural-language access to the arXiv API. It exposes a small HTTP/MCP-compatible service that translates plain-English queries into arXiv API requests, returning structured metadata and direct PDF links. The result is a faster, developer-friendly way to discover relevant papers and retrieve content for downstream apps, chat assistants, or research tools.
The server is designed for integration with LLM-based agents and other tooling that speak MCP: instead of manually formatting arXiv queries or parsing ATOM feeds, an LLM can call a compact set of MCP actions (search, fetch, download) and receive machine-friendly JSON responses. This simplifies building assistants that need accurate paper retrieval without embedding complex arXiv logic into the model prompt.
Features
- Natural-language search: send plain English queries and get ranked arXiv results.
- Structured metadata output: authors, title, abstract, categories, published date, arXiv ID, PDF URL.
- PDF retrieval support: direct links for download or proxying.
- MCP-friendly actions: explicit actions like search_arxiv, fetch_paper, and fetch_pdf for LLMs/agents.
- Configurable cache and pagination for performance and rate-limit friendliness.
- Simple HTTP interface for easy integration into apps and pipelines.
Installation / Configuration
Prerequisites: Git and Docker (or Node.js/npm) are sufficient to run locally.
Clone the repository:
Run with Docker (recommended):
# Build
# Run
Run locally with Node (if included):
# or
# Start server
PORT=8080 ARXIV_API_URL="https://export.arxiv.org/api/query"
Configuration (example .env):
PORT=8080
ARXIV_API_URL=https://export.arxiv.org/api/query
CACHE_TTL=3600 # seconds to cache search results
MAX_RESULTS=20 # default number of papers per search
LOG_LEVEL=info
Notes:
- arXiv does not require an API key, but you should respect their rate limits and usage policies.
- CACHE_TTL helps reduce repeated API calls for identical queries.
Available Tools / Resources
The server exposes a small set of MCP actions that are suitable for LLMs and programmatic clients.
| Action | Endpoint | Description | Output |
|---|---|---|---|
| search_arxiv | POST /mcp | Natural-language search; accepts query, limit, and filters | JSON list of paper metadata |
| fetch_paper | POST /mcp | Fetch detailed metadata for a single arXiv ID | Full metadata + canonical PDF URL |
| fetch_pdf | GET /pdf/{arxiv_id} | Proxy or redirect to the paper PDF | application/pdf or redirect |
Example MCP action request (HTTP JSON):
Example response snippet:
Use Cases
Assistant-powered literature search
- An LLM acting as a research assistant can call search_arxiv with a user query like: “Find recent survey papers on graph neural networks and their benchmarks.” The server returns a concise list with PDF links the assistant can present or summarize.
Automated ingestion pipeline
- Periodic processes can call search_arxiv with topic filters (e.g., “zero-shot learning 2023”) and store metadata and PDFs in a document store for embeddings and retrieval-augmented generation.
Citation and reading list generator
- A web app that builds reading lists can call fetch_paper for specific IDs to retrieve canonical metadata and direct PDF URLs to present to users.
Hybrid search UI
- Combine semantic filtering in an LLM with precise arXiv queries from the server to provide fast, relevant search results without complex query generation in the model prompt.
Concrete example using curl:
Tips & Troubleshooting
- Rate limiting: if you see errors or truncated results, reduce request frequency or increase CACHE_TTL.
- Query tuning: natural-language queries map to arXiv query syntax; adding keywords like “author:” or “cat:” in the query can improve precision.
- Logs: enable verbose logging (LOG_LEVEL=debug) to see generated arXiv queries and API responses.
- Security: if exposing the server publicly, place it behind an authenticated proxy or restrict IPs to avoid abuse.
This MCP server aims to remove the friction of translating natural language into precise arXiv requests, making it straightforward to add paper discovery and retrieval to LLM agents and developer tools.