zlib-mcp
zlib-mcp
stdio MCP サーバーで、あらゆる AI エージェントツール(Claude Code、Codex CLI、Cursor、Claude Desktop)に z-library の検索と書籍のダウンロード 機能を提供します。
アカウントはご自身のものを使用します。 共有バックエンドも API キーもプロキシもありません。サーバーはあなたのマシン上で動作し、z-library に直接接続して、あなたの認証情報とクォータを使用します。
ツール
ツール | 説明 | 認証情報が必要 |
| タイトル / 著者 / ISBN で検索。形式・言語・年のフィルターに対応 | 必要 |
| 1冊の書籍の直接ダウンロードリンクを取得します(ファイルは書き込まれません) | 必要 |
| 設定したディレクトリに書籍をダウンロードします | 必要 |
| 本日の残りダウンロード枠を確認します | 必要 |
| 一回限りのヘルパー: メールアドレス + パスワードを remix 認証情報に交換します | 不要 |
zlib_download は ZLIB_DOWNLOAD_DIR を設定した場合にのみ表示されます。デフォルトで任意の場所にファイルを書き込める MCP サーバーは許容できるデフォルトではないため、ディレクトリは自分で指定する必要があります。
Related MCP server: open-public-domain
要件
Node.js ≥ 20
z-library アカウント
5分でセットアップ
1. 認証情報を取得する
すでに remix_userid / remix_userkey をご存知の場合は、先に進んでください。それ以外の場合は、メールアドレスとパスワードだけでサーバーを追加し(下記の設定スニペットを参照)、エージェントに zlib_login を一度実行してもらい、返された remix_id / remix_key を設定に恒久的に記入してください。
ターミナルから直接実行することもできます:
ZLIB_EMAIL=you@example.com ZLIB_PASSWORD='…' npx zlib-mcp2. サーバーをクライアントに追加する
すべてのクライアントで同じ3つの要素を使用します: コマンド npx、引数 zlib-mcp、そして env ブロックです。
claude mcp add zlib \
--env ZLIB_REMIX_ID=123456 \
--env ZLIB_REMIX_KEY=your_remix_userkey \
--env ZLIB_DOWNLOAD_DIR="$HOME/Downloads/books" \
-- npx -y zlib-mcpまたは、以下の JSON を使用して ~/.claude.json / .mcp.json を直接編集してください。
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"zlib": {
"command": "npx",
"args": ["-y", "zlib-mcp"],
"env": {
"ZLIB_REMIX_ID": "123456",
"ZLIB_REMIX_KEY": "your_remix_userkey",
"ZLIB_DOWNLOAD_DIR": "/Users/you/Downloads/books"
}
}
}
}{
"mcpServers": {
"zlib": {
"command": "npx",
"args": ["-y", "zlib-mcp"],
"env": {
"ZLIB_REMIX_ID": "123456",
"ZLIB_REMIX_KEY": "your_remix_userkey",
"ZLIB_DOWNLOAD_DIR": "/Users/you/Downloads/books"
}
}
}
}[mcp_servers.zlib]
command = "npx"
args = ["-y", "zlib-mcp"]
[mcp_servers.zlib.env]
ZLIB_REMIX_ID = "123456"
ZLIB_REMIX_KEY = "your_remix_userkey"
ZLIB_DOWNLOAD_DIR = "/Users/you/Downloads/books"3. 試してみる
Kleppmann の Designing Data-Intensive Applications を epub で探して、最初の結果をダウンロードしてください。
設定
変数 | 必須 | デフォルト | 備考 |
| 2つのうち1つ | — | あなたの |
| 2つのうち1つ | — | あなたの |
| 2つのうち1つ | — | フォールバック: 初回使用時に remix 認証情報に交換されます |
| 2つのうち1つ | — | フォールバック。 |
| 不要 |
| 上流ミラー。ブロックされた場合は変更してください |
| 不要 | (未設定 → | ダウンロードの書き込み先 |
| 不要 |
| これを超えるファイルには |
| 不要 |
| リクエストごとの接続タイムアウト |
| 不要 |
|
|
| 不要 |
|
|
認証情報の優先順位
ZLIB_REMIX_ID+ZLIB_REMIX_KEY以前の
ZLIB_EMAILログインからのキャッシュされた認証情報(~/.zlib-mcp/credentials.json、モード600)ZLIB_EMAIL+ZLIB_PASSWORD→ 最初のツール呼び出し時にログイン(起動時ではありません)
キャッシュは、クライアントを再起動しても毎回新しいログインが発生しないようにするためにあります。繰り返しのログインこそが、z-library の不正利用防止システムにあなたが目をつけられる原因です。キャッシュには remix id とキーのみが保存されます。パスワードがディスクに書き込まれたり、ログに記録されたり、いかなるツールからも返されたりすることはありません。 Windows では 600 モードは何も行いません(OS が POSIX パーミッションを無視するため)。それが気になる場合は ZLIB_CREDENTIAL_CACHE=0 を設定してください。
何も設定されていなくても、サーバーは起動してツールを一覧表示します。ツールを呼び出すと、設定すべき内容の説明が返されます。クラッシュはしません。クラッシュした MCP サーバーは、ほとんどのクライアントで「利用不可」と表示されるだけで、デバッグの手がかりが何もありません。
トラブルシューティング
「上流ホスト … がこのリクエストをブロックしているようです」 — ミラーがアンチボットの壁の背後にあります。ZLIB_HOST を別のものに設定して、クライアントを再起動してください。既知のミラーは頻繁に変わります。1lib.sk は現在ブロックされており、pkuedu.xyz は現在動作しています。同じ /eapi/* エンドポイントを提供するものであれば何でも構いません。
「z-library が現在の認証情報を拒否しました」 — remix キーが期限切れです。zlib_login を再度実行して設定を更新してください。メールアドレス/パスワードのフォールバックを使用している場合は、~/.zlib-mcp/credentials.json を削除して新しいログインを強制してください。
「ダウンロードクォータに達しました」 — 無料アカウントは1日あたりのダウンロード数がわずかです。zlib_limits でカウンターを確認できます。カウンターは UTC の午前0時に z-library 側でリセットされます。
クライアントに何も表示されない — クライアントの MCP ログを確認してください。このサーバーはすべての診断情報を stderr に書き込みます。ZLIB_LOG_LEVEL=debug にするとより詳細な出力になります。
zlib_download がない — ZLIB_DOWNLOAD_DIR を設定していません。これは仕様です。
開発
pnpm install
pnpm check # format check → lint → typecheck → tests
pnpm build未リリース版を git から直接試すには、クライアントの command / args を npx / ["-y", "github:shiyi-0x7f/zlib-mcp"] に指定してください。prepare スクリプトがインストール時にビルドします。
テストは実際の上流には決してアクセスしません。fetch はすべてスタブ化されています。
法的情報
このツールは あなた自身の z-library アカウントへの API アクセスのみを提供します。何もホストせず、何も配布せず、著作権で保護されたコンテンツを一切同梱しません。お住まいの地域でこのツールの使用が合法であることを確認する責任はあなたにあります。あなたのアカウント、あなたのクォータ、あなたのリスク — 不正利用で停止されたアカウントは、あなたが失うものです。
ライセンス
MIT
Available Tools
4 toolszlib_get_download_urlGet z-library download URLA
Get a direct download URL for one book. Requires the "id" and "hash" from a zlib_search result. The link is short-lived and tied to the session that fetched it — use it right away, never cache or reuse it. Fetching a link consumes one unit of the account's daily download allowance (see zlib_limits). This server cannot save files to disk: set the ZLIB_DOWNLOAD_DIR environment variable in the MCP client config to a directory you want downloads written to, then restart the server to enable zlib_download.
Inputs: hash (required), book_id (required).
zlib_limitsCheck z-library download quotaA
Check the z-library account's daily download allowance: how many downloads were used today, the daily cap, and how many remain. Call this before a batch of downloads, or when a download fails with a quota error. Takes no arguments and does not consume any allowance.
Inputs: no named parameters.
zlib_loginExchange z-library credentialsA
Exchange a z-library email + password for the long-lived remix credentials (remix_id / remix_key). This is a one-time setup helper, not a per-call login: put the returned values into your MCP client config as ZLIB_REMIX_ID and ZLIB_REMIX_KEY, then restart the server. The password is never stored, logged, or returned. Do not call this before every search.
Inputs: email (required), password (required).
zlib_searchSearch z-libraryA
Search z-library for books. Returns a trimmed list — each entry carries the "id" and "hash" that zlib_get_download_url and zlib_download require, plus title/author/year/language/extension/size. Present the candidates to the user and let them pick before downloading anything.
Inputs: query (required), page, limit, order, +4 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool has a distinct purpose: search for books, fetch download URLs, check account limits, and handle login. No two tools overlap in functionality, making selection unambiguous.
All tools share the 'zlib_' prefix and most follow a verb-based pattern (search, get_download_url, login), but 'limits' is a noun rather than a verb like 'get_limits' or 'check_limits'. Minor deviation but still coherent.
With 4 tools covering search, URL generation, quota checking, and authentication, the set is well-scoped for a focused book download workflow. No redundant tools, and each one earns its place.
The descriptions repeatedly mention a 'zlib_download' tool and instructions for enabling it, but that tool is not included in the provided set. This leaves a critical gap in the core workflow, preventing actual file downloads.
Maintenance
Related MCP Connectors
An MCP server that gives your AI access to the source code and docs of all public github repos
Driflyte MCP server which lets AI assistants query topic-specific knowledge from web and GitHub.
Web search API and MCP server for developers building AI agents.
Official MCP server for Agentwork — delegate tasks to AI agents with human-in-the-loop
Related MCP Servers
- AlicenseAqualityDmaintenanceAn MCP server for searching and downloading books from Library Genesis, supporting EPUB, MOBI, PDF, and more through natural language queries.38MIT
- AlicenseNot gradedqualityDmaintenanceMCP server that gives AI agents access to the world's public domain library. Search, read, and navigate books and audiobooks from Project Gutenberg and LibriVox.MIT
- AlicenseAqualityDmaintenanceMCP server that lets AI agents search YouTube and fetch transcripts.23MIT
- AlicenseNot gradedqualityDmaintenanceMCP server for AI assistants to search and download ebooks from Z-Library and Anna's Archive, configured locally with automatic setup and download path.4AGPL 3.0