# goesByhc/cn-scraper-mcp [Health: Active]

**Category:** 🔎 Search & Data Extraction  
**Repository:** https://github.com/goesByhc/cn-scraper-mcp  
**GitHub Stars:** 87  
**Views:** 23  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/goesbyhc-cn-scraper-mcp

## Description
MCP server that lets AI agents search and extract data from major Chinese internet platforms including Taobao, JD, Xiaohongshu, Zhihu, Weibo, Bilibili, ZSXQ, Douban, and Dianping, with local-first cookie storage and CDP-assisted login.

## Tools
Capabilities this server exposes over MCP:

- **taobao_search** — 搜索淘宝/天猫商品。纯脚本，无需浏览器，不限流。

原理: curl_cffi 伪造 Chrome TLS 指纹 + MTOP HMAC-MD5 签名。
需要 TAOBAO_COOKIES_FILE 环境变量或 ~/.cn-scraper-cookies/taobao.json。

并发安全: ✅ 纯 HTTP/REST API，无共享状态，任意并发调用安全。
- **jd_search** — 搜索京东商品。需要已登录的有头 Chrome（会自动启动）。

京东 headless 返回 0 结果 → 必须 headful。
需要持久登录 profile (~/.jd_login_profile)。
首次使用需在弹窗 Chrome 中手动登录 jd.com 一次。

并发: ⚠️ 使用 BrowserLock 保护 CDP 端口，同端口调用自动串行化。
- **jd_product** — 获取京东商品详情（名称、价格、店铺、规格）。需要本地 Chrome。

sku 来自 jd_search 结果中 item 的 sku 字段。

并发: ⚠️ 使用 BrowserLock 保护 CDP 端口。
- **pdd_search** — 搜索拼多多商品。需要 Chrome + PDD cookie（PDDAccessToken + pdd_user_id）。

⚠️ 严重限制：拼多多手机搜索**每个浏览器会话仅允许一次搜索**。
第一次搜索后，所有后续搜索返回「系统繁忙」。
如需再次搜索，必须重启 MCP server 以创建新的浏览器会话。

原理: Chrome CDP + iPhone UA 模拟手机浏览器搜索。
Cookie 文件: ~/.cn-scraper-cookies/pdd.json
Token 有效期约 1 小时，需定期从手机浏览器重新导出。

并发: ⚠️ 使用 BrowserLock 保护 CDP 端口，同端口调用自动串行化。
- **pdd_product_detail** — 获取拼多多商品详情（名称、价格、原价、销量、规格）。

商品详情独立于搜索限制 — 不限次数。
- **xiaohongshu_search** — 搜索小红书笔记。需要本地 Chrome + XHS 登录 cookie。

小红书只允许住宅 IP（本地 Chrome）——云浏览器/数据中心 IP 直接封。
需要 XHS cookies: web_session, a1, webId, gid 等。
Cookie 文件: ~/.cn-scraper-cookies/xiaohongshu.json

并发: ⚠️ 使用 BrowserLock 保护 CDP 端口，同端口调用自动串行化。
- **xiaohongshu_note** — 获取小红书笔记详情（标题、正文、点赞、标签、评论）。

note_id 和 xsec_token 都来自同一条 xiaohongshu_search 结果。
- **xiaohongshu_comments** — 获取小红书笔记的评论（首屏，约 10-20 条）。

需要本地 Chrome + XHS 登录 cookie。
note_id 和 xsec_token 都来自同一条 xiaohongshu_search 结果。
- **zhihu_search** — 搜索知乎内容（问题/文章）。知乎已关闭游客搜索，需要有效登录 Cookie。

无需浏览器——直接调知乎 v4 search API。
需要 cookie: ~/.cn-scraper-cookies/zhihu.json（z_c0 + d_c0）

并发安全: ✅ 纯 HTTP/REST API，无共享状态，任意并发调用安全。
- **zhihu_hot_list** — 获取知乎实时热榜。无需登录。

Returns:
    {items: [{title, url, excerpt, hot_metric}]}
- **zhihu_comments** — 获取知乎回答的评论（支持分页）。需要登录 cookie。

answer_id 来自 zhihu_search 结果中 type 为 "answer" 的 item 的 id 字段。
- **zhihu_answer** — 获取知乎回答的完整正文。

answer_id 来自 zhihu_search 结果中 type 为 "answer" 的 item 的 id 字段。
- **zhihu_question_answers** — 获取知乎问题下的回答列表。

question_id 来自 zhihu_search 结果中 type 为 "question" 的 item 的 id 字段。
- **weibo_search** — 搜索微博帖子。需要登录 cookies（SUB token）。

⚠️ 微博搜索 API 需要登录 — 游客模式不可用。
热搜（weibo_hot_list）无需登录即可使用。

原理: 调用 m.weibo.cn 移动端 API，解析 cards[].mblog。
Cookie 文件: ~/.cn-scraper-cookies/weibo.json（需要 SUB cookie）

并发安全: ✅ 纯 HTTP/REST API，无共享状态，任意并发调用安全。
- **weibo_hot_list** — 获取微博实时热搜榜。**无需登录！**

原理: 调用 weibo.com/ajax/side/hotSearch（游客可访问）。
返回实时热搜 50 条 + 置顶政务话题。

并发安全: ✅ 纯 HTTP/REST API，无共享状态，任意并发调用安全。

Returns:
    {count, items: [{rank, word, num, url, label}], hotgov: {name, url}|null}
- **weibo_user_timeline** — 获取微博用户时间线（最近发言）。

需要登录 cookie（SUB token）。
可通过 weibo_search 找到目标用户获取其 UID。
- **weibo_comments** — 获取微博帖子的评论（支持分页）。需要登录 cookie（SUB token）。

mid 来自 weibo_search 或 weibo_user_timeline 结果中 item 的 id 字段。
- **taobao_product** — 获取淘宝商品详情（标题、价格、店铺）。

item_id 来自 taobao_search 结果中 item 的 id 字段。

并发安全: ✅ 纯 HTTP/MTOP API。
- **weibo_post** — 获取微博帖子的完整详情（含长文本）。

mid 来自 weibo_search 或 weibo_user_timeline 结果中的 item.id。
- **douyin_search** — 搜索抖音视频 — CDP 浏览器自动轮询，验证码自动等待。

需要 Chrome 已登录抖音（用 guided_login 先登录）。
弹出验证码时持续等待你手动过，通过后自动抓取结果。
- **douyin_hot_list** — 抖音实时热搜榜。需要登录 cookie（首次用 guided_login 收割）。

Returns:
    {count, items: [{word, hot_value, position, label}]}
- **douyin_video** — 获取抖音视频详情（标题、作者、点赞、描述）。需要 Chrome。

video_id 来自 douyin_search 结果中 item 的 video_id 字段。
- **douyin_comments** — 获取抖音视频评论（首屏）。需要登录 cookie。

video_id 来自 douyin_search 结果中 item 的 video_id 字段。
- **bilibili_search** — 搜索 B 站视频。公开 HTTP API，无需登录或浏览器。
- **bilibili_popular** — 获取 B 站当前热门视频榜。公开 HTTP API，无需登录或浏览器。
- **bilibili_video** — 获取 B 站视频详情及互动统计。无需登录或浏览器。

bvid 来自 bilibili_search 或 bilibili_popular 结果。
- **bilibili_comments** — 获取 B 站视频一级评论，支持游标分页。无需登录或浏览器。

bvid 来自 bilibili_search 或 bilibili_popular；下一页传回上次结果中的
next_cursor。评论按 B 站热门评论模式返回。
- **douban_search** — 搜索豆瓣书籍、电影、音乐等条目。
- **douban_subject** — 获取豆瓣条目详情。subject_id 来自 douban_search。
- **douban_reviews** — 获取豆瓣条目的短评/影评。支持 start 分页。
- **dianping_search** — 搜索大众点评商户。city 用于给 Agent 记录搜索城市。
- **dianping_shop** — 获取大众点评商户详情。shop_id 来自 dianping_search。
- **dianping_reviews** — 获取大众点评商户评价。
- **zsxq_topics** — 获取知识星球 (ZSXQ) 付费社群最新帖子。

纯 REST API，无需浏览器，只需 cookie。
Cookie 文件: ~/.cn-scraper-cookies/zsxq.json (需要 zsxq_access_token)

并发安全: ✅ 纯 HTTP/REST API，无共享状态，任意并发调用安全。
- **zsxq_article** — 获取知识星球文章全文。

article_url 来自 zsxq_topics 结果中的 topic 对象，
仅当 topic 类型为文章时可用（talk.article.inline_article_url）。
- **harvest_cookies** — 从用户自己的浏览器会话中自动提取 cookie（包括 HttpOnly cookie）。

通过 Chrome DevTools Protocol (CDP) 的 Network.getAllCookies 提取
浏览器 cookie jar 中的所有 cookie（含 HttpOnly，这是 JS 无法获取的）。
仅提取用户**自己**的浏览器会话——浏览器须已在指定端口运行且已登录。

非 profile 平台的 Cookie 保存到认证注册表指定的 JSON 文件。
京东使用持久化 Chrome profile，请改用 guided_login。
- **guided_login** — 打开浏览器让你登录平台，自动检测登录态并收割 Cookie。

自动打开 Chrome → 导航到平台登录页 → 你扫码/输入密码 →
检测到你登录成功后自动收割 Cookie 并保存。

无需手动操作 CDP 端口——全程自动化。
- **check_cookies** — 检查所有平台的 cookie 文件是否存在、有效字段及新鲜度。

Cookie 文件查找路径 (按优先级):
  1. 平台专用环境变量 (如 TAOBAO_COOKIES_FILE)
  2. ~/.cn-scraper-cookies/<name>.json (推荐)
JD 特殊: 检查 Chrome profile 目录 ~/.jd_login_profile

Returns:
    {taobao, xiaohongshu, zhihu, zsxq, jd, pdd:
        {exists, valid, missing_fields, path, age_hours, stale}}
- **verify_login** — 远端验证缓存登录态是否仍被平台接受。

这与 check_cookies 的本地文件检查不同：本工具会发起只读在线请求。
当前可远端验证：知乎、微博、知识星球、抖音。
淘宝等没有稳定只读验证接口的平台会明确返回 unsupported。
- **diagnose** — 诊断平台环境 — 检查 Python、依赖、Chrome、CDP 端口、Cookie、最近错误。

不做任何实际抓取，纯本地诊断。每项检查超时 5 秒。

Returns:
    sections:
      platform:      {package_version, python_version}
      dependencies:  {fastmcp: {installed, version}, curl_cffi: {...}, ...}
      browsers:      {chrome: {found, path, version}, obscura: {found, path}}
      cdp_ports:     {9222: {in_use}, 9247: {...}, 9251: {...}}
      cookies:       来自 check_all_cookies() 的结果
      diagnostics:   {recent_errors: [...]}

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `uvx` (confidence: high):

```json
"mcpServers": {
  "cn-scraper-mcp": {
    "command": "uvx",
    "args": ["cn-scraper-mcp"]
  }
}
```

## Documentation

## What goesByhc/cn-scraper-mcp does

goesByhc/cn-scraper-mcp MCP server gives agents MCP tools for searching and extracting structured information from Chinese e-commerce, social, video, review, and paid-community platforms. Supported operations include product searches and details for Taobao, JD, and Pinduoduo; note searches, details, and comments for Xiaohongshu; and question, answer, comment, and hot-list access for Zhihu.

The server also covers Weibo search, posts, timelines, comments, and hot searches; Douyin search, video details, comments, and hot searches; Bilibili search, popular videos, video details, and first-level comments; and Douban searches, subject details, and reviews. README documentation additionally lists Dianping merchant operations and ZSXQ topic and article access.

As a 🔎 Search & Data Extraction tool, it fits agents that need platform-specific results rather than generic web-page text. Returned identifiers can be passed into detail or comment tools—for example, a Taobao item ID, JD SKU, Bilibili BV ID, or a Xiaohongshu note ID with its associated access token.

## How it works

The implementation selects a retrieval method for each platform. Some tools use public or authenticated REST/JSON APIs, including Zhihu, Weibo, and Bilibili. Taobao uses HTTP requests with Chrome-like TLS behavior and MTOP signing. Browser-dependent tools use local Chrome through CDP, including JD, Xiaohongshu, Pinduoduo, and Douyin.

Cookies normally reside under `~/.cn-scraper-cookies/`, while JD uses a persistent local Chrome profile. `guided_login` opens an official platform login page and saves browser cookies after the user completes login. `harvest_cookies` can collect cookies from an already logged-in Chrome session. `check_cookies`, `verify_login`, and `diagnose` help inspect authentication and environment state.

## Setup and configuration

Install the package with `pip install cn-scraper-mcp`, or install a development checkout from the repository. Start it with `cn-scraper-mcp` or `python -m cn_scraper_mcp.server`. The default transport is stdio. HTTP and SSE modes can be selected with `CN_SCRAPER_TRANSPORT`, with `CN_SCRAPER_HOST`, `CN_SCRAPER_PORT`, and `CN_SCRAPER_PATH` controlling the listener.

Docker images include Chromium. Mount the cookie directory and JD profile when using a container. Remote HTTP deployments should not expose the endpoint directly to the public internet because MCP requests can access local credentials and browser state. JD headful operation may require Xvfb in a container.

## Tools and capabilities

- Search and retrieve products from Taobao, JD, and Pinduoduo.
- Search Xiaohongshu notes and retrieve note details or first-page comments.
- Search Zhihu and retrieve hot lists, answers, question answers, and paginated comments.
- Search Weibo and retrieve hot searches, user timelines, post details, and comments.
- Search Douyin and retrieve video details, comments, and hot searches.
- Search Bilibili and retrieve popular videos, video metadata, and cursor-paginated comments.
- Search Douban entries and retrieve subjects and reviews.
- Manage cookies, guided logins, login verification, and diagnostics.

## Limitations and notes

goesByhc/cn-scraper-mcp MCP server has platform-specific constraints. JD requires a logged-in headful Chrome session. Xiaohongshu requires local Chrome, login cookies, and a residential IP; data-center IPs may be blocked. Douyin may pause for a manually solved CAPTCHA. Zhihu search and several authenticated operations require login cookies, while Weibo search requires its `SUB` cookie.

Pinduoduo mobile search is limited to one search per browser session; restarting the MCP server creates a new session, while product detail requests are not subject to that search limit. Bilibili is intended for low-frequency calls. Douban and Dianping may trigger platform or page-level risk controls. Protect cookie files and browser profiles like logged-in browser data, and review each platform's terms before automated or bulk collection.

_Full upstream README: https://allmcps.com/mcp/goesbyhc-cn-scraper-mcp/readme_

