Labsco
cyanheads logo

arxiv-mcp-server

β˜… 1

from cyanheads

arXiv paper search and full-text reading

πŸ”₯πŸ”₯πŸ”₯πŸ”₯βœ“ VerifiedFreeAdvanced setup
<div align="center"> <h1>@cyanheads/arxiv-mcp-server</h1> <p><b>Search arXiv, fetch paper metadata, and read full-text content via MCP. STDIO or Streamable HTTP.</b> <div>4 Tools β€’ 2 Resources</div> </p> </div> <div align="center">

Version License Docker MCP SDK npm TypeScript

</div> <div align="center">

Install in Claude Desktop Install in Cursor Install in VS Code

Framework

</div> <div align="center">

Public Hosted Server: https://arxiv.caseyjhand.com/mcp

</div>

Tools

Four tools for searching and reading arXiv papers:

Tool NameDescription
arxiv_searchSearch arXiv papers by query with category and sort filters.
arxiv_get_metadataGet full metadata for one or more arXiv papers by ID.
arxiv_read_paperFetch the full text content of an arXiv paper from its HTML rendering.
arxiv_list_categoriesList arXiv category taxonomy, optionally filtered by group.

arxiv_search

Search for papers using free-text queries with field prefixes and boolean operators.

  • Field prefixes: ti: (title), au: (author), abs: (abstract), cat: (category), all: (all fields)
  • Boolean operators: AND, OR, ANDNOT
  • Optional category filter, sorting (relevance, submitted, updated), and pagination
  • Returns up to 50 results per request with full metadata including abstract

arxiv_get_metadata

Fetch full metadata for one or more papers by known arXiv ID.

  • Batch fetch up to 10 papers in a single request
  • Accepts both versioned (2401.12345v2) and unversioned (2401.12345) IDs
  • Legacy ID format supported (hep-th/9901001)
  • Reports not-found IDs separately from found papers

arxiv_read_paper

Read the full HTML content of an arXiv paper.

  • Tries native arXiv HTML first, falls back to ar5iv for broader coverage
  • Strips HTML head/boilerplate and collapses MathML to dollar-delimited LaTeX ($…$ inline, $$…$$ block) so the character budget targets paper content
  • max_characters defaults to 100,000; raw HTML can be 500KB-3MB+ for math-heavy papers
  • Returns raw HTML β€” no parsing or extraction; the LLM interprets content directly

arxiv_list_categories

List arXiv category codes and names for discovery.

  • ~155 categories across 8 top-level groups (cs, math, physics, q-bio, q-fin, stat, eess, econ)
  • Optional group filter to narrow results
  • Static data β€” always succeeds

Resources

URI PatternDescription
arxiv://paper/{paperId}Paper metadata by arXiv ID.
arxiv://categoriesFull arXiv category taxonomy.

Features

Built on @cyanheads/mcp-ts-core:

  • Declarative tool definitions β€” single file per tool, framework handles registration and validation
  • Unified error handling across all tools
  • Pluggable auth (none, jwt, oauth)
  • Structured logging with optional OpenTelemetry tracing
  • Runs locally (stdio/HTTP) from the same codebase

arXiv-specific:

  • Read-only, no authentication required β€” arXiv API is free, metadata is CC0
  • Rate-limited request queue enforcing arXiv's 3-second crawl delay
  • Adaptive cooldown on rate-limit (5s β†’ 10s β†’ 20s β†’ 30s), honors Retry-After
  • Retry with exponential backoff for transient failures
  • HTML content fallback chain: native arXiv HTML β†’ ar5iv
  • Full arXiv category taxonomy embedded as static data
  • Optional local OAI-PMH metadata mirror (SQLite + FTS5) β€” opt-in, eliminates rate-limit exposure for arxiv_search and arxiv_get_metadata. See Optional: Local Mirror.

Project Structure

DirectoryPurpose
src/mcp-server/tools/definitions/Tool definitions (*.tool.ts).
src/mcp-server/resources/definitions/Resource definitions (*.resource.ts).
src/services/arxiv/ArxivService β€” live arXiv API client (search, metadata, HTML).
src/services/arxiv/mirror/Optional OAI-PMH mirror β€” harvester, SQLite + FTS5 store, query translator, runner.
src/config/Environment variable parsing and validation with Zod.
scripts/arxiv-mirror-*.tsMirror lifecycle scripts (init, refresh, verify).
tests/Unit and integration tests.
docs/Design document and directory structure.

Development Guide

See CLAUDE.md for development guidelines and architectural rules. The short version:

  • Handlers throw, framework catches β€” no try/catch in tool logic
  • Use ctx.log for domain-specific logging
  • Rate limiting is managed by ArxivService β€” don't add per-tool delays
  • arXiv API returns HTTP 200 for everything β€” check content-type and response body