npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

book-downloader-mcp-server

v1.0.0

Published

MCP server to search and download books using Anna's Archive API

Readme

Book Downloader MCP Server

This MCP (Model Context Protocol) server allows you to search for books using Anna's Archive API and download them directly to your computer's Downloads folder.

Note: This tool uses the Anna's Archive API via RapidAPI to provide a more reliable and consistent experience compared to web scraping methods.

Prerequisites

  • Node.js (v16 or higher recommended)
  • npm (comes with Node.js)

MCP Configuration

To use this server with an LLM or other MCP-compatible client, register it with the following configuration. This setup will automatically download and run the server in a temporary environment without requiring a manual global installation:

{
  "mcpServers": {
    "book-downloader": {
      "command": "sh",
      "args": [
        "-c",
        "cd $(mktemp -d) && npm install book-downloader-mcp-server && npx book-downloader-mcp-server-cli"
      ]
      // "env": {} // Add environment variables here if your server needs them in the future
    }
  }
}

Explanation of the command:

  • sh -c "...": Executes the provided string as a shell command.
  • cd $(mktemp -d): Creates a unique temporary directory and changes the current directory into it. This keeps the installation isolated.
  • npm install book-downloader-mcp-server: Installs your package (and its dependencies) into this temporary directory.
  • npx book-downloader-mcp-server-cli: Executes the command-line interface (book-downloader-mcp-server-cli) that was made available by installing your package. npx handles finding and running the binary.

This ensures the MCP client always uses the latest version of book-downloader-mcp-server available on npm each time it starts (or according to npm install's caching behavior for subsequent runs within the same client session if the temp directory isn't cleared immediately).

Available Tools

searchAndDownloadBook

Searches for books using Anna's Archive API and attempts to download them in the preferred format to your system's default Downloads folder.

Parameters:

  • query (string, required): The search term for the book. This can be the book's title, author, ISBN, or other relevant keywords.
    • Example: "The Hitchhiker's Guide to the Galaxy"
  • format (string, optional): The preferred book format. Accepts 'PDF', 'EPUB', 'MOBI', 'AZW3', or 'any'. Defaults to 'any' if not specified.
    • Example: "epub"
  • category (string, optional): Book categories to search. Options include 'fiction', 'nonfiction', 'comic', 'magazine', 'musicalscore', 'other', 'unknown'. Defaults to 'fiction, nonfiction'.
    • Example: "fiction, comic"
  • limit (number, optional): Maximum number of search results to return. Defaults to 10.
    • Example: 20
  • bookIndex (number, optional): If provided, selects the book at this index from search results.
    • Example: 0

Example Usage (conceptual, depends on your LLM/client): LLM, please use the book-downloader to find 'Sapiens by Yuval Noah Harari' and download it as an EPUB.

This would translate to an MCP tool call like: searchAndDownloadBook({ query: "Sapiens by Yuval Noah Harari", format: "epub" })

How it Works (Briefly)

  1. The searchAndDownloadBook tool receives a query and optional parameters.
  2. It constructs an API request to Anna's Archive API via RapidAPI.
  3. It processes the search results and presents a list of matching books if no specific book index is provided.
  4. When a book is selected (either automatically or by the user providing a book index), it fetches additional book information and initiates the download.
  5. The book content is streamed to a file in your OS's default Downloads folder.

Important Notes:

  • Reliability: This tool uses the Anna's Archive API which provides a more reliable and consistent experience compared to web scraping methods.
  • Download Location: Books are saved to your operating system's standard Downloads folder (e.g., ~/Downloads on macOS/Linux, C:\Users\YourUser\Downloads on Windows).
  • Error Handling: Comprehensive error handling is in place to handle various API response scenarios.
  • API Key: The tool uses a RapidAPI key to access the Anna's Archive API.