Skip to main content

apaper-mcp

An MCP (Model Context Protocol) server that gives AI assistants direct access to academic paper databases. It exposes a unified set of tools for searching and downloading papers across arXiv, IACR ePrint, DBLP, Google Scholar, and CNKI (中国知网), so an MCP-compatible client (Claude Code, Claude Desktop, or any other) can run literature searches, pull BibTeX entries, and fetch PDFs without leaving the chat.

Tools

Tool Source Description
search_arxiv_papers arXiv Search with category, date-range, and sort options
download_arxiv_paper arXiv Download a PDF
search_iacr_papers IACR ePrint Search the ePrint archive
download_iacr_paper IACR ePrint Download a PDF
search_dblp_papers DBLP Search, optionally with BibTeX
search_google_scholar_papers Google Scholar Search
search_cnki_papers CNKI (中国知网) Search
download_cnki_paper CNKI (中国知网) Download a PDF

arXiv tools scrape the public arxiv.org/search/ HTML page, which works on networks where the export.arxiv.org Atom API is blocked or rate-limited. If you need to route through a mirror, set ARXIV_SEARCH_URL, ARXIV_ADVANCED_URL, and/or ARXIV_PDF_BASE.

The arXiv tools throttle themselves and retry HTTP 429 / 5xx with exponential backoff, honouring Retry-After; on a persistent block the error names the throttled IP and wait time. Tune with ARXIV_MIN_INTERVAL_MS (3000), ARXIV_MAX_RETRIES (3), ARXIV_BACKOFF_BASE_MS (3000), ARXIV_BACKOFF_MAX_MS (60000), ARXIV_BACKOFF_JITTER_MS (500), and ARXIV_IP_ECHO_URL ("" to disable the IP lookup).

CNKI tools require institutional access. On IP-based networks the session cookie is obtained automatically on first use — no manual login needed.

IACR ePrint sits behind Cloudflare, which intermittently serves a JS bot challenge, most often on PDF downloads. The download tool uses Scrapling's stealth browser and built-in Cloudflare solver, and only publishes a file after the response bytes validate as a PDF.

Proxy

Set SPIDER_PROXY to route outbound requests — arXiv, IACR, DBLP, Google Scholar, and their PDF downloads — through a proxy. CNKI is excluded on purpose: it authenticates by institutional IP and always uses this host's real address. Both a standard URL and the colon-delimited form some mobile-proxy providers hand out are accepted:

SPIDER_PROXY="socks5://user:pass@host:1086"   # standard
SPIDER_PROXY="socks5://host:1086:user:pass"   # host:port:user:pass (e.g. Kookeey)
SPIDER_PROXY="http://user:pass@host:8080"     # HTTP CONNECT proxy

socks5, socks4, http, and https schemes are supported (the scheme defaults to http when omitted) by the Python runtime. The scheme must match the proxy's port — a SOCKS port won't accept http:// and vice versa. If SPIDER_PROXY is set but invalid or can't be initialised, requests are blocked rather than sent direct, so a misconfigured proxy never leaks this host's real IP.

Flaky residential/mobile proxies routinely drop or refuse connections; idempotent (GET) requests through the proxy are retried automatically on such transient failures. IACR fires the most requests per search (a detail fetch per result), so its per-request timeouts default high for slow proxies — tune with IACR_TIMEOUT_MS (30000) and IACR_DOWNLOAD_TIMEOUT_MS (600000). IACR downloads retry fresh browser sessions three times by default; tune the count with IACR_CAPTCHA_ATTEMPTS.

Install from PyPI

The maintained runtime requires Python 3.12+. The IACR downloader uses Scrapling's bundled Chromium by default. Install its browser runtime, then run the published package directly with uvx:

uvx --from 'scrapling[fetchers]' scrapling install
uvx apaper-mcp

Set IACR_BROWSER_EXECUTABLE to override the browser executable. IACR downloads use a temporary profile with always_open_pdf_externally enabled and capture the browser download directly instead of saving PDF-viewer HTML.

To install the command for repeated use:

uv tool install apaper-mcp
apaper-mcp

For an MCP client, use the published package as the local stdio command:

{
  "mcp": {
    "apaper-mcp": {
      "type": "local",
      "command": ["uvx", "apaper-mcp"],
      "timeout": 900000,
      "enabled": true
    }
  },
  "experimental": {
    "mcp_timeout": 900000
  }
}

The 15-minute timeout is needed for browser-assisted IACR downloads. Some OpenCode versions ignore the per-server value for tool calls, so the global experimental.mcp_timeout fallback is included as well. Quit and restart OpenCode after changing MCP configuration.

Development

Clone the repository and install its development dependencies with uv:

uv sync
uv run apaper-mcp

Install Scrapling's bundled browser with uv run scrapling install.

Run tests with uv run pytest.

The Python source uses a standard src package layout. Platform-specific clients live under src/apaper_mcp/platforms/, while shared server, proxy, formatter, and model code stays in src/apaper_mcp/.

Local MCP testing

Start the MCP Inspector against the Python stdio server:

npx @modelcontextprotocol/inspector uv run --directory . apaper-mcp

The equivalent module command is:

npx @modelcontextprotocol/inspector \
  uv run --directory . python -m apaper_mcp

To pass the proxy to the inspected server:

npx @modelcontextprotocol/inspector \
  -e SPIDER_PROXY="$SPIDER_PROXY" \
  uv run --directory . apaper-mcp

The Inspector opens a local web UI for listing tools, inspecting schemas, and calling tools.

Tool schemas

  • search_arxiv_papers
    • input: { "query": string, "max_results"?: number, "date_from"?: string, "date_to"?: string, "categories"?: string[], "sort_by"?: "relevance" | "date" }
  • download_arxiv_paper
    • input: { "paper_id": string, "save_path"?: string } (paper_id like 2103.12345 or 2103.12345v2)
  • search_iacr_papers
    • input: { "query": string, "max_results"?: number, "fetch_details"?: boolean, "year_min"?: number | string, "year_max"?: number | string }
  • download_iacr_paper
    • input: { "paper_id": string, "save_path"?: string }
  • search_dblp_papers
    • input: { "query": string, "max_results"?: number, "year_from"?: number | string, "year_to"?: number | string, "venue_filter"?: string, "include_bibtex"?: boolean }
  • search_google_scholar_papers
    • input: { "query": string, "max_results"?: number, "year_low"?: number | string, "year_high"?: number | string }
  • search_cnki_papers
    • input: { "query": string, "page_num"?: number, "page_size"?: number }
  • download_cnki_paper
    • input: { "href": string, "save_path"?: string } (use an href from search_cnki_papers)

Metadata

Release files for apaper-mcp 0.3.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for apaper-mcp 0.3.6
File Size Uploaded Provenance Actions
apaper_mcp-0.3.6.tar.gz 99.0 kB With provenance Details for apaper_mcp-0.3.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for apaper-mcp 0.3.6
File Interpreter ABI Platform Actions
apaper_mcp-0.3.6-py3-none-any.whl Python 3 none any Details for apaper_mcp-0.3.6-py3-none-any.whl

Total release size: 123.9 kB

Release files / apaper_mcp-0.3.6.tar.gz

Download URL apaper_mcp-0.3.6.tar.gz
Size 99.0 kB
Tags Source
SHA-256 checksum
How to use checksums
5f63757e1e98d011c2e07969600746b2dc0a2bc8c408a02f104adb2072fb86a2
BLAKE2b-256 checksum
How to use checksums
f06f94331686b4d5e71aa466b8e933f798fcea03175f6eec88850f89aa8c75c7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.

Transparency log

Release files / apaper_mcp-0.3.6-py3-none-any.whl

Download URL apaper_mcp-0.3.6-py3-none-any.whl
Size 24.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7daeccb2c73e14dc30c5acebf62a76bfebeaf9145eeb43fbc0f62a54b83c4160
BLAKE2b-256 checksum
How to use checksums
5d73ae6467df5f4fc781627d10db7a67c84a1b9435b2d260dec4d9b25678409b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.

Transparency log

Security for apaper-mcp 0.3.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for apaper_mcp-0.3.6.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page