Book Downloader MCP
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., "@Book Downloader MCP Search LibGen for The Art of War and download it."
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.
Book Downloader MCP
Ask your AI for a book, get the file.
A Model Context Protocol server for Library Genesis (LibGen+). Search, resolve and download ebooks from Claude, Cursor, VS Code, Windsurf, Zed or any other MCP client — with automatic mirror discovery, MD5 verification and bounded concurrency.
You: Find me "The Art of War" and download it.
Claude: → libgen_search(query: "the art of war")
25 results. → libgen_download(md5: "07fa8b41…")
Saved /Users/you/Books/The Art of War.pdf (58 MB, md5 verified).Contents
Related MCP server: find-a-book-mcp
Why this server
It actually works in 2026. LibGen+ mirrors answer non-browser user agents with a stock nginx page, so most scrapers look like the site is down. This server sends real browser headers, then verifies a mirror by running a live search rather than trusting a 200.
Mirrors die constantly. Every configured mirror is probed with a real request; the warm mirror is re-probed and rotated automatically when a call fails.
Downloads you can trust. Files stream to disk with a size cap, a
.partfile, and an MD5 check against the LibGen record. Existing files are never silently overwritten.Safe by construction. Filenames are sanitized (including Windows reserved names and traversal attempts), and the server refuses expired-key HTML pages instead of saving them as
.pdf.Made for agents. Seven focused, snake_case tools with Zod-validated inputs and actionable error messages, plus a
--statusCLI probe for when a tool call fails.
Quick start
The package runs on demand through npx; there is nothing to install globally.
Claude Code
claude mcp add libgen \
--env LIBGEN_DOWNLOAD_DIR=~/Books \
-- npx -y book-downloader-mcpClaude Desktop (claude_desktop_config.json)
{
"mcpServers": {
"libgen": {
"command": "npx",
"args": ["-y", "book-downloader-mcp"],
"env": {
"LIBGEN_DOWNLOAD_DIR": "~/Books"
}
}
}
}Cursor (~/.cursor/mcp.json), Windsurf (~/.codeium/windsurf/mcp_config.json) and Cline use the same shape:
{
"mcpServers": {
"libgen": {
"command": "npx",
"args": ["-y", "book-downloader-mcp"]
}
}
}VS Code (.vscode/mcp.json)
{
"servers": {
"libgen": {
"type": "stdio",
"command": "npx",
"args": ["-y", "book-downloader-mcp"]
}
}
}Anything else — the generic stdio snippet:
{
"command": "npx",
"args": ["-y", "book-downloader-mcp"]
}Check mirror health before wiring it into a client:
npx -y book-downloader-mcp --statusTools
Tool | Read-only | What it does |
| ✓ | Search by title, author or ISBN. Returns metadata plus the md5 needed for downloads. |
| ✓ | Resolve the direct download URL for an md5 without downloading. |
| — | Download one file, verify its MD5, report the saved path and size. |
| — | Download 1–20 md5s with bounded concurrency; failures are reported per item. |
| ✓ | Show configured mirrors, the active one, and the config version. |
| — | Pin a specific LibGen+ mirror for the session (probed before use). |
| ✓ | Probe every mirror with a real search and report latency and errors. |
Search results carry title, authors, publisher, year, language, pages, size, extension, md5 and mirrorUrl. Downloads return status, path, filename, bytes and md5Verified.
Set LIBGEN_DOWNLOAD_DIR once, or pass downloadDir per call. Relative paths resolve against the server's working directory.
Example prompts
“Search LibGen for the 3rd edition of Computer Networks by Tanenbaum.”
“Find an EPUB of Dune and download the smallest result.”
“Download these five books into ~/Research/Books.”
“LibGen search is failing — check the mirrors and switch to a working one.”
“Get me the direct download link for this md5, I'll use
curl.”
Configuration
All settings are environment variables; each has a safe default.
Variable | Default | Description |
| process cwd | Where downloads are saved. |
| — | Pin a LibGen+ mirror (e.g. |
| upstream | Remote JSON listing the current mirrors. |
|
| Per-request timeout. |
|
| Retries for 429/5xx/network failures, with exponential backoff. |
|
| Per-file size cap. |
|
| Parallel downloads for bulk calls (clamped to 1–5). |
|
| Verify downloads against the LibGen md5. |
|
| How long to cache the mirror list. |
| Chrome UA | Override the browser user agent. |
CLI flags: --status (probe mirrors and exit), --version, --help.
Docker
docker build -t book-downloader-mcp .
# Mount a folder so downloads persist outside the container
docker run -i --rm \
-v "$HOME/Books:/books" \
-e LIBGEN_DOWNLOAD_DIR=/books \
book-downloader-mcpMount a host folder to keep downloads after the container exits; the image defaults LIBGEN_DOWNLOAD_DIR to /books.
Programmatic API
import { LibgenClient, searchBooks, downloadByMd5, downloadByMd5List } from "book-downloader-mcp";
// One-off helpers (each creates a client)
const results = await searchBooks("the art of war", 1, 10);
const best = results.find((entry) => entry.extension === "pdf");
if (best?.md5) {
const outcome = await downloadByMd5(best.md5, { downloadDir: "~/Books" });
console.log(outcome.status, outcome.path, outcome.md5Verified);
}
// Reuse one client to keep the warm mirror and config cache
const client = new LibgenClient();
const status = await client.status();
const outcomes = await client.downloadMany(
results.flatMap((entry) => (entry.md5 ? [entry.md5] : [])).slice(0, 3),
{ concurrency: 2 }
);Useful exports: LibgenClient, createServer, TOOLS, loadConfig, HttpClient, LibgenPlusAdapter, LibgenError, searchBooks, downloadByMd5, downloadByMd5List.
Development
npm install
npm run dev # run the server from source with reload
npm test # 50 vitest tests
npm run test:coverage
npm run typecheck
npm run lint
npm run build # emit dist/ and .d.ts
node dist/cli.js --statusProject layout:
src/
cli.ts CLI entry point (stdio server, --status)
config.ts Environment parsing
libgen.ts Client: mirror discovery, search, download, bulk
core/ HTTP (browser headers, retries), files, errors
api/ Mirror config, HTML parsing, LibGen+ adapter
mcp/ MCPServer factory and the seven tool definitions
tests/ Adapter, HTTP, config, files, client and MCP testsPull requests are welcome. Run npm run lint && npm test && npm run build before opening one.
Troubleshooting
Symptom | Fix |
“No working LibGen mirror found” | Run |
Search returns nothing | Try fewer, more specific terms. LibGen+ matches titles, authors and ISBNs, not full sentences. |
| The download key expired. Re-run the search and download a fresh md5. |
| The mirror served a different file than the record describes. Inspect it before trusting it. |
Download exceeds the size limit | Raise |
Empty | That row has no direct file (e.g. a metadata-only record). Pick another result. |
Legal
This project only provides a client for Library Genesis mirrors operated by third parties. It does not host, mirror or distribute any content. Downloading copyrighted material without permission may be illegal where you live — you are responsible for what you download. The original project is obsfx/libgen-downloader.
License
WTFPL © Ömercan Balandı, with maintenance by Abhinav Prabhakar.
Available Tools
7 toolslibgen_bulk_downloadDownload several booksA
Download a list of md5s with bounded concurrency. Failures are reported per item; one bad md5 does not abort the batch.
Inputs: md5List (required), overwrite, concurrency, downloadDir.
libgen_downloadDownload a bookA
Download one file by md5. Streams to disk with a size cap, verifies the file against its LibGen md5, and never overwrites an existing file unless overwrite=true. Returns the saved path, byte count and verification result.
Inputs: md5 (required), overwrite, verifyMd5, downloadDir.
libgen_get_download_urlResolve a download URLARead-onlyIdempotent
Resolve the direct download URL for an md5 without downloading. Useful for handing the link to another tool or a browser.
Inputs: md5 (required).
libgen_list_mirrorsList mirrorsARead-onlyIdempotent
Show the configured LibGen+ mirrors, which one is active, and the configuration version.
Inputs: no named parameters.
libgen_searchSearch LibGenARead-onlyIdempotent
Search Library Genesis (LibGen+) for books and papers. Returns title, authors, year, language, size, extension, md5 and the detail page URL. Mirrors are discovered automatically and rotated on failure.
Inputs: query (required), page, pageSize.
libgen_set_mirrorSet active mirrorA
Pin a specific LibGen+ mirror for this session. The mirror is probed first, so an unreachable URL is rejected immediately.
Inputs: mirrorSrc (required).
libgen_statusCheck mirror healthARead-onlyIdempotent
Probe every configured mirror with a real search request and report latency and errors. Use this when searches fail.
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
The search → resolve URL → download → bulk download chain is clearly distinct, as are the mirror-management tools. The only soft overlap is libgen_list_mirrors vs libgen_status, since both report on mirrors, though descriptions differentiate (configuration listing vs active probing with latency/errors).
Every tool uses the same libgen_ prefix with a snake_case verb_noun suffix (libgen_search, libgen_download, libgen_bulk_download, libgen_set_mirror). Fully predictable pattern with no deviation.
Seven tools is a well-scoped set for a downloader: search, resolve, single download, bulk download, plus three mirror management operations. No tool appears redundant or gratuitous.
The core workflow (search, resolve link, download, batch download, mirror configuration/recovery) is fully covered with sensible safety behavior like md5 verification and no-overwrite. Minor gap: no dedicated metadata/detail lookup by md5 beyond the detail URL returned by search.
Maintenance
Related MCP Connectors
Gutendex MCP — wraps Gutendex API for Project Gutenberg books (free, no auth)
MCP server for Project Gutenberg: 78,000+ public-domain ebooks with full plain-text retrieval.
Books MCP — wraps Open Library API (free, no auth)
Federated search of books and papers, BibTeX/RIS citations, open-access retrieval and reading.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables searching and reading books from your Calibre ebook library through MCP. Supports title, author, and full-text search across multiple formats with lightweight Windows-optimized implementation.2Apache 2.0
- AlicenseAqualityCmaintenanceAn MCP server for searching and downloading books from Library Genesis, supporting EPUB, MOBI, PDF, and more through natural language queries.339 npm8MIT
- AlicenseAqualityBmaintenanceMCP server in Go to search and download books, papers, comics and more from Library Genesis — three focused tools, one static binary, no account required.433MIT
- AlicenseNot gradedqualityCmaintenanceEnables searching and retrieving audiobooks, authors, and tracks from LibriVox through an MCP interface.135 npmMIT