Skip to main content
Glama
zhihu-scraper-mcp

zhihu-scraper-mcp

by luyanhexay

Zhihu Scraper MCP Server

An MCP Server that provides MCP clients with the ability to read full Zhihu article text, complete comment trees, and categorized search.

It is a thin wrapper around the zhihu-toolkit CLI (the zhihu command): each tool calls the CLI's --json interface and returns the results in a streamlined structure, avoiding fields such as avatars, HTML, and redundant timestamps that could bloat the model context.

It focuses on three capabilities: full answer/article text, complete comment trees, and categorized precise search — suitable for scenarios requiring precise lists, full text extraction, and comment retrieval.

Capability Overview

Tool

Purpose

search_questions

Search questions by keyword (title/description/answer count/view count/follower count/URL)

search_articles

Search articles by keyword (columns)

search_users

Search users by keyword

search_topics

Search topics by keyword

get_fulltext

Pass in a URL, return the full text of the answer/article (Markdown); for question URLs, return the merged full text of all answers

get_comments

Return the complete comment tree for any content (including nested comments, likes, authors, timestamps)

Related MCP server: ZhihuMCP

Environment Requirements

  • Python 3.12+

  • uv

  • A Zhihu login session (Cookie), imported via zhihu auth paste; this Server does not manage or store credentials.

Quick Start

See INSTALL.md (for Claude Code / Agent self-installation). For detailed tool parameters and usage recommendations, see USAGE.md.

One-liner version:

git clone https://github.com/luyanhexay/zhihu-scraper-mcp.git
cd zhihu-scraper-mcp
uv sync --locked
.venv/bin/zhihu auth paste     # 粘贴浏览器 DevTools 复制的 cURL,Ctrl+D 结束

Then register it in Claude Code (replace <ABS> with the absolute path to this repository):

claude mcp add zhihu-scraper -- <ABS>/.venv/bin/zhihu-scraper-mcp

Credentials and Privacy

  • Authentication information is stored by the zhihu CLI in ~/.zhihu-cli/, not in this repository.

  • This repository contains no cookies; .gitignore additionally blocks files such as cookies.json to prevent accidental submission.

  • Distributing this repository will not leak your Zhihu account. Users must import their own login session.

Known Issues

  • The HTML endpoint for a single answer is often blocked by Zhihu's risk control (__zse_ck). get_fulltext automatically falls back to the "pick the corresponding answer from the question API" path, so please try to pass the full answer URL containing /question/<id>/answer/<id>.

  • Search keywords should be concise (≤3 words); overly long queries tend to return empty results.

  • When risk control is triggered, first complete verification in the browser, then re-run zhihu auth paste to refresh the login session.

Acknowledgments

License

MIT

Available Tools

6 tools
get_commentsB

获取任意知乎内容(回答/文章/问题)下的完整评论树,含嵌套子评论、点赞数、作者与时间。

Inputs: url (required), max, sort.

get_fulltextA

获取一篇知乎回答/文章/问题的完整正文(Markdown)。传入 URL 即可,自动识别类型:回答与文章返回单篇全文;问题 URL 返回其下全部回答的合并全文。回答请用含 /question//answer/ 的完整 URL(裸 /answer/ 的 HTML 端点可能被风控)。

Inputs: url (required).

search_articlesA

按关键词搜索知乎文章(专栏),返回标题、作者、摘要与 URL。关键词精简(≤3 词,过长易返回空)。

Inputs: query (required), max.

search_questionsA

按关键词搜索知乎问题,返回问题标题、描述、回答数、浏览量、关注数与 URL。关键词精简(≤3 词,过长易返回空)。适合需要精确问题列表,或作为后续 get_fulltext / get_comments 抓正文、评论的入口。

Inputs: query (required), max.

search_topicsA

按关键词搜索知乎话题。关键词精简(≤3 词,过长易返回空)。

Inputs: query (required), max.

search_usersA

按关键词搜索知乎用户,返回昵称、简介、粉丝数与主页 URL。关键词精简(≤3 词,过长易返回空)。

Inputs: query (required), max.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4/5.0

    Scored across 6 tools

    Disambiguation5/5

    Each of the 6 tools has a unique, non-overlapping purpose: four discovery endpoints (questions/articles/users/topics) and two retrieval endpoints (full text/comments). The overlap-prone tool is get_fulltext, which gracefully handles multiple URL types through explicit, well-documented auto-detection rather than ambiguity. The distinct search_* endpoints use the resource type (question/article/user/topic) as an unambiguous differentiator.

    Naming Consistency5/5

    All tools consistently follow a lowercase snake_case verb_noun convention. The 'search_' prefix uniformly denotes list-returning queries, while 'get_' denotes content retrieval with a specific identifier, which is a clear and conventional semantic split. No mixing of casing styles or verb forms exists, creating a predictable, learnable API.

    Tool Count5/5

    Six tools is a well-scoped number for this domain: each tool serves a distinct, non-overlapping function, avoiding both under-powered overloading and needless fragmentation. The search endpoints could theoretically be merged, but keeping them separate preserves type-specific return schemas (e.g., questions include answer count, articles include author/abstract) without parameter bloat. Similarly, get_fulltext's auto-detection responsibly consolidates several potential get_* tools into one ergonomic interface.

    Completeness4/5

    For a read-only scraper, the surface is well-considered, covering discovery (all four primary Zhihu entities), full-content retrieval, and comment trees, which addresses the core use cases end-to-end. Minor gaps exist, such as no dedicated structured user profile endpoint or trending/hot-topic access, but these fall outside the stated purpose. Overall, the 4 search + 2 fetch design is coherent and fully functional for its intended role.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI agents to search, read, and analyze Zhihu content including questions, answers, comments, and user activities through the MCP protocol.
      5
      MIT
    • F
      license
      A
      quality
      B
      maintenance
      Read-focused MCP server for Zhihu, enabling retrieval of pins, articles, comments, and replies, with optional limited write tools for drafting and editing answers.
      10
      1
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      A lightweight, context-efficient CLI and optional stdio MCP server for semantic search, browsing, and writing to your Zotero library.
      BSD 3-Clause
    • F
      license
      Not graded
      quality
      C
      maintenance
      Provides MCP tools for searching Zhihu content, fetching answers and articles, and interacting with Zhihu's AI direct answer service, enabling content collection, monitoring, and research.
      4
      -