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 installrequired, 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
- Agent-native CLI:
- JSON envelope to stdout.
- NDJSON progress streams to stderr for batch monitoring.
- Typed exit codes:
0success,1general error,3partial success,4no 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-onlyat most once per 24 hours, throttled via a<skill_dir>/.last_updatefile. Fast-forward only, safe by default, can be disabled. - 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
%PDFmagic bytes post-download to fail cleanly on publisher HTML redirects. - Optional institutional proxy support via
PAPER_FETCH_INSTITUTIONAL=1. - 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/(withopenai.yamlsidecar) - SkillsMP indexed.
- 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.
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.
Security and Legal Posture
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:
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
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.