Calibre RAG MCP Server
Enables semantic search and contextual conversations with your Calibre ebook library using vector-based RAG technology. Supports project-based organization, multi-format book processing, and OCR capabilities for enhanced content extraction and retrieval.
README
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
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-nodejs
- Install dependencies:
npm install
- Run setup (Windows):
setup.bat
Configuration
The server automatically detects your Calibre library location. For custom configurations, modify the settings in server.js.
Usage
Starting the Server
npm start
Available 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 guide
Testing
Run the test suite:
npm test
Individual 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 start
Contributing
- 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
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。