papervpn-mcp
This MCP server lets an AI agent download paywalled academic papers through the Hainan University WebVPN using your existing authenticated session.
download_paper: Download a single paper PDF from a WebVPN URL, publisher URL, or DOI, optionally specifying a filename or output directory.
download_papers: Download multiple papers sequentially with polite delays, with a configurable max per run (default 10) and output directory.
check_session: Verify whether the current WebVPN session is still authenticated, so you know when re-login is needed.
Enables downloading papers from Elsevier ScienceDirect through the institution's WebVPN, handling pdfDownload/pdfft endpoints and JavaScript challenges via a real browser.
Enables downloading papers from IEEE Xplore through the institution's WebVPN, including IEEE /document/ URLs and stamp/stamp.jsp PDF endpoints.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@papervpn-mcp download the paper with DOI 10.1016/j.jare.2020.03.005 to ./papers"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
papervpn
Fetch papers you are institutionally entitled to read — IEEE Xplore,
Elsevier ScienceDirect, and other publishers Hainan University subscribes to —
through the university's WebVPN (webvpn.hainanu.edu.cn).
It works as a CLI, as an MCP server for AI agents, and as a bundled skill for opencode / Codex / Claude Code / the DeepSeek harness.
It downloads one paper at a time, with polite delays, and never bypasses a paywall the institution does not have — it only automates access the user already has.
How it works
The Hainan WebVPN is a 网瑞达 / Wengine gateway. A proxied URL looks like
https://webvpn.hainanu.edu.cn/https/<TOKEN>/<original-path>where TOKEN = IV(16 bytes) + AES-CFB(hostname) and is deterministic per host.
papervpn:
reuses your browser's authenticated
wengine_vpn_ticketsession;builds/reuses the per-host token (and can regenerate tokens for new hosts after reading
wrdvpnKey/wrdvpnIVfrom the portal's/user/info);rewrites the publisher page into its real PDF endpoint — IEEE
stamp/stamp.jsp→stampPDF/getPDF.jsp, ScienceDirect"pdfDownload"→pdfft(clearing the JS challenge with a real Chrome window);saves the PDF, de-duplicates, and throttles.
Related MCP server: Paper Access MCP
Requirements
Python ≥ 3.10,
requests,cryptography.Optional:
playwright(ScienceDirect),secretstorage(renew the session from the browser keyring).An existing, logged-in WebVPN session in a local browser.
Install
pip install --user --break-system-packages -e .
# or just run the launchers in skill/papervpn/scripts/Install the agent skill. By default it goes to ~/.agents/skills, the shared
directory that opencode, Codex, Claude Code and dsh all read — one copy covers
them all:
./install_skill.sh # -> ~/.agents/skills (default)
./install_skill.sh -a codex,dsh # or pick specific agents (multi-select)
./install_skill.sh --all # install to every known agent
./install_skill.sh --list # show install status
./install_skill.sh -r --all # remove from everywhereQuick start
papervpn check # authenticated: True ?
papervpn login --from-chrome # import the live ticket from your browser
papervpn download "10.1016/j.jare.2020.03.005" # saves into the current directory
papervpn download "https://ieeexplore.ieee.org/document/11376648" -o some/dirAccepted inputs: WebVPN URLs, publisher URLs, IEEE /document/<arnumber>
URLs, DOIs, and ScienceDirect PIIs.
CLI
Command | Purpose |
| Validate the session; prints the token/key status |
| Authenticate: |
| Download PDFs ( |
| Read |
| Inspect / extend the per-host token cache |
Download politeness: serial, 3–8 s random delay, de-duplicated history,
--max 10 per run, hard cap 50 items.
When the session expires
wengine_vpn_ticket is short-lived. When check reports
authenticated: False, renew it — no password needed if the browser is still
logged in:
papervpn login --from-chromeThis reads the live ticket from Chrome/Chromium (keyring via secretstorage)
or Firefox (plaintext) and saves it to ~/.papervpn/cookies.json. Fallbacks:
papervpn login --cookie "<browser 'Copy as cURL'>"
papervpn login --cookie "wengine_vpn_ticket=...; route=..."
papervpn login # open a browser and log in by handMCP server
papervpn-mcp speaks stdio MCP and exposes download_paper,
download_papers, and check_session.
// opencode ~/.config/opencode/opencode.jsonc
"mcp": { "papervpn": { "type": "local", "command": ["papervpn-mcp"], "enabled": true } }# Codex ~/.codex/config.toml
[mcp_servers.papervpn]
command = "papervpn-mcp"
tool_timeout_sec = 900Give the client a generous tool timeout: a ScienceDirect fetch drives a real
browser and can take ~60–120 s. Downloads default to the current working
directory; if you pass output_dir, keep it inside the project (not a
sandbox-private /tmp).
Configuration
State lives in ~/.papervpn/ (cookies, token cache, download history) and is
independent of the working directory, so the CLI and MCP server share one
session.
Env var | Meaning |
| State directory (default |
| Default download directory (default: current working directory) |
| WebVPN host (default |
| Override the host-token codec key/IV |
| Source tree used by the skill launchers |
Troubleshooting
Symptom | Fix |
|
|
| Throttled — wait a few minutes and retry one paper with |
| Open the host once through the WebVPN, then |
IEEE | Re-login and retry a single paper |
ScienceDirect returns HTML, not PDF | Chrome must be available; run with a display ( |
Legal & acceptable use
Use only your own institutional entitlement, for personal reading. Download one paper at a time; do not mass-download, redistribute, or attempt to access content the university does not subscribe to. This tool automates a logged-in session that the user controls; it never asks for or stores an account password, one-time code, or CAPTCHA answer.
License
Available Tools
3 toolscheck_sessionA
Report whether the current WebVPN session is authenticated.
Inputs: no named parameters.
download_paperA
Download a single paywalled paper PDF through the Hainan University WebVPN. Accepts a WebVPN-proxied URL (https://webvpn.hainanu.edu.cn/https/...), a publisher URL, or a DOI. Downloads slowly and one at a time.
Inputs: url (required), filename, output_dir.
download_papersA
Download several papers sequentially with polite delays. Refuses large batches.
Inputs: urls (required), max, output_dir.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
download_paper and download_papers are distinct by singular vs plural, and check_session is clearly different. Minor risk of confusion between single and batch download, but descriptions clarify the difference.
All tools use snake_case with a verb_noun pattern (download_paper, download_papers, check_session). The convention is consistent and predictable.
Three tools cover the core functions: single download, batch download, and session check. The count is well-scoped for the narrow purpose of downloading paywalled papers via WebVPN.
The set lacks a tool to initiate or refresh authentication, leaving a dead end if check_session reports unauthenticated. Core download operations are present, but the auth lifecycle is incomplete.
Maintenance
Related MCP Connectors
MCP tools for AI agents: render URLs to image/PDF, check link health, convert HTML/CSV/JSON.
Stealth web browser for agents: search, fetch, click, download and type in persistent MCP sessions.
Convert PDF documents to Markdown for AI agents through an authenticated remote MCP server.
Web scraping, browser automation, screenshots and AI data extraction for AI agents via MCP.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to download, index, and semantically search PDF research papers using 8 MCP tools.48 PyPI5GPL 3.0
- FlicenseNot gradedqualityDmaintenanceLocal MCP server that enables downloading papers from arXiv, OpenReview, INFORMS, and Wiley by reusing your Chrome login state.1-
- FlicenseAqualityDmaintenanceEnables AI agents to search, read, and cite Chinese academic papers from CNKI using HUST single sign-on, with support for full-text retrieval, BibTeX export, and PDF download.74-
- AlicenseAqualityBmaintenanceEnables AI agents to search 1m+ open-access papers, standards, textbooks, and legal documents, resolve identifiers such as RFCs, DOIs, and legal citations, download PDFs, and retrieve citations and metadata through MCP tools.9MIT