Calibre RAG MCP Server
Built on Node.js runtime environment, requiring Node.js 16+ for execution of the MCP server and its RAG capabilities
Uses npm package manager for dependency management and installation of required libraries for vector search and document processing
Integrates Sharp for image manipulation and processing as part of the OCR and document extraction pipeline
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., "@Calibre RAG MCP Server search for books about machine learning in my AI project"
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.
Calibre RAG MCP Server
Enhanced Calibre MCP server with RAG (Retrieval-Augmented Generation) capabilities for project-based vector search and contextual conversations.
Features
RAG-Enhanced Search: Vector-based semantic search using FAISS and Transformers
Project-Based Organization: Create isolated vector search projects for different contexts
Multi-Format Support: Process books in various formats (EPUB, PDF, MOBI, etc.)
OCR Capabilities: Extract text from images and scanned PDFs using Tesseract
Advanced Text Processing: Natural language processing for better content understanding
Windows Compatible: Designed specifically for Windows environments
Related MCP server: Personal Research Assistant MCP
Technologies Used
Vector Search: FAISS for efficient similarity search
Embeddings: Xenova Transformers for local embedding generation
OCR: Tesseract for optical character recognition
PDF Processing: Multiple PDF parsing libraries (pdf-parse, pdf-poppler, pdf2pic)
Image Processing: Sharp for image manipulation
NLP: Natural language processing with multiple libraries
Prerequisites
Node.js >= 16.0.0
Calibre installed on Windows
ImageMagick (for enhanced image processing)
Tesseract OCR (for text extraction from images)
Installation
Clone this repository:
git clone https://github.com/yourusername/calibre-rag-mcp-nodejs.git
cd calibre-rag-mcp-nodejsInstall dependencies:
npm installRun setup (Windows):
setup.batConfiguration
The server automatically detects your Calibre library location. For custom configurations, modify the settings in server.js.
Usage
Starting the Server
npm startAvailable Tools
search: Semantic search across your ebook libraryfetch: Retrieve specific content from bookslist_projects: List all RAG projectscreate_project: Create a new RAG projectadd_books_to_project: Add books to a project for vectorizationsearch_project_context: Search within specific projects
Example MCP Configuration
Add to your MCP client configuration:
{
"mcpServers": {
"calibre-rag": {
"command": "node",
"args": ["path/to/calibre-rag-mcp-nodejs/server.js"]
}
}
}Project Structure
calibre-rag-mcp-nodejs/
├── server.js # Main MCP server
├── package.json # Dependencies and scripts
├── setup.bat # Windows setup script
├── test-*.js # Various test files
├── projects/ # RAG projects storage
├── CONFIG.md # Configuration documentation
├── USAGE_EXAMPLES.md # Usage examples
└── QUICK_TEST.md # Quick testing guideTesting
Run the test suite:
npm testIndividual test files:
test-enhanced-server.js- Enhanced server functionalitytest-ocr-full.js- OCR capabilitiestest-pdf-approaches.js- PDF processingtest-enhanced-auto.js- Automated testing
Documentation
Requirements
System Requirements
Windows 10/11
Node.js 16+
Calibre installed
At least 4GB RAM (8GB+ recommended for large libraries)
Optional Dependencies
ImageMagick (for enhanced image processing)
Tesseract OCR (for text extraction from scanned documents)
Troubleshooting
Common Issues
FAISS Installation: If FAISS fails to install, ensure you have proper build tools
Tesseract Not Found: Install Tesseract and add to PATH
Memory Issues: Reduce batch sizes for large document processing
Debug Mode
Enable verbose logging by setting environment variable:
set DEBUG=calibre-rag:*
npm startContributing
Fork the repository
Create a feature branch
Make your changes
Add tests for new functionality
Submit a pull request
License
Licensed under the Apache License 2.0. See LICENSE file for details.
Support
For issues and questions, please open an issue on GitHub.
Changelog
v1.0.0
Initial release with RAG capabilities
Project-based vector search
Multi-format document support
OCR integration
Windows optimization
Available Tools
7 toolsadd_books_to_projectC
Add books to a RAG project for vectorization and context search
Inputs: project_name (required), book_ids (required).
create_projectB
Create a new RAG project for vector-based book search
Inputs: name (required), description.
fetchC
Fetch specific content from a book using epub:// URL
Inputs: url (required).
get_project_infoB
Get detailed information about a specific RAG project
Inputs: project_name (required).
list_projectsB
List all available RAG projects
Inputs: no named parameters.
searchB
Search the Calibre ebook library. Supports both full-text content search (default) and metadata search using field syntax.
Inputs: query (required), limit, fuzzy_fallback.
search_project_contextC
Search for relevant context chunks within a RAG project using vector similarity
Inputs: project_name (required), query (required), limit.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Most tools have distinct purposes, with clear boundaries between project management (create_project, list_projects, get_project_info, add_books_to_project, search_project_context), book content access (fetch), and general library search (search). The only potential overlap is between 'search' and 'search_project_context', but their descriptions clarify that one searches the library while the other searches within a specific project's vectorized context.
All tools follow a consistent snake_case verb_noun pattern with clear, descriptive names. The naming convention is uniform throughout: create_project, list_projects, get_project_info, add_books_to_project, search_project_context, fetch, and search. No deviations or mixed styles are present.
With 7 tools, the count is well-scoped for the server's purpose of managing Calibre RAG projects and searching ebook content. Each tool appears to earn its place, covering project lifecycle operations, content retrieval, and search functionality without being overly sparse or bloated.
The tool set provides good coverage for RAG project management (create, list, get info, add books, search context) and book access/search (fetch, search). A minor gap is the lack of project deletion or update tools, which could limit full lifecycle management, but core workflows for creating, populating, and querying projects are well-supported.
Maintenance
Related MCP Connectors
Ingest, manage, and retrieve documents for RAG-powered AI applications
Convert PDFs, Office docs, websites and audio into AI-ready Markdown, then search and ask your docs.
Academic literature search, retrieval, and private library management on top of OpenAlex.
Personal YouTube AI knowledge base powered by RAG. Query your subscribed YouTube channels.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides AI agents with research capabilities for local Calibre e-book libraries, including fulltext search across titles, ISBNs, and comments, plus structured excerpt retrieval from books.2GPL 3.0
- FlicenseNot gradedqualityDmaintenanceEnables semantic search and conversational querying across a personal research library of PDFs, DOCX, and other documents using a vector database. It provides tools for document summarization, finding related papers, and high-accuracy retrieval for AI clients like Claude Desktop.-
- AlicenseBqualityCmaintenanceConnects AI agents to Calibre ebook libraries for searching, reading, and managing digital collections. It supports metadata updates, format conversion, and full-text content searches while providing granular permission controls for library access.725MIT
- AlicenseNot gradedqualityDmaintenanceEnables searching, reading, and managing a Calibre ebook library through natural language, with features like metadata search, full-text search, content extraction, and library management.Apache 2.0