scilib
scilib is a local MCP server that searches the open scholarly record, retrieves full text through legal open-access routes, and full-text searches papers already on your machine.
Search literature —
lit_searchqueries OpenAlex, Europe PMC, Semantic Scholar, arXiv, DOAJ, OpenAIRE and CORE at once, merging and de-duplicating on DOI, with year and open-access filters.Resolve records —
lit_getturns a DOI, PMID, PMCID or title into full metadata plus every legal full-text route, without downloading.Fetch and index papers —
lit_fetchdownloads the best legal copy by a fidelity-ordered ladder (disk → Europe PMC XML → PMC OA → Unpaywall → OpenAlex → preprint), stamps it with provenance, extracts and indexes it.Follow citations —
lit_cited_bylists papers citing a DOI;lit_referencesresolves a paper's bibliography and marks what you already hold.Request unavailable papers —
lit_request_copydrafts a reprint request to the corresponding author (drafts only, sends nothing).Search your own library —
lib_searchruns full-text FTS5 queries over indexed papers;lib_readreturns a paper or a single section (e.g. methods);lib_indexindexes a directory of PDF, JATS XML or text;lib_statusreports holdings, licences and config.Look up structures and sequences —
pdb_entryreturns PDB metadata plus its primary citation;uniprot_entryreturns sequence, features and cross-referenced PDB entries.Administer and audit —
configuresets contact email, library path, confidential mode and optional API keys;audit_logshows every outbound request. Everything stays local, and confidential mode blocks free-text queries from leaving the machine unless a call passesallow_external=true.
Retrieves preprint full texts from arXiv as a fallback route in the full-text resolution ladder, clearly labelled as not the version of record.
Integrates with the Semantic Scholar API for scholarly metadata, with an optional API key to raise rate limits for citation and reference lookups.
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., "@scilib find open-access papers on quantum error correction from the last two years"
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.
scilib
An MCP server for open-access scientific literature.
scilib gives an AI assistant three capabilities it does not have by default: search across the open scholarly record, retrieve full text through legal open-access routes with full provenance, and search the papers you already have on disk by their contents.
It runs entirely on your own machine. Nothing is uploaded, and the only data that leaves is the search terms and identifiers you ask it to look up.
Contents
Related MCP server: Academix MCP
Why
Two different problems get confused with one another.
Acquisition. Finding a free, legal copy of a paper. This is largely solved, and the solution is underused. Roughly half of all literature, and a higher share of recent biomedical work, is legally available through PubMed Central, Europe PMC, preprint servers, institutional repositories and publisher open-access programmes. Much of it is invisible to a search that only checks the publisher's own page, because a closed paper very often has a legal author manuscript deposited in a repository under a funder mandate.
Retrieval. Knowing what is inside the papers you already hold. This is not solved, and it is where the expensive mistakes happen. A keyword search over titles and abstracts can only return answers to questions you already thought to ask, so it is structurally incapable of surfacing the result that reframes your problem. Papers sit unread in project folders for months.
scilib addresses both, and treats the second as the more important one.
What it does not do
scilib does not use Sci-Hub, LibGen or any other pirate mirror. It does not scrape publisher article pages, and it does not use shared or scraped credentials.
This is an engineering decision as much as a legal one. Publishers monitor institutional proxy traffic for bulk retrieval, and the standard response is to suspend access for the entire institution, after which the university traces it to an individual account. A tool shared across a research group that behaved this way would put every member's legitimate access at risk in order to reach a small number of papers the legal routes largely cover anyway.
Where a paper genuinely has no open copy, lit_request_copy drafts a reprint
request to the corresponding author. This was the normal way to obtain a paper
before the web, it is entirely lawful, and it still works.
Requirements
Python | 3.10 or newer |
| from poppler-utils, required for indexing PDFs |
Disk | a few hundred MB for a typical personal library |
Accounts | none required; two optional free API keys raise rate limits |
Install pdftotext:
sudo apt install poppler-utils # Debian / Ubuntu
brew install poppler # macOSInstallation
git clone https://github.com/Hiran001/scilib-mcp.git
cd scilib-mcp
./scripts/install.shThe installer creates a self-contained virtualenv at .venv, installs the two
dependencies (mcp and httpx), and verifies that the server imports cleanly.
It does not modify anything outside the project directory.
Register with your MCP client
Claude Code
claude mcp add scilib -- "$(pwd)/.venv/bin/python" "$(pwd)/scilib/server.py"Claude Desktop, or any client using a JSON config, add to mcpServers:
{
"mcpServers": {
"scilib": {
"command": "/absolute/path/to/scilib-mcp/.venv/bin/python",
"args": ["/absolute/path/to/scilib-mcp/scilib/server.py"]
}
}
}Use absolute paths. Restart the client, and confirm the server shows as connected before continuing.
Configuration
Run once, in your assistant:
configure(email="you@university.edu")The address is sent to the polite pools operated by Crossref, Unpaywall, OpenAlex and NCBI. These services request a contact address and grant higher rate limits in return. It is the only personal data scilib transmits, Unpaywall requires it, and everything else works without it.
Configuration is stored at ~/.config/scilib/config.json.
setting | default | purpose |
| empty | contact address for API polite pools |
|
| where retrieved papers and the index live |
|
| block free-text queries from leaving the machine |
| empty | optional, free, raises the CORE rate limit |
| empty | optional, free, raises the Semantic Scholar rate limit |
|
| log every outbound request locally |
Confidential mode
configure(confidential_mode="on")With this enabled, free-text searches will not leave the machine unless a call
explicitly passes allow_external=true. Identifier lookups are unaffected,
since a DOI carries no unpublished reasoning. This matters for groups working on
unpublished hypotheses, where the wording of a search query is itself a
disclosure.
Quick start
Index the papers you already have:
lib_index("/path/to/your/papers")Then search their full text:
lib_search("thermal denaturation midpoint")Find and retrieve something new:
lit_search("bacterial cell division regulators", limit=10)
lit_get("10.1038/s41467-018-08056-2") # metadata plus every legal route
lit_fetch("10.1038/s41467-018-08056-2") # download, store, index
lib_read("10.1038/s41467-018-08056-2", section="methods")Start from a structure:
pdb_entry("4HHB") # returns the entry AND its primary citationCheck what the server holds:
lib_status()Tool reference
Discovery and retrieval
tool | description |
| Federated search across the configured sources, merged and de-duplicated on DOI. Marks results already in your library. |
| Resolve a DOI, PMID, PMCID or title to full metadata plus every legal full-text route, without downloading. |
| Retrieve the best available full text, store it with provenance, extract and index it. |
| Papers citing a given DOI. |
| The bibliography of a paper, resolved, marking what you already hold. |
| Draft a reprint request to the corresponding author. Returns the text; sends nothing. |
Local library
tool | description |
| Full-text search across every indexed paper on your machine. |
| Read a held paper, optionally one section: |
| Index a directory of PDF, JATS XML or text files. |
| Holdings, licence and source breakdown, current configuration. |
Structures and sequences
tool | description |
| PDB metadata and its primary citation, resolving the DOI by title when RCSB omits it. |
| Sequence, annotated features, and cross-referenced PDB entries. |
Administration
tool | description |
| Contact address, library path, confidential mode, optional API keys. |
| Every request scilib has made, most recent last. |
How full-text resolution works
lit_fetch works down an ordered ladder and stops at the first route that
returns a real document. The order is by fidelity, not convenience.
Already on disk. No network request.
Europe PMC
fullTextXML. Sectioned JATS, the highest-fidelity form.PubMed Central OA subset via the AWS Open Data bucket, preferring XML, then text, then PDF.
Unpaywall, publisher open access first, then repository copies.
OpenAlex best open-access location.
Preprint on bioRxiv, medRxiv or arXiv, clearly labelled as not the version of record.
No open copy. Reports this honestly and drafts an author request.
XML is preferred over PDF because it preserves section structure, which is what
makes lib_read(paper, section="surface plasmon resonance") a real operation. A
PDF flattens into an undifferentiated block of text.
A route that promises a PDF and returns HTML is a login wall, not a paper. scilib detects this and moves to the next route rather than storing it.
Data, privacy and provenance
Everything stays local. The library, the index and the logs are files on your machine. scilib has no server component and no telemetry.
Every file is stamped with its source, source URL, licence and SHA-256, so a figure or a number quoted from a paper can be traced to the exact bytes it came from.
Licences are recorded, not assumed. Reusing a figure requires the licence, not merely the citation.
lib_statusbreaks holdings down by licence.Outbound requests are logged to
<library>/outbound_queries.log. Read it withaudit_log()at any time.Rate limiting is shared across processes through a lock file, so several instances, or several colleagues behind one institutional NAT, queue against a single clock rather than collectively tripping a limit.
Sources
All sources are public, documented, and used as their operators intend.
source | coverage | notes |
~250M works, all disciplines | CC0, no key required | |
~45M biomedical records | ~6M with open full text as JATS | |
open-access articles | via the NCBI Cloud Service, a permitted automated route | |
DOI registration metadata | authoritative licence and funder data | |
~50M DOIs | legal free copies; requires a contact email | |
citation graph | open-PDF pointers, optional free key | |
preprints | includes published-version mapping | |
preprints | one request per three seconds | |
fully open-access journals | ||
European repositories | ||
~300M repository records | free API key required | |
structures and sequences |
PMC content carries the attribution its terms require: NIH NLM NCBI PubMed Central (PMC) Article Datasets, https://registry.opendata.aws/ncbi-pmc.
Troubleshooting
The server shows as failed or disconnected. Run it directly to see the error, since MCP clients usually report only that the connection closed:
.venv/bin/python scilib/server.py < /dev/nullIt should produce no output and wait. Any traceback is the real cause.
lib_search returns nothing.
Check that something is actually indexed with lib_status(). If chunks is 0,
run lib_index() over your paper directories first.
A PDF indexed with no text.
It is almost certainly a scan without OCR. These are reported by name in the
failures list rather than counted as successes. Run OCR over them, for example
with ocrmypdf, and re-index.
Searches return fewer results than expected.
lib_search accepts FTS5 syntax: "exact phrase", AND, OR, NOT, and
prefix*. A query that FTS5 cannot parse is retried in a quoted form rather
than failing, which can broaden it. Matching happens at chunk level first and
falls back to document level, so terms in different sections of one paper are
still found.
Rate-limit errors.
Set a contact address with configure(email=...), which grants access to the
polite pools. arXiv answers a rate limit with HTTP 406 rather than 429, which
can look like a malformed query; scilib backs off and retries automatically.
Contributing
See CONTRIBUTING.md. In short: new sources are welcome if they are public APIs whose terms permit programmatic use. Additions that bypass access controls are out of scope and will not be merged.
Run the offline test suite before opening a pull request:
.venv/bin/python tests/test_offline.pyEvery test corresponds to a bug that actually occurred. If you fix one, add the test that would have caught it.
Acknowledgements
scilib is a thin client. Everything it is useful for was built by other people, most of it public infrastructure funded by grants and sustained by non-profits. Citations are a large part of how that funding is justified, so if scilib contributes to published work, please cite the sources it drew on rather than only this tool.
source | citation |
OpenAlex | Priem J, Piwowar H, Orr R. OpenAlex: A fully-open index of scholarly works, authors, venues, institutions, and concepts. arXiv 2022. 10.48550/arXiv.2205.01833 |
Europe PMC | Ferguson C, et al. Europe PMC in 2020. Nucleic Acids Research 2020. 10.1093/nar/gkaa994 |
PubMed Central | NIH NLM NCBI PubMed Central (PMC) Article Datasets, accessed via the AWS Open Data registry. https://registry.opendata.aws/ncbi-pmc |
Crossref | Hendricks G, et al. Crossref: The sustainable source of community-owned scholarly metadata. Quantitative Science Studies 2020. 10.1162/qss_a_00022 |
Unpaywall | Piwowar H, et al. The state of OA: a large-scale analysis of the prevalence and impact of Open Access articles. PeerJ 2018. 10.7717/peerj.4375 |
Semantic Scholar | Kinney R, et al. The Semantic Scholar Open Data Platform. arXiv 2023. 10.48550/arXiv.2301.10140 |
bioRxiv | Sever R, et al. bioRxiv: the preprint server for biology. bioRxiv 2019. 10.1101/833400 |
CORE | Knoth P, Zdrahal Z. CORE: Three Access Levels to Underpin Open Access. D-Lib Magazine 2012. 10.1045/november2012-knoth |
OpenAIRE | Manghi P, et al. The OpenAIRE Research Graph Data Model. 2019. 10.5281/zenodo.2643199 |
RCSB PDB | Berman HM, et al. The Protein Data Bank. Nucleic Acids Research 2000. 10.1093/nar/28.1.235 |
UniProt | The UniProt Consortium. UniProt: the Universal Protein Knowledgebase in 2025. Nucleic Acids Research 2024. 10.1093/nar/gkae1010 |
AlphaFold DB | Varadi M, et al. AlphaFold Protein Structure Database in 2024. Nucleic Acids Research 2023. 10.1093/nar/gkad1011 |
arXiv, DOAJ | No canonical citation; both are acknowledged here with thanks. |
Every DOI above was verified against Crossref and OpenAlex before being written, rather than recalled. Four of an initial set of remembered DOIs turned out to point at unrelated papers, which is the argument for checking them.
Built on the Model Context Protocol Python SDK (MIT) and httpx (BSD-3-Clause).
On authorship
The implementation was written by Claude (Anthropic) in an extended pair-programming session, directed, reviewed and tested by the repository owner, who set the scope, the design constraints and the decision to use only legal open-access routes. This is stated because being precise about where work came from is the same discipline as being precise about where a number came from.
The test suite is part of that record. Every test in tests/test_offline.py
corresponds to a defect found during development, including a module that
shadowed a Python standard-library package, a case-sensitive DOI index that
silently lost full text for several major journals, and a chunked search index
that dropped any multi-term query spanning a section boundary.
Contributions welcome, especially integrations
If you maintain something that overlaps with this, the preferred outcome is one good tool rather than two partial ones. Open an issue and say what you have built; extending or integrating is more useful to everyone than a parallel implementation.
Licence
MIT for the code.
Retrieved content keeps whatever licence it arrived with. That licence is
recorded per file and reported by lib_status. scilib does not relicense
anything it downloads, and it is your responsibility to honour the terms
attached to each item, particularly when reusing figures.
Available Tools
14 toolsaudit_logA
Show what this tool has sent off the machine, most recent last.
Inputs: lines. Returns: result
configureB
Set the contact address, library location, or confidential mode.
The email goes to the polite pools of Crossref, Unpaywall, OpenAlex and NCBI. They ask for it, grant higher rate limits in return, and it is the only personal datum this tool sends anywhere.
confidential_mode 'on' blocks free-text queries from leaving the machine unless a call passes allow_external=true. Identifier lookups still work, since a DOI carries no unpublished reasoning.
Inputs: show, email, library, s2_api_key, +2 more. Returns: result
lib_indexA
Index a directory of papers already on disk so lib_search can find them.
Handles PDF, JATS XML and text. limit of 0 means no cap; any other value
caps the scan and the result says so explicitly, because a capped scan
reported as a total is how an inventory lies.
Inputs: path (required), limit, recursive. Returns: result
lib_readA
Read a paper held locally, optionally one section of it.
section matches a heading case-insensitively, e.g. 'methods', 'surface
plasmon', 'results'. With no section, returns the abstract plus a list of
available headings, so a long paper can be read deliberately rather than
dumped into context.
Inputs: identifier (required), section, max_chars. Returns: result
lib_searchA
Full-text search across every paper already on this machine.
This is the tool to reach for FIRST. A paper on disk that nobody searched is invisible in exactly the way a paywalled one is, and the failure is quieter. Supports FTS5 syntax: phrases in "quotes", AND/OR/NOT, prefix*.
Inputs: query (required), limit. Returns: result
lib_statusA
What the local library holds, and the current configuration.
Inputs: no named parameters. Returns: result
lit_cited_byA
Papers that cite this one. The route to the paper you did not know to search for: a keyword sweep only returns what you already thought to ask.
Inputs: doi (required), limit. Returns: result
lit_fetchA
Download the best legal full text for a paper into the local library, extract its text, and index it. Prefers sectioned XML over PDF because XML preserves headings, which makes 'what did the Methods say' answerable.
Inputs: identifier (required), prefer_pdf. Returns: result
lit_getA
Resolve a DOI, PMID, PMCID or title to full metadata plus every legal route to its full text. Does not download anything.
Inputs: identifier (required). Returns: result
lit_referencesB
The bibliography of a paper, resolved to real records.
Reading a paper's reference list is how you find the work that nobody in your subfield cites. Accepts DOI:10.x, PMID:123, arXiv:1234.5678.
Inputs: identifier (required), limit. Returns: result
lit_request_copyA
Draft a reprint request to the corresponding author.
The pre-internet norm and still the highest-yield route for a genuinely unavailable paper. Authors may lawfully share their own work for scholarly correspondence. Returns the draft; it does not send anything.
Inputs: identifier (required). Returns: result
lit_searchA
Search the open scholarly record across several indexes at once.
sources is a comma-separated list. Available:
openalex ~250M works, all disciplines, open catalogue
europepmc ~45M biomedical records, ~6M with open full text
semanticscholar citation graph, open-PDF pointer, one-line summaries
arxiv physics/quant-bio/CS preprints
doaj articles in fully open-access journals
openaire European repositories and funder outputs
core ~300M repository records (needs a free API key)
The repository sources matter for paywalled work: a closed paper very often has a legal author manuscript deposited under a funder mandate.
Results are merged and de-duplicated on DOI. Each carries open-access status, licence, and whether full text is retrievable.
allow_external exists because a free-text query leaves this machine. Set
confidential_mode in configure() to make that an explicit decision per call.
Inputs: query (required), limit, sources, year_to, +3 more. Returns: result
pdb_entryA
Metadata and the PRIMARY CITATION for a PDB entry.
Coordinates do not carry the analysis. If a design rests on a structure it rests on the paper that deposited it, and that paper is one lookup away. Resolves the DOI by title when RCSB omits it, which it often does for older entries, i.e. exactly the ones nobody has read.
Inputs: pdb_id (required). Returns: result
uniprot_entryC
UniProt record: sequence, features, and cross-referenced PDB entries.
Inputs: accession (required). Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 14 tools
Every tool has a distinct role: lit_* handles external literature, lib_* handles the local library, pdb_entry/uniprot_entry are clearly separated database lookups, and configure/audit_log are system-level. Even similar actions like lit_get versus lit_fetch are cleanly differentiated by 'resolve routes' vs 'download and index'.
Names generally follow a clear snake_case convention with lit_ and lib_ prefixes, making the family relationships obvious. Minor deviations exist—lit_cited_by and lit_references are noun-like rather than verb-action, and pdb_entry/uniprot_entry/audit_log do not follow the verb_noun pattern—but the overall scheme remains highly predictable.
Fourteen tools is within the ideal range and each tool earns its place. The set covers external search, retrieval, citation analysis, local-library management, database lookups, configuration, and audit, without redundant or filler tools.
The scholarly workflow is well covered end-to-end: discover via lit_search, resolve via lit_get, obtain full text via lit_fetch, explore context via lit_cited_by/lit_references, and fall back to lit_request_copy. Local-library tools close the loop with lib_index, lib_search, and lib_read, while configure and audit_log provide necessary governance.
Maintenance
Related MCP Connectors
Federated search of books and papers, BibTeX/RIS citations, open-access retrieval and reading.
Multi-engine scholarly research server for search, traversal, full text, and reading lists.
Search and organize data over millions of full-text papers, trials, FDA documents, and patents
Search arXiv/Semantic Scholar/OpenAlex + medical evidence (PubMed/Europe PMC) + LaTeX/PDF tools.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables users to search, download, and read academic papers from multiple platforms including arXiv, PubMed, bioRxiv, Google Scholar, Semantic Scholar, and CrossRef through a unified interface.347MIT
- FlicenseNot gradedqualityDmaintenanceAggregates academic paper search from multiple databases (OpenAlex, Semantic Scholar, etc.) with PDF storage and full-text search capabilities.1-
- FlicenseAqualityDmaintenanceEnables semantic search across personal PDF paper collections with page-level citations, allowing users to query their library from any MCP-capable client.9-
- AlicenseCqualityBmaintenanceEnables users to search scientific literature metadata across OpenAlex, Europe PMC, and Crossref, verify citations, retractions, source quotes, and claims, and build or export hash-chained evidence ledgers with explicit provenance and limitations.355Apache 2.0