Ebook-MCP is a powerful Model Context Protocol (MCP) server for processing ebooks. It is built on the Model Context Protocol and provides a set of standardized APIs to enable seamless integration between LLM applications and ebook processing capabilities. It currently supports EPUB and PDF formats.
Purpose and Value
Ebook-MCP changes the way users interact with digital books, enabling readers to converse with reading materials in natural language. It can be seamlessly integrated into modern AI-driven IDEs such as Cursor and Claude, helping users achieve:
- Intelligent library management: for example, "Show all EPUB files in my Downloads folder" or "Find books about GenAI in my library."
- Interactive reading experience: have natural conversations with books, for example, "Briefly introduce the LLM Engineer Handbook," "What is Chapter 3 about?" "Summarize the key points about RAG in this book."
- Proactive learning support: enhance learning through AI-driven interaction, for example, "Create a quiz based on the RAG concepts in Chapter 5," "Explain the differences between the architectures discussed in this chapter," "Give me some hands-on exercises based on the concepts in this section."
- Content navigation: easily browse books with natural language queries, for example, "Find all sections that discuss prompt engineering," "Show the chapters about fine-tuning," "Take me to the section about vector databases."
By bridging the gap between traditional ebooks and AI capabilities, Ebook-MCP helps readers extract more value from their digital libraries through intuitive, conversation-based interaction.
Key Capabilities
Quick demo - run with DeepSeek (for all Claude/OpenAI examples, please see the mcp-client-example folder):
EPUB processing:
- Extract metadata (title, author, publication date, etc.)
- Extract table of contents
- Extract chapter content (supports Markdown output)
- Batch process EPUB files
PDF processing:
- Extract metadata (title, author, creation date, etc.)
- Extract content by page number
- Extract content by chapter title
- Supports Markdown output
- Batch process PDF files
Usage
- Clone the repository.
- Install dependencies using uv.
- Start the MCP server in development mode: can be in development modeRun the server, visit http://localhost:5173/ Perform testing and debugging, and you can also install the inspector for testing.
- Start the MCP server in production mode: run the server.
- Add the corresponding configuration in Cursor.
EPUB processing examples:
- Get all EPUB files in the specified directory.
- Get metadata from EPUB files.
- Get the table of contents from EPUB files.
- Get chapter content in Markdown format.
PDF processing examples:
- Get all PDF files in the specified directory.
- Get metadata from PDF files.
- Get the table of contents from PDF files.
- Get plain text content from a specific page.
- Get content in Markdown format from a specific page.
- Get chapter content and the corresponding page numbers by chapter title.
Key dependencies
- ebooklib: EPUB file processing
- PyPDF2: basic PDF processing
- PyMuPDF: advanced PDF processing
- beautifulsoup4: HTML parsing
- html2text: HTML to Markdown
- pydantic: data validation
- fastmcp: MCP server framework
Important notes and limitations
- PDF processing depends on the document's table of contents (TOC). If the TOC is missing, some features may not be available.
- For large PDF files, it is recommended to process by page range to avoid loading the entire file at once.
- EPUB chapter IDs must be obtained from the table of contents structure.
Issues and Pull Requests are welcome. For detailed change information, see CHANGELOG.md.