ZotLink - 智能学术文献管理 MCP 服务器
Project description
🔗 ZotLink
A lightweight, production-ready MCP server that brings open scholarly sources into Zotero with one command.
❤️ Like ZotLink? Give it a star 🌟 to support the development!
✨ Core Features
- 🌐 Open Preprint Coverage: arXiv, CVF (OpenAccess), bioRxiv, medRxiv, chemRxiv
- 🧠 Rich Metadata Extraction: title, authors, abstract, DOI, subjects, comments
- 📄 Smart PDF Attachment: auto-attach when available; validated link fallback
- 📚 One-Click Collection Save: list + save (updateSession, treeViewID: C{id})
- 🧭 Adaptive Browser Strategy: Playwright for tough sites; HTTP for the rest
- 💻 Client Compatibility: Works with Claude Desktop and Cherry Studio
- 🧩 Deep MCP Interoperability: Integrates with literature-related MCPs such as arxiv-mcp-server and Zotero MCP
- 📝 Unified Logging:
~/.zotlink/zotlink.log
🚀 Quick Start
Install
Install from PyPI (recommended)
pip install zotlink
Now includes full browser support for all preprint servers by default!
Development installation
macOS (zsh)
pip install -e .
Windows (CMD/PowerShell)
pip install -e .
Linux (bash)
pip install -e .
Requires Python 3.10+. Includes browser-driven extraction for all preprint servers. After installation, run:
python -m playwright install chromium
Run
CLI (recommended):
zotlink
Development mode:
python run_server.py
MCP Integration (Claude Desktop)
Recommended configuration (simple - just specify Zotero directory):
{
"mcpServers": {
"zotlink": {
"command": "/path/to/zotlink",
"args": [],
"env": {
"ZOTLINK_ZOTERO_ROOT": "/Users/yourname/Zotero"
}
}
}
}
Advanced configuration (specify paths separately):
{
"mcpServers": {
"zotlink": {
"command": "/path/to/zotlink",
"args": [],
"env": {
"ZOTLINK_ZOTERO_DB": "/Users/yourname/Zotero/zotero.sqlite",
"ZOTLINK_ZOTERO_DIR": "/Users/yourname/Zotero/storage"
}
}
}
}
Minimal config (auto-detect Zotero paths):
{
"mcpServers": {
"zotlink": { "command": "zotlink", "args": [] }
}
}
Fallback (explicit Python path):
{
"mcpServers": {
"zotlink": {
"command": "/full/path/to/python",
"args": ["-m", "zotlink.zotero_mcp_server"],
"env": {
"ZOTLINK_ZOTERO_ROOT": "/Users/yourname/Zotero"
}
}
}
}
Claude config file locations:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Linux:
~/.config/claude/claude_desktop_config.json - Windows:
~/AppData/Roaming/Claude/claude_desktop_config.json
Note: Using env variables follows MCP standard and works with all MCP clients (Claude Desktop, Cherry Studio, etc.).
🧰 Available Tools
check_zotero_status: Check if Zotero is running and reachableget_zotero_collections: List collections (tree view) from the local DBsave_paper_to_zotero: Save a paper by URL (arXiv/CVF/rxiv), attach PDF/metadataextract_arxiv_metadata: Extract full arXiv metadata (title/authors/subjects/DOI/comment)- Cookie helpers (stubs prepared) for auth-required sources
📁 Logging
Logs are written to ~/.zotlink/zotlink.log.
🌐 Browser Mode (Included)
Browser-driven extraction is now included by default! All preprint servers (bioRxiv, medRxiv, chemRxiv) work automatically. After installation, initialize the browser runtime:
macOS (zsh) — development install
pip install -e .
Windows (CMD/PowerShell) — development install
pip install -e .
Linux (bash) — development install
pip install -e .
Install browser runtime
python -m playwright install chromium
Linux may require system dependencies
sudo apt-get install -y libnss3 libatk1.0-0 libatk-bridge2.0-0 libdrm2 libxkbcommon0 libgbm1 libasound2
The server will switch to a browser strategy automatically when needed.
Optional: Custom Zotero Paths (DB/Storage)
You can override the local Zotero database path and storage dir. Precedence: ENV vars > Claude config > local config file > defaults.
- Environment variables (highest priority)
Recommended - Single directory:
- macOS/Linux (bash/zsh)
export ZOTLINK_ZOTERO_ROOT=/Users/yourname/Zotero
- Windows (PowerShell)
$env:ZOTLINK_ZOTERO_ROOT='C:\\Users\\YourName\\Zotero'
Advanced - Separate paths (backward compatibility):
- macOS/Linux (bash/zsh)
export ZOTLINK_ZOTERO_DB=/Users/yourname/Zotero/zotero.sqlite
export ZOTLINK_ZOTERO_DIR=/Users/yourname/Zotero/storage
- Windows (PowerShell)
$env:ZOTLINK_ZOTERO_DB='C:\\Users\\YourName\\Zotero\\zotero.sqlite'
$env:ZOTLINK_ZOTERO_DIR='C:\\Users\\YourName\\Zotero\\storage'
- Claude configuration (recommended for MCP users)
Add Zotero paths directly to your Claude configuration file:
{
"mcpServers": {
"zotlink": {
"command": "path/to/zotlink",
"args": [],
"zotero_database_path": "/Users/yourname/Zotero/zotero.sqlite",
"zotero_storage_dir": "/Users/yourname/Zotero/storage"
}
}
}
Claude config file locations:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Linux:
~/.config/claude/claude_desktop_config.json - Windows:
~/AppData/Roaming/Claude/claude_desktop_config.json
- Local config file (traditional method)
Create ~/.zotlink/config.json:
{
"zotero": {
"database_path": "/Users/yourname/Zotero/zotero.sqlite",
"storage_dir": "/Users/yourname/Zotero/storage"
}
}
Default search locations when not configured:
- macOS:
~/Zotero/zotero.sqliteor~/Library/Application Support/Zotero/Profiles/<profile>/zotero.sqlite - Windows:
C:\\Users\\<User>\\Zotero\\zotero.sqliteor%APPDATA%\\Zotero\\Zotero\\Profiles\\<profile>\\zotero.sqlite - Linux:
~/Zotero/zotero.sqliteor~/.zotero/zotero.sqlite
Restart ZotLink after changing configuration.
🧩 Supported Sources (Open)
- arXiv (preprint)
- CVF (OpenAccess) (CVPR/ICCV/WACV)
- bioRxiv / medRxiv / chemRxiv (preprint servers)
Auth-required sources (e.g., Nature) are planned via bookmark-based cookie sync.
🧰 Troubleshooting
- Zotero not detected: ensure Zotero Desktop is running (port 23119)
- No PDF attached: some pages only expose links; the server falls back to link attachments
- Browser mode errors: verify Playwright is installed and Chromium is available
- Install error: ensure Python 3.10+ is installed
🧪 Development
pip install -e .
python -m playwright install chromium
zotlink # or: python run_server.py
See docs/DEVELOPMENT.md for code structure, adding new extractors, and release tips.
🗺️ Roadmap (To‑Do)
-
Sources
- arXiv
- CVF (OpenAccess)
- bioRxiv
- medRxiv
- chemRxiv
- Nature (cookies)
- Science (cookies)
- IEEE Xplore (cookies)
- Springer (cookies)
- ACM Digital Library (cookies)
- OpenReview
- PLOS / PMC / Frontiers / MDPI
-
Stability & Quality
- Configurable Zotero DB path (ENV + ~/.zotlink/config.json)
- Windows browser-mode hardening (headful, retries, anti-bot, graceful fallback)
- Post-save title correction when placeholder detected
- Enhanced PDF heuristics and alternative URL strategies
- Crossref DOI enrichment as fallback
- Unified error taxonomy with auto-retry/backoff
-
Integration & DX
- Cookie sync bookmark flow for Nature-family and other publishers
- Example templates for Claude Desktop / Cherry Studio
- Extended MCP interoperability docs and samples
- CI and tests (unit/integration) for extractors
- Packaged releases (optional)
📄 License
MIT (see SPDX identifier in packaging metadata)
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file zotlink-1.3.4.tar.gz.
File metadata
- Download URL: zotlink-1.3.4.tar.gz
- Upload date:
- Size: 88.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
75d8cbbd059742e5a36718a7025d9d3fa9acc7590270acbcae30f5985f7b1db9
|
|
| MD5 |
364f3df83d65f59ede3ca69a7f5567f2
|
|
| BLAKE2b-256 |
3dad2dc2d6abedf85b459fd2d11c7b27fe6c4e55e98ee69331dde673953ec642
|
File details
Details for the file zotlink-1.3.4-py3-none-any.whl.
File metadata
- Download URL: zotlink-1.3.4-py3-none-any.whl
- Upload date:
- Size: 97.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d22e951081b710ff0c404472f2de09f2073dd0fb5992d616c2fca088f6ffa0b0
|
|
| MD5 |
6d3666a8d3ae35dea5a4cb5ace3667f1
|
|
| BLAKE2b-256 |
f64e587af941fe1dfb6b1d336605e2ef23e0b24232c68e64b732a5bc5c366ecd
|