find-a-book-mcp
An MCP server for searching and downloading books from Library Genesis, supporting EPUB, MOBI, PDF, and more through natural language queries.
README
find-a-book-mcp
An MCP (Model Context Protocol) server for searching and downloading books from Library Genesis. Works with Claude Code, Claude Desktop, and any MCP-compatible AI agent.
Tools
get_formats
Search for a book and return all available formats grouped by unique title + author. Instead of many duplicate rows, each book appears once with a list of all available formats (EPUB / MOBI / PDF / AZW3, etc.) and their MD5s. Fetches up to 75 results in parallel for comprehensive coverage.
Parameters:
query(string, required) — Book title, author, or keywords
Returns:
[
{
"title": "Harry Potter and the Philosopher's Stone",
"author": "J.K. Rowling",
"publisher": "Bloomsbury",
"year": "2015",
"language": "English",
"formats": [
{ "extension": "EPUB", "size": "920 kB", "size_bytes": 942080, "md5": "D7FF6458..." },
{ "extension": "MOBI", "size": "1.1 MB", "size_bytes": 1153433, "md5": "A3CC9012..." }
]
}
]
search_books
Search for books by title, author, or keywords. Returns 5 results per page with pagination support.
Parameters:
query(string, required) — Book title, author, or keywordspage(number, optional, default 1) — Display page number (5 results per page)extensions(string[], optional) — Filter by format, e.g.["epub", "pdf", "mobi"]
Returns:
{
"books": [
{
"title": "...",
"author": "...",
"publisher": "...",
"year": "2021",
"language": "Chinese",
"extension": "EPUB",
"size": "920 kB",
"size_bytes": 942080,
"md5": "D7FF6458..."
}
],
"displayPage": 1,
"totalDisplayPages": 10,
"totalCount": 50,
"hasMore": true,
"hasPrev": false
}
download_book
Download a book by its MD5 hash. Automatically tries multiple mirrors in order: libgen.li → libgen.rs → libgen.st → library.lol.
Parameters:
md5(string, required) — MD5 hash from search resultstitle(string, optional) — Book title, used for the filename
Returns: Local file path, filename, size in bytes, and format extension.
Installation
Claude Code / Claude Desktop
Add to your settings.json:
{
"mcpServers": {
"find-a-book": {
"command": "npx",
"args": ["-y", "find-a-book-mcp"]
}
}
}
Manual
git clone https://github.com/Xiaochengzi2048/find-a-book-mcp
cd find-a-book-mcp
npm install
node server.js
How It Works
- Search — Scrapes LibGen HTML (no API key or account required); tries
libgen.li→libgen.rs→libgen.stautomatically - Paginate — LibGen returns 25 results per server page; this server presents 5 per display page with
hasMore/hasPrevflags for navigation - Download — Two-step: fetch a one-time key from
ads.php, then download viaget.php; falls back through all mirrors thenlibrary.lolon failure - Save — File saved to system temp directory (
/tmp/) with a timestamped filename to avoid collisions
Notes
- No account or API key required
- Supports EPUB, MOBI, PDF, AZW3, FB2, DJVU, and more
size_bytesfield lets callers decide delivery method (e.g. direct send vs. link for large files)- Downloaded files are saved to
/tmp/— move them as needed - Mirror failures are logged to stderr for easy debugging
find-a-book-mcp(中文说明)
基于 Library Genesis 的 MCP 工具服务,支持搜索和下载电子书。兼容 Claude Code、Claude Desktop 及所有支持 MCP 协议的 AI Agent。
工具说明
get_formats — 按格式汇总
搜索一本书,将所有重复条目按「书名 + 作者」归并,每本书只出现一次,并列出所有可用格式(EPUB / MOBI / PDF / AZW3 等)及其 MD5。并行抓取最多 75 条结果,覆盖更全面。
参数:
query(必填)— 书名、作者或关键词
返回示例:
[
{
"title": "置身事内",
"author": "兰小欢",
"year": "2021",
"language": "Chinese",
"formats": [
{ "extension": "EPUB", "size": "2.3 MB", "size_bytes": 2411724, "md5": "..." },
{ "extension": "PDF", "size": "8.1 MB", "size_bytes": 8493466, "md5": "..." }
]
}
]
search_books — 搜索书籍
按书名、作者或关键词搜索,每页返回 5 条结果,支持翻页。
参数:
query(必填)— 书名、作者或关键词page(可选,默认 1)— 显示页码,每页 5 条extensions(可选)— 按格式过滤,如["epub", "mobi", "pdf"]
返回字段说明:
books— 当前页书籍列表,含书名、作者、出版社、年份、语言、格式、大小、size_bytes(字节数)、MD5totalCount— 总结果数(单页时精确,多页时为估算值)totalDisplayPages— 总显示页数hasMore/hasPrev— 是否有下一页 / 上一页
download_book — 下载书籍
通过 MD5 下载书籍,自动按顺序尝试多个镜像:libgen.li → libgen.rs → libgen.st → library.lol。
参数:
md5(必填)— 搜索结果中的 MD5title(可选)— 书名,用于文件命名
返回: 本地文件路径、文件名、字节大小、格式。
安装方式
Claude Code / Claude Desktop
在 settings.json 中添加:
{
"mcpServers": {
"find-a-book": {
"command": "npx",
"args": ["-y", "find-a-book-mcp"]
}
}
}
手动安装
git clone https://github.com/Xiaochengzi2048/find-a-book-mcp
cd find-a-book-mcp
npm install
node server.js
工作原理
- 搜索 — 抓取 LibGen 页面,无需账号或 API Key;自动尝试
libgen.li→libgen.rs→libgen.st - 分页 — LibGen 每次返回 25 条,本服务每显示页展示 5 条,通过
hasMore/hasPrev驱动翻页 - 下载 — 两步流程:从
ads.php获取一次性 key,再通过get.php下载;所有镜像失败后自动切换到library.lol - 保存 — 文件存入
/tmp/,文件名含时间戳防冲突
注意事项
- 无需账号或 API Key
- 支持 EPUB、MOBI、PDF、AZW3、FB2、DJVU 等格式
size_bytes字段方便调用方判断发送方式(如小文件直发,大文件给链接)- 文件默认保存在
/tmp/,请自行移至目标位置 - 镜像失败时会写入 stderr,便于排查问题
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.