
CN Scraper MCP
io.github.goesByhcPublished by GitHub account goesByhcv0.4.1Updated Oct 25, 2026
MCP server for AI agents to search major Chinese internet platforms with local-first login support.
Overview
A local MCP server that lets an AI assistant search major Chinese platforms — Taobao, JD, Xiaohongshu, Zhihu, Weibo, Bilibili and more — using locally stored, g
- What you can do
- Search and read e-commerce listings on Taobao/Tmall, JD and Pinduoduo, including product details, prices and shops. Search and read content on Xiaohongshu, Zhihu, Weibo, Douyin, Bilibili, Douban, Dianping and Zsxq, including hot lists, posts, answers, videos, reviews and paginated comments. Manage platform logins: check cookie status, verify login, diagnose the environment, harvest cookies over CDP, and run a guided browser login.
- When to use it
- Useful when an assistant needs Chinese-language market, product, or social-media research that ordinary web search cannot reach because the platforms require login state, browser fingerprints or residential IPs. Best suited to individual research on a desktop machine rather than bulk collection.
- Requirements
- Runs locally as a Python package (pip install cn-scraper-mcp) over stdio; a local Chrome browser is needed for JD, Xiaohongshu and Douyin. Login cookies are stored in ~/.cn-scraper-cookies/ and a local Chrome profile. Optional Docker image and HTTP/SSE transport are configured through CN_SCRAPER_TRANSPORT, CN_SCRAPER_HOST, CN_SCRAPER_PORT and CN_SCRAPER_PATH. Desktop only.
Installation
In SourceWeft
- Open CN Scraper MCP in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
CN Scraper MCP
让 AI Agent 直接搜索中国互联网——淘宝、京东、小红书、知乎、微博、B站、知识星球……不再被反爬墙挡住。
[Python 3.11+] [MCP compatible] [MIT License] [CI]
这是什么
每个 AI Agent(Codex、Claude Code、Cursor、Trae)都能搜网页,但中文平台通常需要登录态、浏览器环境或平台专用参数:
- 淘宝:需要浏览器一致的网络指纹和登录 Cookie
- 京东:依赖已登录的本地浏览器环境
- 小红书:需要住宅 IP、本地浏览器和搜索结果中的访问参数
- 知乎:游客搜索已关闭,全部 API 需要登录态
- 拼多多:平台限制严格,目前不推荐使用
- 微博:搜索 API 需要登录态(SUB token),热搜游客即可访问
- 抖音:需要浏览器登录并可能人工处理验证码
- B站:搜索、热门、视频详情和评论可直接使用公开 API
- 豆瓣:条目搜索、条目详情和短评/影评
- 大众点评:商户搜索、商户详情和用户评价
- 知识星球:付费社群,内容藏在 cookie 认证的 REST API 后面
这个项目就是把踩了好几个月的坑打包成一个 MCP Server——你的 Agent 一句话就能搜:taobao_search("儿童学习桌")。
安全与隐私
cn-scraper-mcp 在你的电脑上本地运行,不需要把 Cookie、账号密码或浏览器 Profile 上传到任何中转服务器:
- Cookie 默认保存在
~/.cn-scraper-cookies/,京东登录态保存在本地 Chrome Profile。 - 登录过程直接发生在平台官方页面,软件不会读取或保存你的账号密码。
- Cookie 值不会写入日志,也不会通过 MCP 工具结果返回给 Agent;工具只返回状态、字段名和本地路径等非敏感信息。
- 发起抓取或在线登录验证时,凭证只会发送给对应平台域名。
- 代码完全开源,所有凭证处理流程都可以审查。
建议仍像保护浏览器登录态一样保护本机账号:不要分享 Cookie 文件,不要把凭证提交到 Git,并限制本地文件的访问权限。
平台支持
电商
¹ 淘宝无硬性限流,但平台可能随时收紧,不建议高频批量抓取。 ² 京东由本地 Chrome 生成登录态和动态签名,工具读取结构化 API 响应;通过
guided_login("jd")可自动初始化持久化 Profile。 ³ 拼多多每个浏览器会话仅放行第一次搜索,之后永久"系统繁忙"。单次搜索结果零实用价值,引擎代码保留但不推荐使用。
内容社区
⁴ 小红书只允许住宅 IP——云浏览器/数据中心 IP 直接封。必须用本地 Chrome。 ⁵ 抖音搜索需要登录态 + 手动过滑块验证码。支持 120s 等待用户手动验证,通过后自动抓取。
guided_login("douyin")可引导登录。
快速开始
安装
也可以从源码安装开发版本:
推荐:CDP 自动登录并保存 Cookie
安装并连接 MCP 后,直接让 Agent 调用:
它会打开本地 Chrome 并进入平台官方登录页。你自己扫码或输入密码后,工具通过 CDP 自动读取完整 Cookie(包括 JavaScript 无法读取的 HttpOnly Cookie),再保存到本机 ~/.cn-scraper-cookies/。京东则保存到本地持久化 Chrome Profile。
这是推荐方式,因为它不会要求你复制 Cookie,不容易漏掉关键字段,也更适合 Cookie 过期后的重新登录。可用平台名包括 taobao、jd、xiaohongshu、zhihu、weibo、zsxq、douyin、pdd、douban 和 dianping。
已有通过远程调试端口启动且登录完成的 Chrome 时,也可以调用:
启动
Docker
容器内预装 Chromium,无需本地浏览器:
远程服务器部署可以切换到 HTTP transport,通过 IP + 端口 连接:
远程 MCP endpoint:
也可以使用 Docker Compose:
可用环境变量:
远程 HTTP 模式会让 MCP 工具通过网络访问本机 Cookie/Profile 目录,请勿直接裸露公网端口。建议放在内网、VPN、防火墙白名单或带鉴权的反向代理后面。小红书、京东、抖音等依赖本地浏览器、住宅 IP 或人工验证码的平台,在远程服务器上的稳定性取决于服务器网络与图形环境。
当平台要求人工处理登录、验证码或风控页时,工具会返回统一的 ACTION_REQUIRED 结构,并在 action_required 字段中说明平台、原因、处理动作、处理链接和建议重试的工具。当前抖音验证码已接入该结构;远程 Docker 场景下仍需要你通过可见浏览器或后续 noVNC 网页完成验证。
Agent 集成配置:
请把 /本机绝对路径/ 替换为真实路径;MCP 客户端直接启动进程时不会替你展开 ~。
Docker 镜像内置 Chromium +
--no-sandbox。京东 headful 模式如需 Xvfb,设置环境变量XVFB_WRAPPER=1。小红书仍需住宅 IP——数据中心 IP 会被封。
MCP 工具一览
电商搜索
内容社区
Cookie 管理
MCP 客户端配置
Codex
~/.codex/config.toml:
保存后可用 codex mcp list 检查连接状态。
Claude Code / Cursor / Reasonix
这三个客户端都支持标准的 mcpServers JSON:
- Claude Code:项目根目录
.mcp.json - Cursor:全局
~/.cursor/mcp.json,或项目目录.cursor/mcp.json - Reasonix:项目根目录
.mcp.json
Trae
Trae 不同版本的配置文件位置可能不同。建议在设置中的 MCP 管理界面添加本地 stdio Server:名称填写 cn-scraper,命令填写 cn-scraper-mcp,参数留空。
如果客户端提示找不到命令,先用
where cn-scraper-mcp(Windows)或which cn-scraper-mcp(macOS/Linux)找到完整路径,再把command替换为该路径。
更多文档
常见问题
Q: 使用这个软件安全吗? 软件在你的电脑上本地运行,不经过项目方的中转服务器。Cookie 和浏览器 Profile 保存在本机,Cookie 值不会写入日志或通过 MCP 返回给 Agent;需要访问平台时,凭证只发送给对应的平台域名。
Q: 软件会读取或保存账号密码吗? 不会。登录发生在平台官方页面,由你自己扫码或输入密码;工具只在登录完成后通过 CDP 保存浏览器产生的 Cookie。
Q: Cookie 保存在什么地方?
Cookie 默认保存在 ~/.cn-scraper-cookies/,京东使用本地持久化 Chrome Profile。请像保护已登录浏览器一样保护这些文件,不要分享或提交到 Git。
Q: 怎么初始化 Cookie 最方便?
用 guided_login("平台名") 工具。它会自动打开 Chrome → 导航到登录页 → 等你扫码/输密码 → 登录后自动收割 Cookie 并保存。
Q: 合法吗? 仅用于学习和研究目的。批量抓取可能违反平台服务条款。风险自负。切勿用于垃圾信息、DDoS 或商业级大规模抓取。
许可证
MIT — 详见 LICENSE。
支持项目
如果这个项目帮你节省了时间,可以请作者喝杯咖啡:
致谢
- curl_cffi — TLS 指纹伪装
- FastMCP — MCP Server 框架
- websockets — 异步 WebSocket
Made with ☕ and months of frustration at Chinese platform anti-bot walls.
Source: README.md at commit f878f78
Tools
0Version history
1- v0.4.1LatestSep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts