access-calibre
Enables LLMs to interact with a local Calibre Content Server to search libraries, list books, retrieve ebook content, chapters, and more.
README
access-calibre
[!WARNING] This package has been entirely vibe-coded by Junie in JetBrains IntelliJ and not human checked.
[!NOTE] Given the risk of using vibe-coded libraries, I've decided that I prefer the native sandboxing that deno provides. Check out the access-calibre-deno library instead.
A JavaScript library to connect to a local Calibre Content Server and grab portions of ebooks.

You will need to have a Calibre Content Server running locally. Start one by running calibre and choosing the "Connect/share" option.
MCP Server
This library includes an MCP (Model Context Protocol) server that allows LLMs to interact with your Calibre library.
Tools Provided:
list_libraries: List available libraries.search_books: Search for books using Calibre's search syntax (e.g. by title, author: "author:Asimov").list_books: List all books in a library.list_epub_files: List all files available within an EPUB (e.g., HTML, CSS, images, fonts).list_chapters: List the chapters of a book in reading order.get_chapter_content: Retrieve the HTML content of a specific chapter.get_chapter_content_markdown: Retrieve the content of a specific chapter converted to Markdown (generally better for LLMs).render_chapter_page: Render a specific page of a chapter as a PNG image (useful for LLMs with vision capabilities). It also returns the total number of pages in the chapter.get_book_cover: Retrieve the cover image of a book as a PNG image.search_in_book: Search for specific literal text within a book and get snippets of occurrences. Note: ONLY supports simple literal string matching, NO boolean operators (AND/OR) or quotes.get_epub_file: Retrieve any file from the EPUB (e.g. CSS, images).


Configuration
The MCP server can be configured via environment variables:
CALIBRE_URL: The URL of your Calibre Content Server (default:http://[::1]:8080/).CALIBRE_USERNAME: Optional username for authentication.CALIBRE_PASSWORD: Optional password for authentication.
Running the MCP Server
Logging
You can enable detailed logging of all requests and responses by providing the --verbose (or -v) argument:
npx access-calibre --verbose
Logs are written to stderr so they don't interfere with the MCP protocol.
If you want to direct logs to a file, you can use the --log-file argument:
npx access-calibre --log-file=server.log
You can combine both to see logs in stderr and save them to a file:
npx access-calibre --verbose --log-file=server.log
Help
You can see all available options by providing the --help (or -h) argument:
npx access-calibre --help
Claude Desktop
You can run the MCP server directly using npx (useful for Claude Desktop or other MCP clients):
npx access-calibre
LM Studio
To use this MCP server in LM Studio:
- Open LM Studio.
- Click on the Tools icon (puzzle piece) in the left sidebar.
- Click + Add Tool.
- Choose MCP Server.
- Give it a name (e.g.,
access-calibre). - For Command, enter
npx. - For Arguments, enter
access-calibre. - Add any required environment variables (like
CALIBRE_URL) in the Environment Variables section. - Click Add Tool.
Alternatively, you can add it to your mcp-config.json (usually found in ~/.lmstudio/mcp-config.json):
{
"mcpServers": {
"access-calibre": {
"command": "npx",
"args": ["access-calibre"],
"env": {
"CALIBRE_URL": "http://localhost:8080/"
}
}
}
}
Local Installation
npm run start:mcp
Or directly via Node:
CALIBRE_URL=http://localhost:8080 node mcp-server.js
Library Installation
To use it as a library in your project:
npm install access-calibre
Usage
You can use it as a library in your project:
const CalibreClient = require('access-calibre');
const client = new CalibreClient('http://localhost:8080', 'username', 'password');
async function example() {
// List libraries
const libraries = await client.getLibraries();
const libraryId = Object.keys(libraries)[0];
// List books
const books = await client.getBooks(libraryId);
// Get EPUB contents
const bookId = books.book_ids[0];
const files = await client.getEpubContents(libraryId, bookId);
console.log('Files in EPUB:', files);
// Get a specific file (e.g., a chapter) from the EPUB
const html = await client.getEpubFile(libraryId, bookId, 'index_split_001.html');
console.log(html);
}
API
new CalibreClient(baseUrl, username, password)
Initialize the client.
client.getLibraries()
Returns an object containing information about available libraries, including book counts.
client.getBooks(libraryId, limit, offset, search)
Returns a list of book IDs and their metadata for the specified library. search is an optional search query string in Calibre's search syntax.
client.getBookMetadata(libraryId, bookId)
Returns detailed metadata for a specific book.
client.downloadBook(libraryId, bookId, format)
Downloads the book in the specified format (e.g., 'EPUB', 'PDF') and returns a Buffer.
client.getEpubContents(libraryId, bookId)
Returns a list of file paths inside the EPUB file.
client.getTOC(libraryId, bookId)
Returns an array of { title, path } objects representing the book's Table of Contents.
client.getChapters(libraryId, bookId)
Returns an array of { title, path, size } objects representing the book's chapters in their linear reading order (as defined in the EPUB spine). size is the uncompressed size of the chapter file in bytes.
client.getChapterContentMarkdown(libraryId, bookId, chapterPath)
Returns the content of a specific chapter converted to Markdown.
client.searchText(libraryId, bookId, query, snippetWindow)
Searches for query text within the book. Returns an array of { chapterTitle, chapterPath, offset, snippet, markdownOffset, markdownSnippet } objects. snippetWindow (default 100) is the number of characters to include before and after the match in the snippet. markdownOffset and markdownSnippet are provided for use with Markdown-based tools.
client.getEpubFile(libraryId, bookId, filePath, responseType)
Extracts a specific file from the EPUB and returns its content as a string (default) or Buffer (if responseType is 'buffer').
Scripts
get-chapter.js
Extracts the XML/HTML content of a chapter to the console.
node get-chapter.js <book_id_or_title> <chapter_index_or_title>
render-chapter.js
Renders a specific page from a chapter to a PNG image using Playwright.
node render-chapter.js <book_id_or_title> <chapter_index_or_title> [output.png] [--page <number>]
--page <number>: Optional. Specifies which page of the chapter to render (default is 1).- If no output filename is provided, it defaults to
chapter_render.png.
Note: You may need to run npx playwright install chromium before using this script.
Running Tests
npm test
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。