mcsci-hub
An MCP server that gives LLMs access to academic literature. Search papers, retrieve metadata, download PDFs, traverse citation graphs, and generate BibTeX -- all through a unified interface backed by four academic data sources.
Built with FastMCP.
search "CRISPR delivery" --> get_paper(doi) --> fetch_pdf(doi) --> [mcp-pdf] --> analyze
How It Works
mcsci-hub aggregates data from multiple academic APIs in parallel, merging results into a single coherent response:
| Source | What it provides | Access |
|---|---|---|
| CrossRef | Authoritative metadata -- title, authors, journal, volume, pages | Free (polite pool) |
| OpenAlex | Abstracts, open access URLs, semantic search | Free (polite pool) |
| Semantic Scholar | Citation counts, influential citations, fields of study, BibTeX | Free (optional API key) |
| Sci-Hub | Paywalled PDF access via mirror scraping | Fallback only |
The strategy: always try open access first. Sci-Hub is a last resort. When any source fails, the others still return what they can (graceful degradation).
Tools
| Tool | Description |
|---|---|
search_papers(query, ...) |
Keyword/topic search via OpenAlex with CrossRef fallback. Filters by year range and open access status. |
get_paper(doi) |
Full metadata from all sources, merged and cached. Returns title, authors, abstract, citation counts, fields of study, OA status. |
fetch_pdf(doi) |
Downloads the PDF: tries OA URL first, then Sci-Hub. Saves locally and hints to use mcp-pdf for parsing. |
get_citations(doi, max_results) |
Forward citations -- papers that cite this one. Includes Semantic Scholar's "influential" flag. |
get_references(doi, max_results) |
Backward references -- papers this one cites. Traces intellectual lineage. |
get_bibtex(doi) |
BibTeX entry from Semantic Scholar, or constructed from CrossRef metadata as fallback. |
Resources
| URI | Description |
|---|---|
scihub://mirrors |
Configured mirror domains and count |
scihub://config |
Full server configuration (cache, timeouts, PDF directory, API key status) |
doi://{prefix}/{suffix} |
Dynamic paper metadata lookup by DOI (e.g. doi://10.1038/nature12373) |
Prompts
| Prompt | Description |
|---|---|
literature_review(topic, depth) |
Guided workflow: search, detail top papers, traverse citations, synthesize. depth='deep' adds PDF analysis via mcp-pdf. |
paper_deep_dive(doi) |
Single paper analysis: metadata, PDF, full-text parsing, citation context. |
extract_findings(doi) |
Focused data extraction from a paper's PDF -- tables, results, conclusions. |
Composability with mcp-pdf
fetch_pdf saves PDFs locally and returns the file path. Tool responses and prompts guide the calling LLM to use mcp-pdf for full-text extraction, creating the pipeline:
search --> fetch --> parse --> analyze
Install mcp-pdf alongside mcsci-hub to unlock the full workflow.
Installation
Requires Python 3.11+.
# Clone and install
git clone git@git.supported.systems:MCP/mcsci-hub.git
cd mcsci-hub
uv sync
# Copy and edit environment config
cp .env.example .env
Add to Claude Code
Two transport modes are supported. Pick HTTP if you run multiple Claude sessions on the same machine, it gives you one shared server across every session (shared cache, shared rate-limit budgets, no per-session subprocess cost). Stdio is simpler and fine for a single user, single session.
HTTP transport (recommended for multi-session use):
# Start the HTTP server in the background (systemd user service, see below)
mcsci-hub --http
# Register with Claude Code (user scope, available in every project)
claude mcp add -s user -t http mcsci-hub http://127.0.0.1:8788/mcp/
Stdio transport (one subprocess per Claude session):
# Local development
claude mcp add mcsci-hub -- uv run --directory /path/to/mcsci-hub mcsci-hub
# From PyPI
claude mcp add mcsci-hub -- uvx mcsci-hub
Running as a persistent HTTP server (systemd user service)
For the HTTP transport, run mcsci-hub --http under systemd so it starts on login and restarts on failure. Drop this at ~/.config/systemd/user/mcsci-hub.service:
[Unit]
Description=mcsci-hub FastMCP server (HTTP transport)
After=network.target
[Service]
Type=simple
ExecStart=/path/to/mcsci-hub/.venv/bin/mcsci-hub --http --host 127.0.0.1 --port 8788
WorkingDirectory=/path/to/mcsci-hub
Restart=on-failure
RestartSec=5s
# Optional polite-pool / API key env (uncomment to set)
# Environment=CROSSREF_MAILTO=you@example.com
# Environment=OPENALEX_MAILTO=you@example.com
# Environment=S2_API_KEY=your-key
[Install]
WantedBy=default.target
Enable with systemctl --user daemon-reload && systemctl --user enable --now mcsci-hub.service. Logs land in the user journal (journalctl --user -u mcsci-hub -f). The server binds loopback-only by default, so no auth is needed for local use. If you expose it beyond loopback, put it behind a reverse proxy that enforces auth.
Run standalone
uv run mcsci-hub # stdio (one subprocess, inherits parent's stdio)
uv run mcsci-hub --http # HTTP on 127.0.0.1:8788
uv run mcsci-hub --http --port 9000 --host 0.0.0.0 # bind all interfaces
Configuration
All settings are managed via environment variables (loaded from .env by pydantic-settings).
| Variable | Default | Description |
|---|---|---|
SCIHUB_MIRRORS |
sci-hub.se,sci-hub.st,sci-hub.ru |
Comma-separated mirror domains, tried in order |
CROSSREF_MAILTO |
(empty) | Email for CrossRef polite pool (higher rate limits) |
OPENALEX_MAILTO |
(empty) | Email for OpenAlex polite pool |
S2_API_KEY |
(empty) | Optional Semantic Scholar API key for higher rate limits |
CACHE_MAX_SIZE |
1000 |
Maximum entries in the TTL cache |
CACHE_TTL |
3600 |
Cache entry lifetime in seconds |
HTTP_TIMEOUT |
30 |
Request timeout in seconds |
PDF_SAVE_DIR |
$XDG_CACHE_HOME/mcsci-hub/pdfs |
Directory where downloaded PDFs are saved (defaults to ~/.cache/mcsci-hub/pdfs) |
See .env.example for a ready-to-use template.
Data Source Strategy
Each field in the aggregated response has a primary and fallback source:
| Field | Primary | Fallback | Notes |
|---|---|---|---|
| Title, Authors | CrossRef | OpenAlex, S2 | CrossRef is the authoritative registry |
| Abstract | OpenAlex | S2 | Decoded from inverted index format |
| Citation count | S2 | OpenAlex | S2 distinguishes influential citations |
| Open Access URL | OpenAlex | S2 | OpenAlex integrates Unpaywall data |
| Paywalled PDF | Sci-Hub | -- | Mirror scraping, fallback only |
| BibTeX | S2 | Constructed from CrossRef | S2 has citationStyles.bibtex |
| Fields of study | S2 | -- | Better classification taxonomy |
All sources are queried in parallel via asyncio.gather with return_exceptions=True -- a slow or failing source never blocks the others.
Project Structure
src/mcsci_hub/
server.py # FastMCP app, lifespan, resources, prompts
config.py # pydantic-settings env config
cache.py # TTL-aware LRU cache
models.py # Pydantic response models
clients/
crossref.py # CrossRef API (polite pool, rate limited)
openalex.py # OpenAlex API (abstracts, OA URLs)
semantic_scholar.py # S2 API (citations, BibTeX)
scihub.py # Sci-Hub scraper (mirror rotation, retry)
tools/
search.py # search_papers
paper.py # get_paper + aggregate_paper()
pdf.py # fetch_pdf
citations.py # get_citations, get_references
bibtex.py # get_bibtex
Development
# Install with dev dependencies
uv sync
# Run tests (55 tests, all mocked with respx + FastMCP in-process transport)
uv run pytest -v
# Run tests with coverage
uv run pytest -v --cov=mcsci_hub
# Lint
uv run ruff check src/ tests/
License
MIT
Metadata
Release files for mcsci-hub 2026.10.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| mcsci_hub-2026.10.1.tar.gz | 19.5 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mcsci_hub-2026.10.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 46.7 kB
Release files / mcsci_hub-2026.10.1.tar.gz
| Download URL | mcsci_hub-2026.10.1.tar.gz |
|---|---|
| Size | 19.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8092dd4ea6c64a5e5f9811561ee0ef0a52c9e29a3ad050086d27978b965cfa83
|
|
BLAKE2b-256 checksum How to use checksums |
4441e8370ae2521285a9b730c40f34fd59d3009edcf6c258955ccf3326fe06f4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"EndeavourOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / mcsci_hub-2026.10.1-py3-none-any.whl
| Download URL | mcsci_hub-2026.10.1-py3-none-any.whl |
|---|---|
| Size | 27.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e100447b95ab3aad3c5af78f725f679714a3b1580aea515fab3682a59933c647
|
|
BLAKE2b-256 checksum How to use checksums |
ecd003e730ee288356ae6cf5462de218167156acf5ad6ebd769b247bdabe45f2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"EndeavourOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for mcsci-hub 2026.10.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.