Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add instructions/alizeeblack-code/zhihu-mcp/claude-mdgit clone --depth 1 https://github.com/alizeeblack-code/zhihu-mcpWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/instructions/alizeeblack-code/zhihu-mcp/claude-md)<a href="https://agentmods.dev/instructions/alizeeblack-code/zhihu-mcp/claude-md"><img src="https://agentmods.dev/badge/instructions/alizeeblack-code/zhihu-mcp/claude-md.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00827 | $0.00827 |
| Opus 5 | $0.00413 | $0.00413 |
| Sonnet 5 | $0.00165 | $0.00165 |
| Haiku 4.5 | $0.00083 | $0.00083 |
Grade A, and why
zhihu-mcp CLAUDE.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
What it actually says
CLAUDE.md
本项目使用中文作为主要沟通语言。提交说明、文档、注释优先使用中文。
项目概述
zhihu-mcp 是一个知乎 MCP 服务器,让 AI Agent 能与知乎交互。基于 Playwright + stealth 反检测驱动 headless Chromium 抓取知乎页面。
关键架构
- mcp_server.py — FastMCP 入口,注册所有 MCP 工具
- scraper.py — 核心 DOM 提取,所有 JS 在
page.evaluate()中执行 - browser/manager.py — Playwright 浏览器生命周期(persistent/non-persistent context)
- browser/stealth.py — 反检测 JS 注入(navigator.webdriver 覆盖、Canvas 噪声等)
- pinchtab_client.py — Pinchtab HTTP 后端(备用,当前未使用)
- cookies/manager.py — Cookie 加载/保存/提取
- storage.py — SQLite 活动数据存储
- config.py — 配置管理(BrowserConfig dataclass)
重要约束
page.evaluate() 只支持标准 CSS/JS
Playwright 伪选择器(:has-text()、:visible 等)在 page.evaluate() 内无效。必须用标准 DOM API:
// 错误:document.querySelector('button:has-text("评论")')
// 正确:
for (const b of document.querySelectorAll('button')) {
if (b.textContent.includes('评论')) { b.click(); break; }
}
知乎 DOM 选择器(已验证)
| 元素 | 选择器 | 注意 |
|---|---|---|
| 回答作者 | .AuthorInfo-content .UserLink-link |
跳过空头像链接(遍历取首个有文本的) |
| 点赞数 | button[aria-label*="赞同"] |
解析 aria-label 属性,不是 textContent |
| 评论数 | .ContentItem-actions button 含 "条评论" |
不要用全局 button,会匹配到问题级评论按钮 |
| 评论内容 | .CommentContent |
文本直接在元素内,作者在父元素的兄弟节点 a[href*="/people/"] |
| 回答数 | .List-headerText |
数字含逗号(1,003),需 replace(/,/g, '') |
| 回答页多按钮 | 回答页同时显示多个回答 | 用 .ContentItem-actions 限定作用域,避免取到其他回答的数据 |
评论 URL 匹配
get_comments 判断是否需要导航时,必须比较完整路径(url.split('?')[0]),不能截断比较——同一问题下不同回答 URL 前缀相同。
代理绕过
浏览器启动参数包含 --proxy-bypass-list=*.zhihu.com,zhihu.com,*.zhimg.com,访问知乎时不走系统代理。
开发与测试
- 测试脚本在
tests/目录(已 gitignored) tests/test_core.py是主要的集成测试脚本- 默认使用 headless 模式(
config.browser.headless = True),调试时可改为False - 需要有效的
cookies.json(含z_c0认证 token)才能正常抓取
已知限制
- 搜索功能(SPA 渲染)不稳定,
wait_for_selector时机问题 - 问题页仅加载首屏约 5 条回答,更多需要实现滚动加载
- CSS Modules 类名(如
css-14nvvry)不稳定,不要依赖
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 4d ago First seen · 60 lines · 827 tokens per session scan A 80962bf073b6
zhihu-mcp CLAUDE.md is an instructions file published in the GitHub repository alizeeblack-code/zhihu-mcp (4 stars, last pushed 6mo ago), licensed MIT. It adds 827 tokens to every session, about $0.0041 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other instructions, from other repositories
Browser4 CLAUDE.md
Claude Code instructions for platonai/Browser4, covering browser4 — project context for claude, architecture, key dispatch chain (cli → browser), batch commands and e2e test structure.
fix-quera AGENTS.md
Instructions for AlirezaKeshavarz83/fix-quera, covering agent guidance, project shape, visual style, quera page data findings and compatibility findings.
fast-browser CLAUDE.md
Claude Code instructions for m4ttstack/fast-browser, covering fast browser plugin, where a change belongs, fork branch: use fast-browser-runtime, releasing a new runtime and re-pinning this repo: use the script.
sendblue-browser-use AGENTS.md
Instructions for sendblue-api/sendblue-browser-use, covering agents.md — sendblue-browser-use, what this repo is, setup, common commands and health (no auth).
sniff AGENTS.md
AGENTS.md instructions for Aboudjem/sniff, covering agents.md: sniff, what this repo is, how an agent should use sniff, handling the playwright setup gate and finding output schema.
browser_oxide AGENTS.md
AGENTS.md instructions for yfedoseev/browser_oxide, covering browseroxide — conventions for ai coding assistants, build & test, architecture, key conventions and where to read more.