Skip to main content
Glama
mateogon

download-books-mcp

by mateogon

download-books-mcp

Local MCP server and Codex skill for agent-driven book search and download through LibGen and Z-Library / Zeta Library.

This repo wraps two existing Python clients:

The purpose is to make those sources usable from MCP clients such as Codex, Claude Code, and other agents while keeping provider-specific details out of the agent-facing tool contract. The README is explicit for humans and GitHub search; the MCP tools and skill use neutral provider labels and clean IDs.

The MCP surface is intentionally small:

  • search_books(...) returns clean candidates with a temporary id.

  • download_book(id=...) downloads the selected candidate into a local library folder.

Internally, the server can query LibGen, Z-Library / Zeta Library, or both. Externally, provider internals stay behind neutral labels (provider_1, provider_2, all) so agents can use the MCP tools without handling provider-specific links, hashes, mirrors, URLs, or identifiers.

Use only sources, credentials, and documents you are authorized to access.

Install

git clone https://github.com/mateogon/download-books-mcp.git
cd download-books-mcp
uv sync

Copy the environment example and fill local values:

cp .env.example .env

Important settings:

DOWNLOAD_BOOKS_PROVIDER=all
DOWNLOAD_BOOKS_LIBRARY_DIR=~/Downloads/books
BOOK_PROVIDER_2_EMAIL=
BOOK_PROVIDER_2_PASSWORD=

Related MCP server: librarian

Agent Installation

There are two pieces:

  • MCP server: the runtime tools agents call.

  • Skill: the workflow that tells Codex how to use those tools cleanly.

Add the MCP server to Codex by copying examples/codex-config.toml into ~/.codex/config.toml and replacing /absolute/path/to/download-books-mcp with your clone path.

Install the Codex skill:

./scripts/install-codex-skill.sh

Restart Codex after changing MCP config or installing the skill.

For Hermes, use examples/hermes-mcp.yaml.

MCP Tools

search_books

Parameters:

query: str
limit: int = 10
preferred_language: str = "English"
provider_name: str = "default"  # default | all | provider_1 | provider_2
search_type: str = "default"    # default | title | author
topic: str = "books"
preferred_author: str | None = None

Clean results include:

id, title, author, year, language, extension, size, publisher, pages, score

Raw provider internals are cached locally for download_book, but they are not returned in normal MCP results.

download_book

Parameters:

id: str | int
library_dir: str | None = None

If library_dir is omitted, the server uses DOWNLOAD_BOOKS_LIBRARY_DIR.

Default output layout:

<library_dir>/Sources/<Author - Title>/00 - Fuentes/<Title>.<extension>

CLI

Search clean candidates:

uv run download-books search "The Embodied Mind" --search-type title --limit 10

Download a selected result:

uv run download-books download <ID>

Local diagnostic output:

uv run download-books search "The Embodied Mind" --raw --json

Provider Routing

Visible provider options are:

  • default uses DOWNLOAD_BOOKS_PROVIDER, defaulting to all

  • all searches every available configured provider

  • provider_1 searches only the LibGen adapter

  • provider_2 searches only the Z-Library / Zeta Library adapter

Agents should normally leave provider routing at default.

The MCP and skill intentionally keep the neutral names. Humans reading this repo should understand the mapping; agents using the tool should not need to.

Development

uv run --extra dev pytest
uv run python -m compileall src

Available Tools

2 tools
download_bookA

Download a book selected by its id from a previous search_books result.

ParametersJSON Schema
NameRequiredDescriptionDefault
idYes
library_dir_pathNo

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A3.6/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It only says 'Download', which implies a side-effect operation, but does not disclose where the book is saved, whether library_dir_path is required for that, what happens on failure, or any other behavioral details. This is a significant transparency gap for an action that likely writes files.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single, direct sentence that front-loads the verb and object and contains no filler. Every word earns its place by clarifying the source of the id.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a two-parameter tool, the essential workflow is conveyed: use an id from search_books. However, the optional library_dir_path parameter is left unexplained, and with no annotations there is no guidance on side effects or postconditions. The presence of an output schema reduces the need to document return values, but the behavioral gap keeps this from being fully complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds meaning to 'id' by stating it comes from a search_books result, which helps an agent understand its origin and type. However, library_dir_path is entirely undocumented—neither the schema nor the description explains what it controls (presumably the save directory). With 0% schema description coverage, the description needed to compensate and only partially did.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb ('Download'), a resource ('a book selected by its id'), and the source of that id ('from a previous search_books result'). This clearly distinguishes download_book from its sibling search_books: one searches, the other downloads.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The phrase 'from a previous search_books result' explicitly positions this tool as the follow-up step after a search, giving clear context for when to use it. It does not provide explicit exclusions, but the intended sequence is evident enough to guide an agent correctly.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search_booksA

Search book metadata through configured providers. Returns clean results with an id for download_book.

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNo
queryYes
topicNobooks
search_typeNodefault
provider_nameNodefault
preferred_authorNo
preferred_languageNoEnglish

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.5/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the burden of disclosing behavior. It discloses that results are 'clean' and include an id for download, but it does not mention provider behavior, limits, error handling, or filtering semantics. This is adequate but minimal.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, front-loaded with the core action, with no wasted words. Each sentence adds value: the first states what the tool does, the second states the output's purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With seven parameters, no annotations, and no schema descriptions, the description leaves too much unstated. The existence of an output schema reduces the need to document return shape, but the lack of parameter semantics and behavioral caveats makes the overall definition incomplete for an agent to invoke confidently.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, and the description provides no explanation for any of the seven parameters. While parameter names like 'query' and 'limit' are somewhat self-explanatory, 'search_type', 'provider_name', 'preferred_author', and 'preferred_language' lack any semantic guidance. The description does not compensate for the missing schema descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('Search') and resource ('book metadata'), and clearly states the output's purpose ('id for download_book'), which distinguishes it from the sibling tool. It is immediately clear what the tool does.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies a clear usage context: search for book metadata to obtain an id, then use that id with download_book. It does not give explicit exclusions or alternative conditions, but the workflow context is evident.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 2 tool updatesv0.1.0
    • First observeddownload_book
    • First observedsearch_books

TDQS

A4/5.0

Scored across 2 tools

Disambiguation5/5

The two tools have clearly distinct purposes: one searches for books and returns metadata with IDs, the other downloads a specific book by ID. There is no overlap or ambiguity between them.

Naming Consistency5/5

Both tools follow a consistent verb_noun pattern: search_books and download_book. The slight singular/plural difference is natural and does not create inconsistency.

Tool Count4/5

With only 2 tools, the server is on the thin side, but given its narrow purpose of searching and downloading books, this count is appropriate and each tool clearly earns its place.

Completeness5/5

The server covers the essential workflow for its domain: discover books via search, then download via ID. This forms a complete user journey with no dead ends or obvious missing operations.

Maintenance

ActivityStale
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    B
    maintenance
    An MCP server that lets an LLM browse, search, and download books from OPDS catalogs (e.g., Project Gutenberg, Standard Ebooks) using tools for feed navigation, full-text search, and acquisition link downloads.
    4
    1
    AGPL 3.0
  • A
    license
    A
    quality
    A
    maintenance
    Enables browsing, searching, and quote verification of a local ebook library via MCP, providing deterministic RAG with no embeddings or network.
    6
    2
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables searching for lawful, free-to-read books across multiple open catalogues and resolving access routes (download, read, borrow, preview) via MCP tools like search_books and resolve_access.
    MIT
  • A
    license
    A
    quality
    B
    maintenance
    An MCP server that lets AI agents search and download books from z-library using the user's own account credentials.
    4
    34
    1
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mateogon/download-books-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server