运行时依赖
无特殊依赖
安装命令
点击复制官方npx clawhub@latest install xiaohongshu-mcp
镜像加速npx clawhub@latest install xiaohongshu-mcp --registry https://cn.longxiaskill.com 镜像可用
本土化适配说明
Xiaohongshu (小红书) Automation — 小红书自动化 安装说明: 安装命令:["openclaw skills install xiaohongshu-mcp"] 支持国内镜像加速,使用 --registry https://cn.longxiaskill.com 参数可加速下载 该技能用于小红书相关操作,可能需要相应的平台账号或API密钥
技能文档
通过绑定的 Python 脚本自动化小红书(XHS)内容运营,该脚本与 xpzouying/xiaohongshu-mcp 服务器(8.4k+ 星标)交互。
项目地址:xpzouying/xiaohongshu-mcp
1. 本地服务器设置
此技能需要在本地机器上运行 xiaohongshu-mcp 服务器。
第一步:下载二进制文件
从 GitHub Releases 页面下载适合您系统的二进制文件。
| 平台 | MCP 服务器 | 登录工具 |
|---|---|---|
| macOS (Apple Silicon) | xiaohongshu-mcp-darwin-arm64 | xiaohongshu-login-darwin-arm64 |
| macOS (Intel) | xiaohongshu-mcp-darwin-amd64 | xiaohongshu-login-darwin-amd64 |
| Windows | xiaohongshu-mcp-windows-amd64.exe | xiaohongshu-login-windows-amd64.exe |
| Linux | xiaohongshu-mcp-linux-amd64 | xiaohongshu-login-linux-amd64 |
chmod +x xiaohongshu-mcp-darwin-arm64 xiaohongshu-login-darwin-arm64
第二步:登录(仅首次)
运行登录工具,它会打开浏览器窗口显示二维码。使用小红书手机 App 扫码登录。
./xiaohongshu-login-darwin-arm64
重要提示:请勿在其他网页浏览器中登录同一小红书账号,否则会使服务器的会话失效。
第三步:启动 MCP 服务器
在单独的终端窗口中运行 MCP 服务器。它将在后台运行。
# 以无头模式运行(推荐) ./xiaohongshu-mcp-darwin-arm64
# 或使用可见浏览器运行(用于调试) ./xiaohongshu-mcp-darwin-arm64 -headless=false
服务器将在 http://localhost:18060 可用。
2. 使用此技能
此技能包含一个 Python 客户端(scripts/xhs_client.py)来与本地服务器交互。您可以直接从命令行使用它。
可用命令
| 命令 | 描述 | 示例 |
|---|---|---|
| status | 检查登录状态 | python scripts/xhs_client.py status |
| search <关键词> | 搜索笔记 | python scripts/xhs_client.py search "咖啡" |
| detail | 获取笔记详情 | python scripts/xhs_client.py detail "note_id" "xsec_token" |
| feeds | 获取推荐内容流 | python scripts/xhs_client.py feeds |
| publish | 发布内容 | python scripts/xhs_client.py publish ... |