ebook-mcp

mcphub-com/ebook-mcp

4.8

ebook-mcp is hosted online, so all tools can be tested directly either in theInspector tabor in theOnline Client.

If you are the rightful owner of ebook-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

The ebook-mcp is a model context protocol server designed to extract content from PDF files efficiently.

Try ebook-mcp with chat:

Tools

Functions exposed to the LLM to take actions

get_pdf_local_path

Given a PDF URL, deterministically derive a local filename from the URL,
check the system temp directory, download if missing, and return the full path.

Returns:
    str: Full path to the local PDF file in the system temp directory.

Raises:
    ValueError: If the URL is invalid or not HTTP/HTTPS.
    URLError/HTTPError/OSError: If download or file operations fail.

get_all_epub_files

Get all epub files in a given path.

get_epub_metadata

Get metadata of a given ebook.

Args:
    epub_path: Full path to the ebook file.eg. "/Users/macbook/Downloads/test.epub"

Returns:
    List[Tuple[str, str]]: Return a list,Each element is a Tuple,contains key and value of metadata

Raises:
    FileNotFoundError: Raises when the epub file not found
    Exception: Raisers when running into parsing error of epub file

get_epub_toc

Get table of contents of a given EPUB file.

Args:
    epub_path: Full path to the ebook file.eg. "/Users/macbook/Downloads/test.epub"

Returns:
    List[Tuple[str, str]]: List of TOC entries, each entry is a tuple of (title, href)

Raises:
    FileNotFoundError: Raises when the EPUB file not found
    Exception: Raisers when running into parsing error of EPUB file

get_epub_chapter_markdown

Get content of a given chapter using the improved extraction method.

✅ RECOMMENDED: This tool fixes the truncation issue in the original version when processing subchapters.
It can correctly handle EPUB files with subchapters and provide complete chapter content.

This function uses extract_chapter_html which properly handles subchapters
and provides accurate chapter boundaries, fixing the issue where subchapters
in the TOC cause premature truncation of chapter content.

Args:
    epub_path: Full path to the ebook file. eg. "/Users/macbook/Downloads/test.epub"
    chapter_id: Chapter id of the chapter to get content (e.g., "chapter1.xhtml#section1_3")

Returns:
    str: Chapter content in markdown format

get_all_pdf_files

Get all PDF files in a given path.

get_pdf_metadata

Get metadata of a given PDF file.

Args:
    pdf_path: Full path to the PDF file.eg. "/Users/macbook/Downloads/test.pdf"

Returns:
    Dict[str, Union[str, List[str]]]: Dictionary containing metadata

Raises:
    FileNotFoundError: Raises when the PDF file not found
    Exception: Raisers when running into parsing error of PDF file

get_pdf_toc

Get table of contents of a given PDF file.

Args:
    pdf_path: Full path to the PDF file.eg. "/Users/macbook/Downloads/test.pdf"

Returns:
    List[Tuple[str, int]]: List of TOC entries, each entry is a tuple of (title, page_number)

Raises:
    FileNotFoundError: Raises when the PDF file not found
    Exception: Raisers when running into parsing error of PDF file

get_pdf_page_text

Get text content of a specific page in PDF file.

Args:
    pdf_path: Full path to the PDF file.eg. "/Users/macbook/Downloads/test.pdf"
    page_number: Page number to extract (1-based index)

Returns:
    str: Extracted text content

get_pdf_page_markdown

Get markdown formatted content of a specific page in PDF file.

Args:
    pdf_path: Full path to the PDF file.eg. "/Users/macbook/Downloads/test.pdf"
    page_number: Page number to extract (1-based index)

Returns:
    str: Markdown formatted text

get_pdf_chapter_content

Get content of a specific chapter in PDF file by its title.

Args:
    pdf_path: Full path to the PDF file.eg. "/Users/macbook/Downloads/test.pdf"
    chapter_title: Title of the chapter to extract

Returns:
    Tuple[str, List[int]]: Tuple containing (chapter_content, page_numbers)

Prompts

Interactive templates invoked by user choice

No prompts

Resources

Contextual data attached and managed by the client

No resources