fix(xiaohongshu): switch from Docker MCP to xhs-cli (pipx install) (#236)

Docker + Cookie import → `pipx install xiaohongshu-cli` + `xhs login`.
Tier downgraded from 2 to 1. xhs-cli (1,477 stars) auto-extracts
cookies from browser, supports search/read/comment/post/hot/feed.

- xiaohongshu.py: check() detects `xhs` binary, parses `xhs status`
- cli.py: install via pipx instead of Docker
- skill/references/social.md: updated XHS commands
- tests: 3 new tests for CLI-based check()
- 77 tests passing

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Pnant
2026-03-31 17:17:19 +08:00
committed by GitHub
parent 15f161e5b5
commit bc2d554e13
4 changed files with 88 additions and 126 deletions
+21 -9
View File
@@ -2,23 +2,35 @@
小红书、抖音、Twitter/X、微博、B站、V2EX、Reddit。
## 小红书 / XiaoHongShu
## 小红书 / XiaoHongShu (xhs-cli)
```bash
# 搜索笔记
mcporter call 'xiaohongshu.search_feeds(keyword: "query")'
xhs search "query"
# 获取笔记详情
mcporter call 'xiaohongshu.get_feed_detail(feed_id: "xxx", xsec_token: "yyy")'
# 阅读笔记详情
xhs read NOTE_ID_OR_URL
# 获取笔记详情 + 评论
mcporter call 'xiaohongshu.get_feed_detail(feed_id: "xxx", xsec_token: "yyy", load_all_comments: true)'
# 查看评论
xhs comments NOTE_ID_OR_URL
# 发布内容
mcporter call 'xiaohongshu.publish_content(title: "标题", content: "正文", images: ["/path/img.jpg"], tags: ["tag"])'
# 浏览热门
xhs hot
# 推荐 feed
xhs feed
# 用户主页
xhs user USER_ID
xhs user-posts USER_ID
# 发帖/互动
xhs post --title "标题" --content "正文" --images img1.jpg img2.jpg
xhs like NOTE_ID
xhs comment NOTE_ID "评论内容"
```
> **需要登录**: 使用 Cookie-Editor 浏览器插件导出 cookies。运行 `agent-reach doctor` 检查状态
> **安装**: `pipx install xiaohongshu-cli`,然后 `xhs login`(自动从浏览器提取 Cookie)
## 抖音 / Douyin