DigiLIB
DigiLIB is an MCP digital-librarian server for academic/book search and LaTeX research export.
Search papers across OpenAlex, arXiv, Semantic Scholar, and Crossref using multiple focused keywords, with optional year filters and result-size control.
Search books across Open Library and Google Books using broad, book-friendly keywords.
Export a cited literature review as raw LaTeX source with a conversation summary, recommended literature bullets, and citations in APA, Chicago, and/or MLA formats.
Return deduplicated plain-text search results with titles, authors, years, sources, links, abstracts/descriptions, and per-source hit counts.
Operate without API keys by default, over stdio or streamable HTTP, leaving PDF rendering/compilation to the calling agent.
Searches arXiv for preprints as part of the search_papers tool, fanning out queries concurrently alongside other sources and returning normalized results with title, authors, year, link, and a trimmed abstract.
Uses the Google Books API as one of the book sources in search_books, returning deduplicated book results with title, authors, year, link, and description; an optional API key can be configured for reliable quota.
Queries the Semantic Scholar API as one of the academic sources in search_papers, contributing hits with citation counts and DOI metadata when available.
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., "@DigiLIB Search recent papers and two books on RAG, then export an APA literature review."
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.
digilib-mcp
DigiLIB stands for digital librarian — and this MCP server gives that ability to the agent of choice. Connect it to any MCP-capable agent (Claude Code, Claude Desktop, Codex, Antigravity, Cursor, OpenCode, and more) and that agent becomes a librarian: search academic papers and books across six free sources, and export a cited literature review as LaTeX.
No API keys. No paid services. No frontend. No TeX dependency.
Demo
digilib running in Claude Desktop. The prompt asks for recent papers on
retrieval-augmented generation, two books on information retrieval, and a
literature review with APA citations. Claude calls search_papers,
search_books and export_research_tool, then presents the review as both a
PDF and its LaTeX source.
Related MCP server: scholarfetch
Quick start
1. Run it (no install, no keys)
uvx --from git+https://github.com/cars3/digilib-mcp digilib-mcpuvx fetches and runs the server on demand — nothing to install, nothing to
configure. Python 3.10+ (verified on 3.12 and 3.14 with the mcp 2.x SDK).
Or run it from a checkout:
git clone https://github.com/cars3/digilib-mcp.git
cd digilib-mcp
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txt
python -m digilib_mcp.server2. Connect your agent
digilib registers as a standard stdio MCP server. Most clients accept:
{
"mcpServers": {
"digilib": {
"command": "uvx",
"args": ["--from", "git+https://github.com/cars3/digilib-mcp", "digilib-mcp"]
}
}
}Claude Code one-liner:
claude mcp add digilib -- uvx --from git+https://github.com/cars3/digilib-mcp digilib-mcpOne-page guides with each agent's exact config file and snippet live in agent-instructions/agents/: Claude Code, Claude Desktop, Codex, Antigravity, Cursor, OpenCode, Windsurf, Qwen Code, Kimi, Grok, Copilot CLI, Pi, Hermes, legacy Gemini CLI — and a generic guide for any other MCP client.
3. Ask
"Search the literature on retrieval-augmented generation, pull two books on information retrieval, and export a literature review with APA citations."
The agent calls the tools. If it supports skills, point it at
agent-instructions/SKILL.md for the query-crafting workflow.
What it exposes
Tools
search_papers(keywords, year_from?, year_to?, size?)— OpenAlex + arXiv + Semantic Scholar + Crossrefsearch_books(keywords, size?)— Open Library + Google Booksexport_research_tool(conversation_summary, literature_recommended, liked_articles?, citation_formats?)— builds and returns the LaTeX source; the calling LLM renders it
Prompt / Resource (system-prompt delivery)
digilib_researcherprompt → the DigiLIB persona system promptdigilib://prompts/researcherresource → same, for resource-based clients
search_papers
Argument | Type | Meaning |
|
| Key terms, e.g. |
|
| Restrict by publication year. Applied by OpenAlex and Crossref only |
|
| Results per source per keyword. Default |
search_books
Argument | Type | Meaning |
|
| Key terms; broader, book-friendly phrasing works best |
|
| Results per source per keyword. Default |
export_research_tool
Argument | Type | Meaning |
|
| Plain-text summary of the conversation, written by the calling LLM |
|
| One line per bullet in the Literature Review section. A single multi-line string is also accepted |
|
| Citation entries with |
|
| Any of |
Both search tools return a numbered plain-text list. The header echoes the queries that were actually sent and how many hits each source contributed.
Paper search results for: transformer attention (per-source hits: openalex=10, arxiv=10, semantic_scholar=9, crossref=10)
1. Attention Is All You Need
Authors: Ashish Vaswani, Noam Shazeer, ...
Year: 2017
Type: preprint | Source: arxiv
Link: https://arxiv.org/abs/...
Abstract: The dominant sequence transduction models are based on ...DOI and Citations are appended to the Type line when a source provides them. Abstracts are trimmed to 300 characters.
How it works
calling agent → writes 2-5 focused search queries
(the bundled digilib skill guides this)
→ PaperService / BookService fan out concurrently across sources
→ results normalized, deduplicated by title, returned as text
→ the agent synthesizes; can call export_research_tool to get
the LaTeX source for the whole reviewEvery query goes to every source, each with a 15-second timeout, and a source that fails simply contributes nothing — the per-source hit counts in the result header show which. Duplicates are matched on lower-cased title, first occurrence wins.
The calling agent is the intelligence here: it writes the queries, reads the results, and does the synthesis. digilib is the librarian's toolkit.
For AI agents
This repository carries native instructions for coding agents:
agent-instructions/— all agent-facing material in one folderagent-instructions/AGENTS.md— the canonical guide, the only instruction file; point your agent at it directlyagent-instructions/SKILL.md— the canonical skill, the only skill file in the repo;AGENTS.mdtells every agent to read itagent-instructions/agents/— per-agent connection guides
Point your agent at agent-instructions/AGENTS.md, and it will know how to
set digilib up.
Configuration
Set in .env (auto-loaded, gitignored) at the repo root or inside
digilib_mcp/ — see .env.example. Every setting is optional: with no
configuration at all, all six sources work keyless.
Var | Default | Purpose |
|
|
|
| (unset) | Optional polite-pool contact for OpenAlex (better rate limits) |
| (unset) | Optional Google Books key for reliable quota |
|
| Bind address, |
|
| Bind port, |
| (unset) | Shared secret for the HTTP gateway. Set this when hosting publicly — see Securing the gateway |
| (unset) | Comma-separated |
The digilib_mcp/ folder is checked for .env first, and real environment
variables always win over the file.
Variable names must match exactly. A misspelled name (say
DIGILIB_BOOKS_APIKEY instead of DIGILIB_GOOGLE_BOOKS_API_KEY) is silently
ignored, and the feature behaves as if the key were never set.
Run
# stdio (default — for desktop and CLI clients)
uv run python -m digilib_mcp.server
# HTTP (for remote agents)
DIGILIB_TRANSPORT=streamable-http uv run python -m digilib_mcp.serverInside an activated virtualenv, plain python -m digilib_mcp.server works the
same way; the installed console script is digilib-mcp. A stdio server run
by hand just waits for input; it is meant to be launched by an MCP client.
Exporting research
export_research_tool returns LaTeX source and does not render a PDF. The
calling LLM should save it as a .tex file (e.g. digilib_export.tex) and,
if pdflatex is available, compile it:
pdflatex -interaction=nonstopmode digilib_export.texWithout a TeX install, keep the .tex file and compile it anywhere, such as
Overleaf.
The document is a 12pt A4 article titled DigiLIB Research Export, with a
Literature Review (one bullet per recommended line), a Conversation Summary,
and a Citations section with one numbered list per requested format (APA,
Chicago, MLA). Special LaTeX characters such as &, % and _ are escaped.
Hosting as an HTTP gateway (Railway / Render / Fly)
Set DIGILIB_TRANSPORT=streamable-http and let the platform inject PORT —
the server binds 0.0.0.0 and serves the MCP endpoint at /mcp. The
included Procfile (web: python -m digilib_mcp.server) makes Railway
zero-config: connect the repo, set the env vars, deploy, generate a domain.
Point a remote MCP client at https://<your-service>.up.railway.app/mcp:
claude mcp add --transport http digilib https://<your-service>.up.railway.app/mcp…or in .mcp.json:
{
"mcpServers": {
"digilib": {
"type": "http",
"url": "https://<your-service>.up.railway.app/mcp"
}
}
}Securing the gateway
The streamable-http transport has no built-in authentication. If you host it on a public URL without locking it down, anyone who finds the URL can call the tools. This repo ships a shared-secret bearer gate that fixes that.
1. Generate a token and set it as DIGILIB_GATEWAY_TOKEN:
python -c "import secrets; print(secrets.token_urlsafe(32))"
# e.g. pK7x...long...stringAdd it to your hosting env vars (Railway → Variables). When the token is set,
the server requires every request to carry Authorization: Bearer <token>;
without it, requests get 401.
2. Have clients send the token. In .mcp.json:
{
"mcpServers": {
"digilib": {
"type": "http",
"url": "https://<your-service>.up.railway.app/mcp",
"headers": { "Authorization": "Bearer <your-token>" }
}
}
}If DIGILIB_GATEWAY_TOKEN is unset, the server prints a loud warning and
runs unauthenticated — fine for local/LAN testing, not for a public URL.
For multi-user or third-party-client access, this shared secret isn't enough — use the MCP SDK's native OAuth 2.1 resource-server support instead (
MCPServer(settings=Settings(auth=AuthSettings(...)), token_verifier=...)), which wires upBearerAuthBackend+RequireAuthMiddlewareand exposes the OAuth protected-resource metadata endpoints.
Troubleshooting
The agent doesn't show digilib. Check your agent's guide in agent-instructions/agents/ — the config paths differ per agent, and some need an absolute path to
uvx. Most clients only read their config at launch, so restart the agent after editing.A source shows
=0in the result header. Each source fails independently and quietly, so the header is where to look. Semantic Scholar returns 429s without a key, and Google Books shares a small daily quota unlessDIGILIB_GOOGLE_BOOKS_API_KEYis set.Google Books stays at 0 even with a key. Check the variable name is exactly
DIGILIB_GOOGLE_BOOKS_API_KEY.Results feel thin. Query quality matters — ask for more specific terms, or let the bundled skill guide the agent's query crafting (expand acronyms, add synonyms).
421 Invalid Host headerover HTTP. The request'sHostisn't allowed. LeaveDIGILIB_ALLOWED_HOSTSunset, or add your domain to it.
Sources
Source | Coverage | Key |
OpenAlex | All disciplines | none (optional mailto for polite pool) |
arXiv | Physics, CS, math, stats preprints | none |
Semantic Scholar | All disciplines, citations | none (rate-limited) |
Crossref | DOI registry, publisher metadata | none |
Open Library | Books | none |
Google Books | Books | none (basic search; key optional for quota) |
Notes:
OpenAlex returns only records that have abstracts, and applies the year filters.
arXiv is fetched with
requests, because its edge WAF rejectshttpxwith a 406.Semantic Scholar gets one retry, with backoff, on a 429, and has no year filter.
Crossref is limited to journal articles, has JATS markup stripped from abstracts, and applies the year filters.
Open Library uses a book's first sentence as the abstract, else its subject tags.
License
MIT — see LICENSE.
Credits
DigiLIB — short for digital librarian — is the persona and capability layer this server provides; it lives in
digilib_mcp/context/researcher.md.Data comes from OpenAlex, arXiv, Semantic Scholar, Crossref, Open Library and Google Books.
Available Tools
3 toolsexport_research_toolA
Build the LaTeX source for a research export (literature review + conversation summary + citations in APA/Chicago/MLA) and return it.
This tool does NOT render a PDF - it returns the raw LaTeX document source. You, the assistant calling this tool, are responsible for rendering it yourself:
Write the returned LaTeX to a
.texfile (e.g.digilib_export.tex) in the user's project or Downloads folder.If
pdflatexis available, compile it to PDF withpdflatex -interaction=nonstopmode digilib_export.texand give the user the path to the resulting PDF.If
pdflatexis NOT available, just save the.texfile and tell the user where it is and how to compile it (e.g. install TeX, or use an online LaTeX compiler such as Overleaf). Always save the.texfile regardless, so the user keeps the source.
Args: conversation_summary: plain-text summary of the conversation, written by the calling LLM. literature_recommended: list of plain-text lines for the Literature Review section (one bullet per line). liked_articles: citation entries, each a dict with title/authors/year/link keys. citation_formats: subset of ["APA", "Chicago", "MLA"].
Returns: The complete LaTeX document source as a string.
Inputs: conversation_summary (required), literature_recommended (required), liked_articles, citation_formats. Returns: result
search_booksA
Search books across Open Library and Google Books.
Args: keywords: key terms; broader, book-friendly phrasing works best. size: results per source per keyword (default 10).
Returns: A numbered plain-text list of deduplicated book results with title, authors, year, source, link, and description per entry.
Inputs: keywords (required), size. Returns: result
search_papersA
Search academic literature across OpenAlex, arXiv, Semantic Scholar, and Crossref.
Args: keywords: key terms, e.g. ["transformer attention"]. Craft 2-5 focused queries (expand acronyms, add synonyms, use technical phrasing) for the best coverage. year_from: restrict to papers from this year onwards. Applied by OpenAlex and Crossref only. year_to: restrict to papers up to this year. Applied by OpenAlex and Crossref only. size: results per source per keyword (default 10, max 40).
Returns: A numbered plain-text list of deduplicated results with title, authors, year, source, link, and abstract per entry.
Inputs: keywords (required), size, year_to, year_from. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
search_papers and search_books target clearly distinct resource types, and export_research_tool is a separate export action. No two tools overlap in purpose.
All tools use snake_case with a leading verb, giving a predictable pattern. export_research_tool adds a slightly redundant '_tool' suffix, a minor deviation from the parallel search_* names.
Three tools map directly to the server's focused workflow: search papers, search books, and export research. Each tool earns its place and the set is tight rather than thin.
The core workflow from literature and book search to LaTeX export is covered. Minor gaps exist around dedicated citation lookup, BibTeX export, or full-text retrieval, but search results supply metadata and export handles the output need.
Maintenance
Related MCP Connectors
Federated search of books and papers, BibTeX/RIS citations, open-access retrieval and reading.
Search arXiv/Semantic Scholar/OpenAlex + medical evidence (PubMed/Europe PMC) + LaTeX/PDF tools.
Rivul is a free, read-only remote MCP server for searching scholarly literature. It runs semantic search over more than 300 million paper records from a dated OpenAlex snapshot, so an agent can find papers by meaning rather than exact keywords, then open the full record for any result. Tools: - search_papers: semantic search with optional filters for publication year range, minimum citation count, open access only, topic and field. Sort by relevance, most cited, newest or oldest. - get_paper_details: the full record for one work by its OpenAlex ID: title, every author, venue, work type, topic, field, publication date, citation count, DOI and open-access links. - usage_status: the workspace's MCP usage for the current day. Results come only from the index, never from a model. Each result carries a stable OpenAlex ID so the source can be checked, and every response states the snapshot date. Useful for literature reviews, scoping reviews, finding highly cited or open-access papers on a topic, citation chasing, and checking that a cited paper exists. Free for every account, with no plans or payment. Sign in with Google through OAuth 2.1 (PKCE, dynamic client registration), or use an MCP key from rivul.ai. Endpoint: https://rivul.ai/mcp (Streamable HTTP). Setup and docs: https://rivul.ai/features/atlas
Machine Library: cited search over papers, books, patents and social posts, with agent comments.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceTurn any AI agent into an academic researcher that can search, read, cite, and write full literature reviews autonomously.14MIT
- AlicenseNot gradedqualityDmaintenanceEnables MCP agents to search academic literature across multiple scholarly engines, explore papers, authors, and references, inspect abstracts and full text, maintain saved paper collections, and export citations, BibTeX, abstracts, or full-text corpora.1Apache 2.0
- 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
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to conduct literature reviews by screening multiple academic databases, performing backward and forward citation snowballing, and resolving or downloading full-text PDFs through subscription and open-access sources.MIT