Skip to main content
Glama
shiyi-0x7f

zlib-mcp

by shiyi-0x7f

zlib-mcp

stdio MCP 서버로, 모든 AI 에이전트 도구(Claude Code, Codex CLI, Cursor, Claude Desktop)에 z-library 검색 및 책 다운로드 기능을 제공합니다.

자신의 계정을 사용하세요. 공유 백엔드, API 키, 프록시가 없습니다. 서버는 사용자 머신에서 실행되며 z-library에 직접 연결하고 사용자의 자격 증명과 할당량을 사용합니다.

도구

도구

기능

자격 증명 필요

zlib_search

제목 / 저자 / ISBN으로 검색, 형식, 언어, 연도 필터 지원

예

zlib_get_download_url

책 한 권의 직접 다운로드 링크 가져오기(파일 저장 없음)

예

zlib_download

설정한 디렉터리에 책 다운로드

예

zlib_limits

오늘 남은 다운로드 허용량 확인

예

zlib_login

일회성 도우미: 이메일 + 비밀번호를 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-mcp

2. 클라이언트에 서버 추가하기

모든 클라이언트는 동일한 세 가지를 사용합니다: 명령 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으로 찾아서, 첫 번째 결과를 다운로드해 줘.

구성

변수

필수 여부

기본값

설명

ZLIB_REMIX_ID

둘 중 하나

—

사용자의 remix_userid

ZLIB_REMIX_KEY

둘 중 하나

—

사용자의 remix_userkey

ZLIB_EMAIL

둘 중 하나

—

대체: 첫 사용 시 remix 자격 증명으로 교환됨

ZLIB_PASSWORD

둘 중 하나

—

대체, ZLIB_EMAIL와 함께 사용

ZLIB_HOST

아니요

pkuedu.xyz

업스트림 미러; 차단되면 변경

ZLIB_DOWNLOAD_DIR

아니요

(설정 안 함 → zlib_download 비활성화)

다운로드가 저장되는 위치

ZLIB_MAX_DOWNLOAD_BYTES

아니요

524288000 (500 MB)

이 크기를 초과하는 파일은 allow_large: true 필요

ZLIB_TIMEOUT_MS

아니요

20000

요청별 연결 타임아웃

ZLIB_CREDENTIAL_CACHE

아니요

1

0으로 설정하면 ~/.zlib-mcp/credentials.json을 절대 쓰지 않음

ZLIB_LOG_LEVEL

아니요

info

debug / info / warn / error / silent; 모든 로그는 stderr로 출력됩니다

자격 증명 우선순위

  1. ZLIB_REMIX_ID + ZLIB_REMIX_KEY

  2. 이전 ZLIB_EMAIL 로그인의 캐시된 자격 증명(~/.zlib-mcp/credentials.json, 모드 600)

  3. ZLIB_EMAIL + ZLIB_PASSWORD → 첫 도구 호출 시 로그인, 시작 시 아님

캐시는 클라이언트를 재시작해도 매번 새 로그인을 유발하지 않도록 하기 위해 존재합니다. 반복적인 로그인이 z-library의 남용 방지 시스템이 사용자를 감지하게 만드는 원인입니다. 캐시에는 remix id와 키만 저장됩니다. 비밀번호는 절대 디스크에 기록되지 않으며, 로그에 남지 않고, 어떤 도구로도 반환되지 않습니다. Windows에서 600 모드는 아무 효과가 없습니다(OS가 POSIX 권한을 무시함). 이 점이 중요하다면 ZLIB_CREDENTIAL_CACHE=0을 설정하세요.

아무것도 설정하지 않아도 서버는 시작되고 도구 목록을 표시합니다. 도구를 호출하면 설정해야 할 내용에 대한 안내가 반환됩니다. 서버는 충돌하지 않습니다. 충돌한 MCP 서버는 대부분의 클라이언트에서 "unavailable"로만 표시되어 디버깅할 것이 없습니다.

문제 해결

"Upstream host … appears to be blocking this request" — 미러가 안티봇 벽 뒤에 있습니다. ZLIB_HOST를 다른 것으로 설정하고 클라이언트를 재시작하세요. 알려진 미러는 자주 바뀝니다. 1lib.sk는 현재 차단되어 있고, pkuedu.xyz는 현재 작동합니다. 동일한 /eapi/* 엔드포인트를 제공하는 어떤 것이든 됩니다.

"z-library rejected the current credentials" — remix 키가 만료되었습니다. zlib_login을 다시 실행하고 설정을 업데이트하세요. 이메일/비밀번호 대체 방식을 사용한다면 ~/.zlib-mcp/credentials.json을 삭제하여 새 로그인을 강제하세요.

"download quota reached" — 무료 계정은 하루에 소량의 다운로드만 가능합니다. zlib_limits가 카운터를 표시합니다. z-library 측에서 UTC 기준 자정에 초기화됩니다.

클라이언트에 아무것도 표시되지 않음 — 클라이언트의 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 tools
zlib_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.

ParametersJSON Schema
NameRequiredDescriptionDefault
hashYesThe "hash" field from the same zlib_search result. Must match the book_id.
book_idYesThe "id" field from a zlib_search result.

TDQS

A4.3/5.0
Behavior5/5

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

No annotations are present, so the description carries full responsibility—and it delivers: discloses short-lived session-bound links, no caching/reuse, daily allowance consumption, and the server's inability to save files unless an env var is set. This is exceptional behavioral disclosure for a tool with zero annotations.

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

Conciseness4/5

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

Four sentences, each earning its place, with the primary action stated first. Slightly long due to the environment variable note, but no redundant filler.

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

Completeness4/5

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

Covers input provenance, link lifetime, usage constraint, allowance impact, and prerequisite server configuration. Missing explicit error behavior or response shape details, but the tool's output is simple (a URL) and no output schema exists.

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

Parameters3/5

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

Schema description coverage is 100%, with both book_id and hash already described, including the 'must match' relationship. The description reiterates that they come from a zlib_search result but adds no new semantic detail beyond what the schema already provides.

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?

States a specific verb and resource ('Get a direct download URL for one book') and identifies the required inputs (id and hash from zlib_search). This clearly differentiates it from siblings like zlib_search, zlib_limits, and zlib_login.

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?

Clearly indicates when it should be used: after obtaining a zlib_search result, and warns to use the link immediately without caching or reuse. It also notes the allowance consumption and points to zlib_limits, though it doesn't explicitly state when not to use it.

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

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.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations provided, the description carries the burden, and it does well by stating that 'does not consume any allowance'—a key safety guarantee for a quota-check operation. It also implies the output fields (used, cap, remaining). It doesn't mention authentication requirements or error behavior if not logged in, which is a minor gap.

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 deliver the core purpose, usage triggers, and side-effect profile without any filler. The most important information (what it checks) is front-loaded, followed by when to use it and the safety guarantee—every clause earns its place.

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

Completeness4/5

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

For a simple zero-parameter tool without an output schema, this description is quite complete: it lists the returned values (used, cap, remain) and when to call it. The main omission is whether authentication is required before calling, given the account-specific nature and the existence of zlib_login as a sibling.

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

Parameters4/5

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

The input schema is empty with 100% coverage, so there are no parameters to describe. The description redundantly notes 'Takes no arguments,' which adds no semantic value but does confirm the expectation. A baseline of 4 is appropriate for zero-parameter tools.

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 ('Check') and clearly identifies the resource: the z-library account's daily download allowance. It details exactly what information is provided (used today, daily cap, remaining), which sets it apart from the sibling tools focused on searching, downloading, or logging in.

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?

It explicitly says when to call the tool: before a batch of downloads, or when a download fails with a quota error. It doesn't mention when not to use it or point to alternatives, but given there are no sibling tools that check quotas, the guidance is clear and sufficient.

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

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
emailYesz-library account email.
passwordYesz-library account password. Never echoed back, logged, or written to disk.

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations, the description carries the full behavioral burden and does so well: it discloses that the password is never stored, logged, or returned, that the returned credentials are long-lived, and that the server must be restarted. This goes well beyond the schema.

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?

Every sentence earns its place: operation, lifecycle context, security disclosure, and anti-misuse warning. It is front-loaded with the core purpose and avoids redundancy.

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

Completeness5/5

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

Despite having no output schema and no annotations, the description explains what the call returns, how to use the returned values, and the one-time nature of the operation. For a two-parameter setup tool, this is complete and actionable.

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

Parameters3/5

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

The input schema already documents both parameters fully, so the baseline is 3. The description clarifies the overall purpose of email/password and the long-lived credentials, but adds no additional format or constraint semantics for the parameters themselves.

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?

States a specific action and resource: 'Exchange a z-library email + password for the long-lived remix credentials (remix_id / remix_key).' It clearly distinguishes itself from the sibling search/download/limit tools by positioning as a one-time setup helper rather than a per-call operation.

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

Usage Guidelines5/5

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

Explicitly says when to use ('one-time setup helper'), when not to ('not a per-call login', 'Do not call this before every search'), and what to do after calling (configure ZLIB_REMIX_ID/ZLIB_REMIX_KEY and restart). This gives an agent a clear decision boundary.

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.

  1. 4 tool updatesv0.1.2
    • First observedzlib_get_download_url
    • First observedzlib_limits
    • First observedzlib_login
    • First observedzlib_search

TDQS

A4.3/5.0

Scored across 4 tools

Disambiguation5/5

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.

Naming Consistency4/5

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.

Tool Count5/5

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.

Completeness2/5

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

ActivitySlowing
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers