English static mirror for SEO/GEO · AI-assisted translation · Read Chinese original

paper-fetch: A Zero-Dependency, Agent-Native Tool for Legal Open-Access PDF Retrieval

Forum topic · 小凯 · 2026-05-07

Summary

paper-fetch is an open-source, MIT-licensed skill built by Agents365-ai that gives AI agents a reliable way to fetch academic PDFs by DOI. Written in pure Python standard library with zero third-party dependencies, it runs anywhere Python 3.8+ is available, including containerized or sandboxed agent environments. Its six-source fallback chain queries Unpaywall, Semantic Scholar, arXiv, PubMed Central, bioRxiv/medRxiv, and optionally Sci-Hub mirrors, achieving broad coverage across STEM and humanities. The CLI is designed for machines, not humans: structured JSON on stdout, NDJSON progress streams on stderr, typed exit codes (0, 1, 3, 4), idempotency-key caching, schema self-description, and TTY-aware formatting. Security features include domain whitelisting, a 50 MB file cap, SSRF defenses, and PDF magic-number validation. Distribution as a SKILL.md plugin supports Claude Code, OpenClaw, Hermes, pi-mono, OpenAI Codex, and SkillsMP. This article reviews design, competitive comparison, and limitations.

paper-fetch: A Zero-Dependency, Agent-Native Tool for Legal Open-Access PDF Retrieval

Overview

paper-fetch is an open-source Agent Skill maintained by Agents365-ai that solves a foundational problem in AI-driven research: reliably obtaining legal open-access (OA) PDFs for AI agents. Given a DOI, it returns a PDF envelope to the caller. The project is MIT-licensed, currently holds 83 stars and 6 forks, and implements the entire toolchain using only the Python standard library (Python 3.8+).

Key Design Points

  • Zero-dependency philosophy: Implemented entirely with Python's standard library. No pip install required, making it portable to containers, sandboxes, and offline agent environments where dependency installation may fail.
  • Six-source fallback chain queried in priority order:
  • 1. Unpaywall — highest cross-disciplinary coverage via Crossref. 2. Semantic Scholar — uses openAccessPdf and externalIds cross-references. 3. arXiv — physics, math, CS, statistics, economics, EE preprints. 4. PubMed Central (PMC) — biomedical full-text repository. 5. bioRxiv / medRxiv — DOI prefix 10.1101/ handling. 6. Sci-Hub mirrors — last-resort fallback, disabled via PAPER_FETCH_NO_SCIHUB=1. When no legal OA source is available, the tool returns metadata rather than bypassing paywalls.
  • Agent-native CLI:
  • JSON envelope to stdout.
  • NDJSON progress streams to stderr for batch monitoring.
  • Typed exit codes: 0 success, 1 general error, 3 partial success, 4 no result.
  • Idempotency-key caching (--idempotency-key) for replayable batch results.
  • Schema introspection: scripts/fetch.py schema --pretty.
  • TTY-aware output (human-readable vs. JSON, auto-detected).
  • Self-update mechanism: Auto-runs git pull --ff-only at most once per 24 hours, throttled via a <skill_dir>/.last_update file. Fast-forward only, safe by default, can be disabled.
  • Security and Legal Posture

  • Strictly legal OA retrieval only; refuses to bypass paywalls.
  • Domain whitelist for all download URLs.
  • 50 MB per-file size cap.
  • SSRF defenses: rejects private IPs, non-HTTP(S) schemes, ports outside 80/443, and cloud-metadata hostnames.
  • Validates %PDF magic bytes post-download to fail cleanly on publisher HTML redirects.
  • Optional institutional proxy support via PAPER_FETCH_INSTITUTIONAL=1.
  • Competitive Comparison

    | Tool | Dependencies | Agent-Native | Multi-Source | Legal OA | Batch | Self-Update | |---|---|---|---|---|---|---| | paper-fetch | None | Yes | 6 sources | Whitelisted | Yes | Yes | | unpywall | pandas | No | 1 source | Yes | No | No | | PyPaperBot | Light | No | Sci-Hub-centric | Grey area | No | No | | PyPaperRetriever | Medium | No | 3 sources | Yes | Yes | No | | hcss-utils/unpaywall | Python + Java + Bash | No | 1 source | Yes | No | No |

    Distribution and Ecosystem

    The skill ships as a portable SKILL.md plugin supporting multiple platforms:

  • Claude Code: ~/.claude/skills/paper-fetch/
  • OpenClaw / ClawHub: clawhub install paper-fetch
  • Hermes Agent: ~/.hermes/skills/research/
  • pi-mono: ~/.pimo/skills/paper-fetch/
  • OpenAI Codex: ~/.agents/skills/paper-fetch/ (with openai.yaml sidecar)
  • SkillsMP indexed.
  • Agents365-ai maintains a broader agent-tooling ecosystem using the same SKILL.md pattern, including podcast-skill, drawio-skill, zotero-skill, asta-skill, and excalidraw-skill.

    Honest Limitations

  • No institutional authentication beyond optional proxy toggle.
  • DOI-centric only; no title/keyword search.
  • Coverage bounded by available legal OA; honest failure is by design.
  • PDF download only; no parsing, summarization, or vectorization — must be paired with downstream tools such as GROBID, LLM summarizers, or Zotero.

References

1. Agents365-ai. paper-fetch. GitHub. https://github.com/Agents365-ai/paper-fetch 2. Agents365-ai. paper-fetch project page. https://agents365-ai.github.io/paper-fetch/ 3. Awesome Skills. paper-fetch skill index. https://www.awesomeskills.dev/en/skill/agents365-ai-paper-fetch 4. unpywall. unpywall GitHub repository. https://github.com/unpywall/unpywall 5. PyPaperRetriever. Journal of Open Source Software 08135.

Tags

#ai-agents#open-access#paper-fetch#doi#pdf-retrieval#python-stdlib#agent-skills#scholarly-tools

This page is an English static mirror generated for search and AI citation. It may be a full translation or structured summary of the Chinese original. Canonical interactive discussion lives on the Chinese page: https://zhichai.net/topic/177619554