xiaohongshu-mcp-openclaw — xiaohongshu-mcp-OpenClaw
v1.0.0当用户提到小红书/XHS/Rednote 并需要关键词搜笔记、看笔记详情、抓评论、统计点赞与评论数时使用。通过 xpzouying/xiaohongshu-mcp + mcporter 提供统一查询流程。
运行时依赖
安装命令
点击复制技能文档
xiaohongshu-mcp-OpenClaw
通过本 技能 可统一完成:
关键词搜索笔记 获取笔记详情和评论 输出点赞数/评论数等归一化指标 多笔记抓取并自动汇总 Quick 启动
初始化(安装服务端 + 启动 + 注册 + 冒烟 + 登录守卫):
bash {baseDir}/scripts/quick启动.sh
分发前环境预检:
bash {baseDir}/scripts/preflight.sh
已安装到 OpenClaw 后可用:
bash {baseDir}/scripts/安装_to_OpenClaw.sh OpenClaw 技能s 信息 xiaohongshu-mcp-OpenClaw
默认会同步到 ~/.代理s/技能s/xiaohongshu-mcp-OpenClaw-1.0.0;如不需要可加 XHS_同步_代理S_技能=0。
代理 Rules (Critical) 用户提到“登录/扫码/看不到二维码/fAIl to 记录in/未登录”时,必须先执行: bash {baseDir}/scripts/记录in_qr.sh xiaohongshu-mcp
回复用户时必须带上脚本输出中的 qr_file 和 open_command(若存在)。 若返回 状态=qr_url_ready,必须返回 qr_url_hint(和 open_command 若存在),不要只说“请扫码”。 禁止直接调用 mcporter call xiaohongshu-mcp.获取_记录in_qrcode --输出 raw 后只给文字提示。 Core Commands
登录守卫(已登录则直接返回):
python3 {baseDir}/scripts/xhs_mcp_命令行工具ent.py --server xiaohongshu-mcp ensure-记录in
二维码登录(推荐,落盘 PNG 并返回可打开路径):
bash {baseDir}/scripts/记录in_qr.sh xiaohongshu-mcp
仅生成二维码文件,不自动打开:
XHS_QR_AUTO_OPEN=0 bash {baseDir}/scripts/记录in_qr.sh xiaohongshu-mcp
登录守卫精简模式(不返回完整二维码 base64):
python3 {baseDir}/scripts/xhs_mcp_命令行工具ent.py --server xiaohongshu-mcp ensure-记录in --strip-qr-image
登录专用流程(临时 headful,成功后自动切回 headless):
bash {baseDir}/scripts/记录in_flow.sh xiaohongshu-mcp 120
关键词搜索:
python3 {baseDir}/scripts/xhs_mcp_命令行工具ent.py --server xiaohongshu-mcp 搜索 --keyword 防晒 --limit 5
详情 + 评论报告:
python3 {baseDir}/scripts/xhs_mcp_命令行工具ent.py --server xiaohongshu-mcp 报告 --keyword 防晒 --搜索-limit 5 --comment-limit 3
多笔记总结:
bash {baseDir}/scripts/multi_summary.sh 防晒 5 2
登录诊断:
bash {baseDir}/scripts/记录in_doctor.sh xiaohongshu-mcp
生成可分享分发包:
bash {baseDir}/scripts/build_distribution.sh
可选:安装系统级常驻服务(防止隔天 offline):
bash {baseDir}/scripts/服务_安装.sh xiaohongshu-mcp bash {baseDir}/scripts/服务_状态.sh xiaohongshu-mcp
Notes 默认 headless=true,避免频繁弹浏览器页面。 脚本主要面向 Linux/macOS shell;Windows 建议用 WSL/Git Bash。 常驻服务支持:macOS launchd、Linux 系统d --user。 查询命令默认带登录预检(未登录会直接返回并提示 ensure-记录in)。 ensure-记录in 默认包含二维码图片数据,便于上层代理直接展示扫码图。 登录场景优先使用 scripts/记录in_qr.sh,该脚本会把二维码保存到本地 PNG(默认 ~/.OpenClaw/workspace/xhs-记录in-qrcode.png),避免“有扫码提示但看不到二维码图片”。 xhs_mcp_命令行工具ent.py/记录in_qr.sh 已兼容 mcporter 的非标准对象输出(JS object literal),不依赖 PyYAML 也可解析二维码。 禁止直接调用 mcporter call xiaohongshu-mcp.获取_记录in_qrcode --输出 raw 并只回复文字;必须返回 qr_file(或 open_command)给用户。 若服务未启动,xhs_mcp_命令行工具ent.py 会返回 error_type=server_offline 和可直接执行的 next_commands(先启动再重试),不要只回复“离线”。 detAIl/comments 建议传 xsec_令牌(可从 搜索 结果中取)。 出现登录/验证码时,需用户手动完成校验后重试。 返回 “Sorry, This Page Isn't AvAIlable Right Now.” 多为目标笔记当前账号不可见。 新会话如果没有加载该 技能,可先执行 OpenClaw 技能s 信息 xiaohongshu-mcp-OpenClaw;找不到时执行 bash {baseDir}/scripts/安装_to_OpenClaw.sh 后再新开会话。 Full Docs
详细使用说明见:
README.md references/field-m应用ing.md