SuperAPI AI Directory

ebook-mcp

Ebook-MCP is a server based on the Model Context Protocol (MCP) for processing ebooks. It provides a standardized API that enables LLM applications to seamlessly integrate with ebook processing capabilities, and currently supports EPUB and PDF formats. Through it, users can interact with digital books using natural language, enabling intelligent library management, interactive reading, proactive learning support, and content navigation, and it can be integrated into AI-driven IDEs such as Cursor and Claude.

Open website

About this tool

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

  1. Clone the repository.
  2. Install dependencies using uv.
  3. 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.
  4. Start the MCP server in production mode: run the server.
  5. 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.