Arxiv Mcp Server

io.github.cyanheads由 GitHub 账号 cyanheads 发布v1.8.1更新于 Oct 29, 2026

Search arXiv, fetch paper metadata, and read full-text content.

已验证Streamable HTTP可网页运行网页搜索与抓取知识与记忆

概览

AI 生成的概览

可搜索 arXiv、按 ID 获取论文元数据并阅读全文,让助手能检索和引用预印本论文。

可以做什么
  • 按查询词、字段前缀、分类和提交日期搜索论文,支持排序与分页
  • 每次调用按最多 100 个 arXiv ID 获取元数据,未命中时给出分类原因
  • 通过 arXiv HTML、ar5iv 或 PDF 文本提取读取论文全文,可分页并附章节大纲
  • 列出 arXiv 分类体系,可按顶层分组筛选
  • 以 MCP 资源形式提供论文元数据和分类列表
适用场景
适合助手需要查找、核实或阅读学术预印本的场景,例如文献检索、把引用解析为论文、逐节阅读论文。只读且无需账号,用于研究类工作风险较低。
运行要求
可使用公开托管的 Streamable HTTP 端点,或通过 npx、bunx、Docker 在本地运行;本地运行需 Bun v1.4.0 以上或 Node.js v24 以上。无需认证或 API 密钥,所有配置均为可选,但需要能访问 arXiv 的网络。
安装前请注意
只读且无需认证,不会索取凭据。论文内容取自 arXiv、ar5iv 和 PDF,因此查询词和请求的 ID 会发送给这些第三方。论文内容由作者撰写,应视为数据而非指令。可选的本地镜像会保存 SQLite 数据库,首次抓取耗时数小时。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Arxiv Mcp Server,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Web executable,通过 Streamable HTTP。 远程服务在工作区中配置后即可从网页运行时运行。

交给智能体安装

把这段提示词粘贴到 Claude Code、Codex、Cursor 等智能体,或 SourceWeft 对话中。智能体会读取该服务器的安装指南,先向你展示发布者、端点和登录方式,经你同意后再把它添加到你的客户端。密钥不会写进任何命令。

阅读 https://sourceweft.com/mcp/io.github.cyanheads%2Farxiv-mcp-server/install.md,并按其中说明把这个 MCP 服务器接入我的客户端。修改任何配置之前,先告诉我它的发布者、端点和登录方式,等我确认。不要把 API 密钥写进命令或我会提交的文件;问我密钥应从哪里获取。

查看智能体所依据的安装指南

其他 MCP 客户端

把它添加到你客户端的 mcpServers 配置中。

{
  "mcpServers": {
    "arxiv": {
      "type": "http",
      "url": "https://arxiv.caseyjhand.com/mcp"
    }
  }
}

README

@cyanheads/arxiv-mcp-server

Search arXiv, fetch paper metadata, and read full-text content via MCP. STDIO or Streamable HTTP.

4 Tools • 2 Resources

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


Overview

arXiv papers, metadata, and full text from the arXiv API and its OAI-PMH metadata feed. Search papers by query, category, and submission date; fetch structured metadata by ID; and read full paper text with automatic fallback across HTML and PDF renders. Runs as a stdio process, a local Streamable HTTP server, or the public hosted endpoint above.

Tools

ToolDescription
arxiv_search_papersSearch arXiv papers by query with field prefixes, category, and date filters
arxiv_get_metadataFetch metadata for one or more papers by arXiv ID
arxiv_read_paperRead full paper text via HTML, ar5iv, or PDF-extracted fallback
arxiv_list_categoriesList the arXiv category taxonomy, optionally filtered by group

Resources

ResourceDescription
arxiv://paper/{paperId}Paper metadata by arXiv ID
arxiv://categoriesFull arXiv category taxonomy

Capability reference

arxiv_search_papers tool

  • Query supports field prefixes ti:, au:, abs:, cat:, co:, jr:, all: and AND / OR / ANDNOT, up to 1000 characters; category takes a code (cs.CL) or a whole archive (astro-ph, cs, math)
  • Query grammar follows arXiv's: space-separated terms are joined with OR (write AND to require every term), operators are uppercase only, and all three share one precedence grouped to the right (a AND b OR c is a AND (b OR c)). Quote a multi-word topic ("graph neural networks" AND cat:cs.LG) and put alternatives in parentheses before a filter; arXiv ignores common words such as of and the outside a quoted phrase
  • Sorts by sort_by (relevance / submitted / updated) and sort_order, with submitted_from / submitted_to as inclusive UTC YYYY-MM-DD bounds; up to 50 results per call (a larger max_results returns 50)
  • arXiv serves only the first 10,000 results of a query; a start of 10,000 fails start_beyond_result_limit. Use date windows to go further
  • Output echoes the effective query, total match count, and page offset; empty pages carry recovery guidance instead of an error. A total that is a floor (the local mirror counting to 50,000) carries totalFoundIsLowerBound: true

arxiv_get_metadata tool

  • Takes up to 100 IDs and looks up the first 10 distinct ones; the rest come back in remaining_ids for the next call's paper_ids. An ID repeated in any accepted spelling is looked up once, while different versions of one paper stay separate
  • Accepts versioned (2401.12345v2), unversioned, and pre-2007 (hep-th/9901001) IDs, with an optional arXiv: prefix or an arxiv.org abs / pdf / html URL
  • Returns found papers plus a typed not_found[] (not_in_arxiv / version_not_in_mirror / version_not_served / live_lookup_failed / invalid_id) for the rest; version_not_served is a superseded pre-2007 version arXiv's API answers HTTP 500 for, and its detail names the latest version. With the local mirror, live_lookup_failed marks an ID the mirror lacked whose live lookup failed; the papers the mirror served still come back
  • Fails invalid_id when no ID is well-formed, no_match when every ID misses, version_unavailable when a version is reachable only on the live API, and version_not_served when every ID is a version arXiv will not serve

arxiv_read_paper tool

  • Tries arXiv HTML, then ar5iv, then PDF text extraction; the source field reports which answered. PDF text is plain, so math, tables, and headings flatten
  • ar5iv keeps one render per paper, so an ar5iv body may be another revision than paper_id and carries revision_unconfirmed: true, unless the read named no version and arXiv's API reported v1 as the paper's only version; pdf_url is exactly the paper_id revision
  • max_characters defaults to 100,000 (pass null for the whole paper); page with start. The first page carries an outline of section headings with offsets
  • paper_id accepts the same ID spellings as arxiv_get_metadata
  • Fails invalid_id, no_match (arXiv has no such paper, or no such version of it), content_unavailable (no render, no PDF), pdf_extraction_failed (the PDF has no text layer or does not parse), version_unavailable (version-pinned ID needs the live API), or version_not_served (a superseded pre-2007 version arXiv will not serve; names the latest version and this version's PDF)

arxiv_list_categories tool

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

arxiv://paper/{paperId} resource

  • paperId accepts the same ID spellings as arxiv_get_metadata; percent-encode a legacy ID's slash (arxiv://paper/hep-th%2F9901001)
  • Fails empty_id, invalid_id, no_match, version_unavailable, or version_not_served

arxiv://categories resource

  • Returns { categories: [...] }, a flat array with code / name / group per entry
  • No parameters; cacheable for 24h

Features

Built on @cyanheads/mcp-ts-core: stdio and Streamable HTTP transports, pluggable auth (none / jwt / oauth), swappable storage (in-memory, filesystem, Supabase, Cloudflare KV/R2/D1), structured logging with optional OpenTelemetry tracing.

arXiv-specific:

  • Read-only, no authentication required
  • Request queue enforcing arXiv's 3-second crawl delay; rate-limit responses fail fast with a cooldown
  • Paper text falls back from arXiv HTML to ar5iv to PDF extraction
  • Full arXiv category taxonomy embedded as static data
  • Optional local OAI-PMH metadata mirror (SQLite + FTS5) that removes rate-limit exposure for search and metadata. See Optional: local mirror

Agent-friendly output:

  • arxiv_read_paper names its source; arxiv_search_papers echoes the effective query
  • arxiv_get_metadata returns found papers with a typed not_found[] reason per miss
  • Typed source and not_found[].reason enums let callers branch on data

Getting started

Public Hosted Instance

A public instance is available at https://arxiv.caseyjhand.com/mcp — no installation required. Point any MCP client at it via Streamable HTTP:

json
{  "mcpServers": {    "arxiv-mcp-server": {      "type": "streamable-http",      "url": "https://arxiv.caseyjhand.com/mcp"    }  }}

Self-Hosted / Local

Add the following to your MCP client configuration file.

json
{  "mcpServers": {    "arxiv-mcp-server": {      "type": "stdio",      "command": "bunx",      "args": ["@cyanheads/arxiv-mcp-server@latest"]    }  }}

Or with npx (no Bun required):

json
{  "mcpServers": {    "arxiv-mcp-server": {      "type": "stdio",      "command": "npx",      "args": ["-y", "@cyanheads/arxiv-mcp-server@latest"]    }  }}

Or with Docker:

json
{  "mcpServers": {    "arxiv-mcp-server": {      "type": "stdio",      "command": "docker",      "args": ["run", "-i", "--rm", "-e", "MCP_TRANSPORT_TYPE=stdio", "ghcr.io/cyanheads/arxiv-mcp-server:latest"]    }  }}

For Streamable HTTP, set the transport and start the server:

sh
MCP_TRANSPORT_TYPE=http MCP_HTTP_PORT=3010 bun run start:http# Server listens at http://localhost:3010/mcp

Prerequisites

Installation

  1. Clone the repository:
sh
git clone https://github.com/cyanheads/arxiv-mcp-server.git
  1. Navigate into the directory:
sh
cd arxiv-mcp-server
  1. Install dependencies:
sh
bun install

Configuration

All configuration is optional — the server works out of the box with sensible defaults.

VariableDescriptionDefault
ARXIV_API_BASE_URLarXiv API base URL.https://export.arxiv.org/api
ARXIV_REQUEST_DELAY_MSMinimum delay between arXiv API requests (ms).3000
ARXIV_CONTENT_TIMEOUT_MSTimeout for paper body fetches — HTML renders and PDF downloads (ms).30000
ARXIV_API_TIMEOUT_MSTimeout for API search/metadata requests (ms). With the mirror enabled, also the longest an unversioned arxiv_read_paper waits on its metadata lookup, queue included, before a mirror holding the paper answers.15000
ARXIV_READ_TIMEOUT_MSTime budget for one arxiv_read_paper call — its metadata lookup, every content request and retry, and PDF text extraction (ms). Keep it under your MCP client's request timeout (60 s by default).50000
ARXIV_MIRROR_ENABLEDEnable the local OAI-PMH metadata mirror.false
ARXIV_MIRROR_PATHSQLite path for the mirror../data/arxiv-mirror.db
ARXIV_MIRROR_REFRESH_CRONUTC cron expression for in-process daily refresh (HTTP mode only).unset
ARXIV_MIRROR_FALLBACK_LIVEFall through to the live API on a local ID-lookup miss.true
ARXIV_MIRROR_RECENT_DAYS_LIVEPositive values send sort_by=submitted, descending queries to the live API; 0 disables.2
ARXIV_MIRROR_OAI_BASE_URLarXiv OAI-PMH endpoint base URL.https://oaipmh.arxiv.org/oai
ARXIV_MIRROR_OAI_REQUEST_DELAY_MSMinimum delay between OAI-PMH requests (ms).3000
ARXIV_MIRROR_REFRESH_TIMEOUT_MSTime budget for one scheduled refresh (ms).7200000
MCP_TRANSPORT_TYPETransport: stdio or http.stdio
MCP_HTTP_PORTPort for HTTP server.3010
MCP_SESSION_MODEauto, stateful, or stateless.stateless
MCP_AUTH_MODEAuth mode: none, jwt, or oauth.none
MCP_LOG_LEVELLog level (RFC 5424).info
OTEL_ENABLEDEnable OpenTelemetry instrumentation (spans, metrics, completion logs).false

See .env.example for the full list of optional overrides.

Running the server

Local development

  • Build and run:

    sh
    # One-time buildbun run rebuild
    # Run the built serverbun run start:http# orbun run start:stdio
  • Run checks and tests:

    sh
    bun run devcheck   # Lint, format, typecheck, security auditbun run test       # Vitest test suite

Optional: local mirror

For self-hosted deployments behind one egress IP, an optional SQLite + FTS5 mirror of arXiv's OAI-PMH metadata serves arxiv_search_papers and arxiv_get_metadata locally, so concurrent users stop queueing behind arXiv's 3-second crawl delay; arxiv_read_paper still fetches paper text live. Harvest it once with bun run mirror:init (~4.4h), then set ARXIV_MIRROR_ENABLED=true. Running it from an npm install, scheduling refreshes, schema upgrades, and where mirror search differs from the live API are covered in docs/mirror.md.

Docker

sh
docker build -t arxiv-mcp-server .docker run --rm -p 3010:3010 arxiv-mcp-server

The Dockerfile defaults to HTTP transport, stateless session mode, and logs to /var/log/arxiv-mcp-server. OpenTelemetry peer dependencies are installed by default — build with --build-arg OTEL_ENABLED=false to omit them.

Project structure

DirectoryPurpose
src/index.tscreateApp() entry point — registers tools/resources and starts the optional mirror-refresh scheduler.
src/configServer-specific environment variable parsing and validation with Zod.
src/mcp-server/tools/definitionsTool definitions (*.tool.ts).
src/mcp-server/resources/definitionsResource definitions (*.resource.ts).
src/services/arxivArxivService — live arXiv API client (search, metadata, HTML), and PDF text extraction in a worker thread (pdf-text.ts).
src/services/arxiv/mirrorOptional OAI-PMH mirror — harvester, SQLite + FTS5 store, query translator, runner.
skills/arxiv-guideAgent skill published to agents that install the server, and served over MCP: citation-to-ID resolution, search gates, version and section-by-section reading workflows.
scripts/arxiv-mirror-*.tsMirror lifecycle scripts (init, refresh, verify); scripts/tsconfig.json resolves their @/ imports to src/, or to dist/ in an install.
tests/Unit and integration tests.
docs/Design document, local mirror guide, 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 request-scoped logging, ctx.state for tenant-scoped storage
  • arXiv API returns HTTP 200 for everything — including rate limits — so check content-type and body before parsing
  • Validate raw arXiv responses → normalize to domain types → return the output schema; never fabricate missing fields

Contributing

Issues are welcome. Run checks before submitting:

sh
bun run devcheckbun run test

License

Apache-2.0 — see LICENSE for details.

来源:README.md,提交 50eae3a

工具

4

arxiv_search_papers

Arxiv Search Papers

Search arXiv papers by query with category and sort filters. Returns paper metadata including title, authors, abstract, categories, and links.

输入参数query必填startsort_bycategorysort_ordermax_resultssubmitted_tosubmitted_from

arxiv_get_metadata

Arxiv Get Metadata

Get full metadata for one or more arXiv papers by ID. Use when you have known IDs from citations, prior search results, or memory. Looks up 10 IDs per call; any further IDs come back in remaining_ids for the next call.

输入参数paper_ids必填

arxiv_read_paper

Arxiv Read Paper

Fetch the full text of an arXiv paper. Tries arxiv.org/html first, falls back to ar5iv.labs.arxiv.org, and falls back again to text extracted from the PDF when neither has an HTML render — check the source field to know which one answered. Page through long papers with start and max_characters, or pass max_characters null to get the entire body in one call. To read one section, take the outline from the first page (start 0) and pass an entry's start.

输入参数startpaper_id必填max_characters

arxiv_list_categories

Arxiv List Categories

List arXiv category codes and names. Useful for discovering valid category filters for arxiv_search_papers. Lists subject classes only; arxiv_search_papers also accepts a bare archive code (the part before the dot, e.g. "astro-ph" or "cs") to search a whole archive at once.

输入参数group

版本历史

10
  1. v1.8.1最新Oct 29, 2026
  2. v1.8.0Oct 26, 2026
  3. v1.7.2Oct 25, 2026
  4. v1.7.1Oct 24, 2026
  5. v1.7.0Oct 21, 2026
  6. v1.6.1Oct 19, 2026
  7. v1.6.0Oct 17, 2026
  8. v1.5.4Oct 5, 2026
  9. v1.5.3Sep 19, 2026
  10. v1.5.2Sep 16, 2026

评分

已满足适用检查项的 100%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通必需25 分
  • 已声明认证方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分