用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/Youhai020616/xiaohongshu --skill xiaohongshu命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
基于 SOC 职业分类
| name | xiaohongshu |
| description | 小红书全能 Skill:发布图文/视频、搜索笔记、评论互动、数据看板、通知抓取、推荐词。 MCP 负责发布和互动(常驻),RedBookSkills CDP 负责数据分析和监控(按需启动)。 |
| metadata | {"trigger":"小红书相关操作(发布、搜索、评论、数据、通知)"} |
本 Skill 整合两套工具:
xiaohongshu/
├── SKILL.md
├── mcp/
│ ├── xiaohongshu-mcp-darwin-arm64
│ ├── xiaohongshu-login-darwin-arm64
│ └── cookies.json
├── scripts/
│ ├── cdp_publish.py
│ ├── chrome_launcher.py
│ ├── feed_explorer.py
│ ├── publish_pipeline.py
│ ├── account_manager.py
│ ├── image_downloader.py
│ └── run_lock.py
├── config/
│ └── accounts.json.example
├── requirements.txt
└── LICENSE
| 操作 | 用哪个 | 原因 |
|---|---|---|
| 发布图文/视频 | MCP | 29s 完成,零依赖 |
| 搜索笔记 | MCP | 常驻,响应快 |
| 评论/回复 | MCP | 稳定 |
| 点赞/收藏/关注 | MCP | 稳定 |
| 用户主页 | MCP | 稳定 |
| 数据看板 | CDP | MCP 不支持 |
| 通知抓取 | CDP | MCP 不支持 |
| 搜索推荐词 | CDP | MCP 不支持 |
| 笔记详情 | CDP | 更丰富的字段 |
cd {SKILL_DIR}/mcp
# 直连启动(大多数情况)
./xiaohongshu-mcp-darwin-arm64 -port :18060
# 如需代理(公司内网、IP 池等特殊场景)
# ./xiaohongshu-mcp-darwin-arm64 -port :18060 -rod "proxy=http://127.0.0.1:7897"
MCP 使用 JSON-RPC over HTTP(端口 18060)。调用流程:
# 1. 初始化 session
curl -s -X POST http://127.0.0.1:18060/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"openclaw","version":"1.0"}}}' \
-D -
# 从响应头拿 Mcp-Session-Id
# 2. 发送 initialized 通知
curl -s -X POST http://127.0.0.1:18060/mcp \
-H "Content-Type: application/json" \
-H "Mcp-Session-Id: YOUR_SESSION_ID" \
-d '{"jsonrpc":"2.0","method":"notifications/initialized"}'
# 3. 调用工具
curl -s -X POST http://127.0.0.1:18060/mcp \
-H "Content-Type: application/json" \
-H "Mcp-Session-Id: YOUR_SESSION_ID" \
-d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"TOOL_NAME","arguments":{...}}}'
| 工具名 | 参数 | 说明 |
|---|---|---|
| check_login_status | — | 检查登录状态(有 bug,建议用 search_feeds 验证) |
| get_login_qrcode | — | 获取登录二维码(Base64 图片) |
| delete_cookies | — | 删除 cookies,重置登录态 |
| publish_content | title, content, images, tags?, visibility?, is_original?, schedule_at? | 发布图文 |
| publish_with_video | title, content, video, tags?, visibility?, schedule_at? | 发布视频(本地绝对路径) |
| search_feeds | keyword, filters? | 搜索笔记 |
| get_feed_detail | feed_id, xsec_token, load_all_comments?, limit? | 获取笔记详情+评论 |
| post_comment_to_feed | feed_id, xsec_token, content | 评论笔记 |
| reply_comment_in_feed | feed_id, xsec_token, comment_id, user_id, content | 回复评论 |
| like_feed | feed_id, xsec_token, unlike? | 点赞/取消点赞 |
| favorite_feed | feed_id, xsec_token, unfavorite? | 收藏/取消收藏 |
| list_feeds | — | 获取首页 Feeds 列表 |
| user_profile | user_id, xsec_token | 获取用户主页+笔记 |
| get_self_info | — | 获取自己的信息 |
⚠️ 注意:视频发布工具名是
publish_with_video(不是publish_video),video 参数传本地绝对路径
{SKILL_DIR}/mcp/cookies.json-rod "proxy=http://127.0.0.1:7897"公开可见、仅自己可见、仅互关好友可见2024-01-20T10:30:00+08:00pip install -r {SKILL_DIR}/requirements.txt
Chrome 使用独立 Profile:~/Google/Chrome/XiaohongshuProfiles/default/
python3 {SKILL_DIR}/scripts/chrome_launcher.py # 有窗口
python3 {SKILL_DIR}/scripts/chrome_launcher.py --headless # 无头
python3 {SKILL_DIR}/scripts/chrome_launcher.py --kill # 关闭
python3 {SKILL_DIR}/scripts/cdp_publish.py login # 首次扫码
python3 {SKILL_DIR}/scripts/cdp_publish.py check-login # 检查(12h缓存)
python3 {SKILL_DIR}/scripts/cdp_publish.py content-data
python3 {SKILL_DIR}/scripts/cdp_publish.py --reuse-existing-tab content-data --csv-file "/path/output.csv"
python3 {SKILL_DIR}/scripts/cdp_publish.py get-notification-mentions
python3 {SKILL_DIR}/scripts/cdp_publish.py search-feeds --keyword "AI创业"
python3 {SKILL_DIR}/scripts/cdp_publish.py --reuse-existing-tab search-feeds --keyword "春招" --sort-by 最新 --note-type 图文
python3 {SKILL_DIR}/scripts/cdp_publish.py get-feed-detail --feed-id FEED_ID --xsec-token XSEC_TOKEN
python3 {SKILL_DIR}/scripts/cdp_publish.py post-comment-to-feed --feed-id FEED_ID --xsec-token XSEC_TOKEN --content "写得很实用"
python3 {SKILL_DIR}/scripts/publish_pipeline.py --headless \
--title-file title.txt --content-file content.txt --image-urls "URL1" "URL2"
全局参数在子命令前,子命令参数在子命令后:
python3 scripts/cdp_publish.py --reuse-existing-tab search-feeds --keyword "春招" --sort-by 最新
ps aux | grep xiaohongshu-mcp,重启服务即可chrome_launcher.py 启动 → cdp_publish.py login 扫码