zhihu-scraper-mcp
Provides tools for searching questions, articles, users, and topics on Zhihu, and for retrieving full-text content and comment trees for answers and articles.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@zhihu-scraper-mcp search questions about machine learning"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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 by keyword (title/description/answer count/view count/follower count/URL) |
| Search articles by keyword (columns) |
| Search users by keyword |
| Search topics by keyword |
| Pass in a URL, return the full text of the answer/article (Markdown); for question URLs, return the merged full text of all answers |
| Return the complete comment tree for any content (including nested comments, likes, authors, timestamps) |
Related MCP server: ZhihuMCP
Environment Requirements
Python
3.12+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-mcpCredentials and Privacy
Authentication information is stored by the
zhihuCLI in~/.zhihu-cli/, not in this repository.This repository contains no cookies;
.gitignoreadditionally blocks files such ascookies.jsonto 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_fulltextautomatically 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 pasteto refresh the login session.
Acknowledgments
License
MIT
Available Tools
6 toolsget_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
Scored across 6 tools
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.
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.
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.
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
Related MCP Connectors
Zhihu/知乎 hot list, search/details, comments/replies, creators/articles, and video transcripts.
Weibo posts, hot search, comments and profiles to JSON. No login or cookies needed.
Reddit posts, full comment trees, searches, subreddits and users, as JSON or Markdown for LLMs.
Search and fetch Wikidata entities, execute SPARQL queries, and resolve external identifiers.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to search, read, and analyze Zhihu content including questions, answers, comments, and user activities through the MCP protocol.5MIT
- FlicenseAqualityBmaintenanceRead-focused MCP server for Zhihu, enabling retrieval of pins, articles, comments, and replies, with optional limited write tools for drafting and editing answers.101-
- AlicenseNot gradedqualityDmaintenanceA lightweight, context-efficient CLI and optional stdio MCP server for semantic search, browsing, and writing to your Zotero library.BSD 3-Clause
- FlicenseNot gradedqualityCmaintenanceProvides 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-