zhihu-scraper-mcp

zhihu-scraper-mcp

Provides full-text retrieval of Zhihu answers/articles, complete comment trees, and type-specific search (questions, articles, users, topics) by wrapping the zhihu CLI.

Category
Visit Server

README

知乎 Scraper MCP Server

一个 MCP Server,为 MCP 客户端提供知乎全文正文、完整评论树、分类型搜索的读取能力。

它是对 zhihu-toolkit CLIzhihu 命令)的薄封装:每个工具都调用 CLI 的 --json 接口,把结果裁剪成精简结构再返回,避免头像/HTML/冗余时间戳等字段撑爆模型上下文。

它专注三块能力:回答/文章全文完整评论树按类型的精确搜索——适合需要精确列表、抓正文、抓评论的场景。

能力概览

工具 作用
search_questions 按关键词搜索问题(标题/描述/回答数/浏览量/关注数/URL)
search_articles 按关键词搜索文章(专栏)
search_users 按关键词搜索用户
search_topics 按关键词搜索话题
get_fulltext 传入 URL,返回回答/文章的完整正文(Markdown);问题 URL 返回其下全部回答的合并全文
get_comments 返回任意内容下的完整评论树(含嵌套子评论、点赞、作者、时间)

环境要求

  • Python 3.12+
  • uv
  • 一份知乎登录态(Cookie),通过 zhihu auth paste 导入;本 Server 不管理、不存储凭据。

快速开始

INSTALL.md(面向 Claude Code / Agent 自安装)。工具的详细参数与使用建议见 USAGE.md

一句话版本:

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 结束

然后在 Claude Code 中注册(把 <ABS> 换成本仓库绝对路径):

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

凭据与隐私

  • 认证信息由 zhihu CLI 存放在 ~/.zhihu-cli/不在本仓库内
  • 本仓库不包含任何 Cookie;.gitignore 额外拦截 cookies.json 等文件以防误提交。
  • 分发本仓库不会泄露你的知乎账号。使用者需自行导入自己的登录态。

已知问题

  • 单篇回答的 HTML 端点常被知乎风控(__zse_ck)拦截。get_fulltext 会自动回退到"从问题 API 中挑出对应回答"的路径,因此请尽量传/question/<id>/answer/<id> 的完整回答 URL
  • 搜索关键词要精简(≤3 词),过长易返回空。
  • 触发风控时先在浏览器完成验证,再重新 zhihu auth paste 刷新登录态。

致谢

License

MIT

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured