🎯 现在支持 OpenClaw! 使用 HTTP API 适配器在 OpenClaw 中实现小红书自动化。详见 OpenClaw 快速开始。
A powerful plugin for automating content publishing to Xiaohongshu (Little Red Book) via the xiaohongshu-mcp server.
- Publish image/text content to Xiaohongshu
- Publish video content to Xiaohongshu
- Check login status and get QR code
- Search for content on Xiaohongshu
- Get detailed information about feeds
- Post comments to feeds
- List feeds from homepage
- Like and favorite feeds
- Get user profile information
- xiaohongshu-mcp server running locally or remotely
- Node.js 18+ (for running the publish scripts)
- Cursor (Recommended) - Full MCP support with SSE transport
- Claude Code - Official CLI with MCP support
- Cline - AI assistant with MCP integration
- VSCode - With MCP extension
- OpenClaw - Does not support SSE MCP transport (see OPENCRAW_MCP_ISSUE.md for details)
xiaohongshu-mcp uses SSE (Server-Sent Events) for MCP transport, which requires:
- Persistent HTTP connections
- Server-to-client event streaming
- Session state management
OpenClaw's Skill system uses simple function calls and cannot maintain SSE connections.
Solution: Use Cursor, Claude Code, or other MCP-compatible clients instead.
✨ 现在支持 OpenClaw! 通过 HTTP API 适配器实现小红书自动化
三步快速开始:
-
启动 xiaohongshu-mcp:
cd /path/to/xiaohongshu-mcp && npm start
-
安装适配器:
./install-adapter.sh
-
重启 OpenClaw 并开始使用:
/check-login # 检查登录状态 /publish "标题" "内容" ["/path/img.jpg"] ["标签"]
📖 完整指南: OpenClaw 使用指南 | 快速开始
-
Install Cursor: https://cursor.sh/
-
Create MCP config (
.cursor/mcp.json):{ "mcpServers": { "xiaohongshu-mcp": { "url": "http://localhost:18060/mcp", "description": "小红书 MCP 服务" } } } -
Start xiaohongshu-mcp:
cd /path/to/xiaohongshu-mcp npm start -
Restart Cursor and start publishing!
# Add MCP server
claude mcp add --transport http xiaohongshu-mcp http://localhost:18060/mcp
# Verify connection
claude mcp listnpx @modelcontextprotocol/inspector
# Open browser and connect to: http://localhost:18060/mcpBefore using this skill, you need to deploy and run the xiaohongshu-mcp server:
-
Clone the xiaohongshu-mcp repository:
git clone https://github.com/xpzouying/xiaohongshu-mcp.git cd xiaohongshu-mcp -
Install dependencies and start the server:
npm install npm start
-
By default, the MCP server will run on
http://127.0.0.1:18060/mcp
This Skill depends on the xiaohongshu-mcp server for all operations. Special thanks to xpzouying for developing the xiaohongshu-mcp project, which made this Skill possible.
Run the installation script:
./install.shThe script will:
- Check if OpenClaw is installed
- Verify xiaohongshu-mcp server status
- Copy files to OpenClaw skills directory
- Set proper permissions
- Verify the installation
Then:
-
Start xiaohongshu-mcp server (if not running):
cd /path/to/xiaohongshu-mcp npm start -
Restart OpenClaw:
openclaw restart # or completely quit and reopen OpenClaw -
Test the installation:
node test-mcp-client.js
# Create installation directory
mkdir -p ~/.openclaw/skills/xiaohongshu-auto-publish
# Copy files
cp index.js ~/.openclaw/skills/xiaohongshu-auto-publish/
cp openclaw.plugin.json ~/.openclaw/skills/xiaohongshu-auto-publish/
cp -r commands ~/.openclaw/skills/xiaohongshu-auto-publish/
cp -r skills ~/.openclaw/skills/xiaohongshu-auto-publish/
# Set permissions
chmod +x ~/.openclaw/skills/xiaohongshu-auto-publish/index.jsFor detailed installation instructions, see INSTALL.md.
./uninstall.sh-
Clone this repository:
git clone https://github.com/yourusername/xiaohongshu-skill.git cd xiaohongshu-skill -
Ensure xiaohongshu-mcp server is running (see Prerequisites)
-
Install this plugin in your Claude Code plugins directory
-
Restart Claude Code
/check-login
This will:
- Check if you're logged in to Xiaohongshu
- Display QR code if not logged in
- Save QR code to
/tmp/xiaohongshu_qrcode.png
/publish-image-text "标题" "正文内容" ["图片路径1", "图片路径2"] ["标签1", "标签2"]
Example:
/publish-image-text "今天吃了好吃的" "推荐一家超好吃的餐厅!" ["/path/to/image1.jpg", "/path/to/image2.jpg"] ["美食", "生活"]
/publish-video "标题" "正文内容" "/path/to/video.mp4" ["标签1", "标签2"]
Example:
/publish-video "旅行vlog" "分享今天的旅行经历" "/path/to/video.mp4" ["旅行", "生活"]
To schedule a post for later (1 hour to 14 days in the future), add the schedule time:
/publish-image-text "标题" "内容" ["/path/to/image.jpg"] ["标签"] "2024-01-20T10:30:00+08:00"
/list-feeds
This will return the list of feeds from your Xiaohongshu homepage.
/search-feeds "关键词" {"sort_by": "最多点赞", "note_type": "图文"}
Available filters:
- sort_by: 综合|最新|最多点赞|最多评论|最多收藏
- note_type: 不限|视频|图文
- publish_time: 不限|一天内|一周内|半年内
- search_scope: 不限|已看过|未看过|已关注
- location: 不限|同城|附近
/get-feed-detail "feed_id" "xsec_token"
To get feed details with all comments:
/get-feed-detail "feed_id" "xsec_token" true 50
/post-comment "feed_id" "xsec_token" "评论内容"
The MCP server URL defaults to http://127.0.0.1:18060/mcp. To change it, set the environment variable:
export XIAOHONGSHU_MCP_URL="http://your-server:port/mcp"This Skill implements a complete MCP (Model Context Protocol) client that:
- Session Management: Initializes and maintains MCP session with the server
- Tool Discovery: Automatically fetches available tools from the MCP server
- Protocol Compliance: Follows the MCP 2024-11-05 specification
- Error Handling: Gracefully handles connection failures and retries
OpenClaw Skill MCP Client xiaohongshu-mcp
│ │ │
│ tools() │ │
├─────────────────────>│ │
│ │ initialize │
│ ├───────────────────────>│
│ │ ← session info │
│ │<───────────────────────┤
│ │ │
│ │ tools/list │
│ ├───────────────────────>│
│ │ ← tool definitions │
│ │<───────────────────────┤
│ ← tool definitions │ │
│<─────────────────────┤ │
│ │ │
│ call(tool, params) │ │
├─────────────────────>│ │
│ │ tools/call │
│ ├───────────────────────>│
│ │ ← result │
│ ← result │<───────────────────────┤
│<─────────────────────┤ │
Run the test script to verify the MCP connection:
node test-mcp-client.jsThis will:
- Initialize an MCP session
- Ping the server
- Fetch available tools
- Call a test tool (check_login_status)
check_login_status- Check if logged inget_login_qrcode- Get login QR codepublish_content- Publish image/text contentpublish_with_video- Publish video contentlist_feeds- List feeds from homepagesearch_feeds- Search for contentget_feed_detail- Get feed detailspost_comment_to_feed- Post a commentreply_comment_in_feed- Reply to a commentlike_feed- Like/unlike a feedfavorite_feed- Favorite/unfavorite a feeduser_profile- Get user profile
Run /check-login first to scan the QR code and login.
Ensure xiaohongshu-mcp server is running:
# Check if server is running
curl http://127.0.0.1:18060/mcpEnsure all image and video paths are absolute paths (start with /).
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project would not have been possible without the excellent work of xiaohongshu-mcp by xpzouying. Thank you for providing the MCP server that powers this Skill!
Special thanks to the entire open source community for their contributions and support.
This project is licensed under the MIT License - see the LICENSE file for details.
This project is for educational purposes only. Please comply with Xiaohongshu's terms of service and use this tool responsibly.
If you find this project helpful, please consider giving it a star! ⭐
Made with ❤️ for the Claude Code community