Skip to main content

Standalone MCP server: deterministic paper identity resolution + PDF retrieval

Project description

paper-tools (MCP)

A standalone MCP server that turns "find a paper" into a deterministic capability. Two tools:

  • resolve_paper(query) — any input (DOI, arXiv id/URL, SSRN, a bare title, a messy citation string) → decide whether it points to one real paper and return that paper's unique identifier (DOI, else OpenAlex Work ID), or ambiguous / not_found. Never guesses a binding.
  • get_pdf(ids) — that identifier → actually downloads the open-access PDF, trying arXiv → Unpaywall → OpenAlex OA/green/SSRN. Returns the saved path, or an honest downloadable=false with human follow-up leads (SSRN, OA Button) when no open-access copy exists.

Built by an unattended Ralph loop from GOAL.md. Status and remaining work live in PROGRESS.md. This project is fully independent — it has no dependency on any other repository.

Setup

conda env create -f environment.yml
conda activate paper-tools-mcp
pytest -q            # offline golden-set suite
pytest -q -m live    # live smoke (hits real APIs)

Institutional access (your own subscription)

When a paper has no open-access copy, get_pdf tries the caller's own subscription (disable with institutional=False). Two legitimate mechanisms:

  • Elsevier full-text API (covers 10.1016/...): export your own key — export ELSERVIER_API_KEY=... (optional ELSERVIER_INSTTOKEN=...). Uses the Elsevier Article Retrieval API, entitled via your institutional network/token.

  • Publisher fetch (curl_cffi): follows the DOI to the publisher and grabs the PDF; works for publishers that grant access by IP when run on campus/VPN.

  • Your Chrome login cookies (curl_cffi): the publisher fetch reuses your existing Chrome session via browser_cookie3 — stay logged into the publishers in Chrome. Works for publishers without a JS bot-wall. Disable with PAPER_TOOLS_NO_BROWSER_COOKIES=1.

  • Strong layer (opt-in): one-click institutional fetch for publishers behind a Cloudflare human-check + SSO (SAGE → POMS/JMR/JM, OUP → JCR, INFORMS). Enable with PAPER_TOOLS_INTERACTIVE=1 (needs a desktop display + patchright install chromium). When the automated cascade can't get a gated paper, get_pdf pops ONE browser window — already seeded with your Chrome login cookies — you clear the one-time "are you human" check (and sign in if needed) once per publisher, and the tool downloads that paper and reuses the session for every later paper from the same publisher. The human check is solved by you (never auto-defeated); everything else is automatic.

Install = environment solved (no manual setup)

Installing the package pulls all Python dependencies; the chromium browser for the strong layer auto-installs on first use — no separate conda/pip/ patchright install steps.

Zero-setup registration (uv creates an isolated env and installs on first run):

// .mcp.json
{
  "mcpServers": {
    "paper-tools": {
      "command": "uvx",
      "args": ["--from", "git+https://github.com/<you>/paper-tools-mcp", "paper-tools-mcp"],
      "env": { "PAPER_TOOLS_INTERACTIVE": "1", "ELSERVIER_API_KEY": "<optional>" }
    }
  }
}

Or with pip: pip install git+https://github.com/<you>/paper-tools-mcp then use "command": "paper-tools-mcp". (A desktop display is required only for the strong interactive layer; the OA/API layers run anywhere.)

Cross-platform: Linux, macOS, and Windows. The OA/API layers run anywhere. The strong interactive layer uses your local Chrome cookies (browser_cookie3 decrypts per-OS: Linux keyring / macOS Keychain / Windows DPAPI) and pops a desktop window, so it needs a logged-in Chrome + a desktop session. Launch flags are auto-selected per OS (--no-sandbox only on Linux). Note: very recent Chrome on Windows uses app-bound cookie encryption that browser_cookie3 may not read — sign in once in the popped window if cookie reuse misses.

Register with Claude Code (dev / conda)

// .mcp.json / Claude Code MCP config
{
  "mcpServers": {
    "paper-tools": {
      "command": "conda",
      "args": ["run", "-n", "paper-tools-mcp", "python", "-m", "paper_tools.server"]
    }
  }
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

paper_tools_mcp-0.1.0.tar.gz (21.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

paper_tools_mcp-0.1.0-py3-none-any.whl (19.2 kB view details)

Uploaded Python 3

File details

Details for the file paper_tools_mcp-0.1.0.tar.gz.

File metadata

  • Download URL: paper_tools_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 21.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for paper_tools_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 69cec9090dba1304a38a34f043c28c2e38e424aac0c380ea68d557d3ea00babd
MD5 7c6045b33d717f56b113028c64a1a20b
BLAKE2b-256 c04ace183c06998773cbf79830e7473c5ebebf4fc42f7057dcf0b5b809906c86

See more details on using hashes here.

Provenance

The following attestation bundles were made for paper_tools_mcp-0.1.0.tar.gz:

Publisher: publish.yml on zhangsh1416/paper-tools-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file paper_tools_mcp-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: paper_tools_mcp-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 19.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for paper_tools_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 863cabb20196eebdaa7b208e188447c93d6ad45512b6b06556c4584195146ab1
MD5 e4f5580f34fd9eadb24f2fe26d8e3a0d
BLAKE2b-256 bc705e0ce779d4ab73a75734f3f606479258f48aa810b938ef2c0edae9f55ba2

See more details on using hashes here.

Provenance

The following attestation bundles were made for paper_tools_mcp-0.1.0-py3-none-any.whl:

Publisher: publish.yml on zhangsh1416/paper-tools-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page