xiaohongshu-mcp
Xiaohongshu MCP Skill (with Python Client)
Automate content operations on Xiaohongshu (小红书) using a bundled Python script that interacts with the xpzouying/xiaohongshu-mcp server (8.4k+ stars).
Project: xpzouying/xiaohongshu-mcp
1. Local Server Setup
This skill requires the xiaohongshu-mcp server to be running on your local machine.
Step 1: Download Binaries
Download the appropriate binaries for your system from the GitHub Releases page.
| Platform | MCP Server | Login Tool |
|---|---|---|
| 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 |
Grant execute permission to the downloaded files:
chmod +x xiaohongshu-mcp-darwin-arm64 xiaohongshu-login-darwin-arm64
Step 2: Login (First Time Only)
Run the login tool. It will open a browser window with a QR code. Scan it with your Xiaohongshu mobile app.
./xiaohongshu-login-darwin-arm64
Important: Do not log into the same Xiaohongshu account on any other web browser, as this will invalidate the server's session.
Step 3: Start the MCP Server
Run the MCP server in a separate terminal window. It will run in the background.
# Run in headless mode (recommended)
./xiaohongshu-mcp-darwin-arm64
# Or, run with a visible browser for debugging
./xiaohongshu-mcp-darwin-arm64 -headless=false
The server will be available at http://localhost:18060.
2. Using the Skill
This skill includes a Python client (scripts/xhs_client.py) to interact with the local server. You can use it directly from the shell.
Available Commands
| Command | Description | Example |
|---|---|---|
status |
Check login status | python scripts/xhs_client.py status |
search <keyword> |
Search for notes | python scripts/xhs_client.py search "咖啡" |
detail <id> <token> |
Get note details | python scripts/xhs_client.py detail "note_id" "xsec_token" |
feeds |
Get recommended feed | python scripts/xhs_client.py feeds |
publish <title> <content> <images> |
Publish a note | python scripts/xhs_client.py publish "Title" "Content" "url1,url2" |
Example Workflow: Market Research
-
Check Status: First, ensure the server is running and you are logged in.
python ~/clawd/skills/xiaohongshu-mcp/scripts/xhs_client.py status -
Search for a Keyword: Find notes related to your research topic. The output will include the
feed_idandxsec_tokenneeded for the next step.python ~/clawd/skills/xiaohongshu-mcp/scripts/xhs_client.py search "户外电源" -
Get Note Details: Use the
feed_idandxsec_tokenfrom the search results to get the full content and comments of a specific note.python ~/clawd/skills/xiaohongshu-mcp/scripts/xhs_client.py detail "64f1a2b3c4d5e6f7a8b9c0d1" "security_token_here" -
Analyze: Review the note's content, comments, and engagement data to gather insights.
More from hwj123hwj/sanwan-skills
feishu-doc
Fetch content from Feishu (Lark) Wiki, Docs, Sheets, and Bitable. Automatically resolves Wiki URLs to real entities and converts content to Markdown.
4email-manager
邮件管理技能。监控飞书邮件、IMAP邮箱检查、发送邮件。触发词:邮件、email、mail、收件箱、未读邮件、发邮件、邮件监控。
1douyin-analytics
抖音创作者视频数据抓取与分析。触发词:抖音数据、douyin、抓取抖音、抖音分析、抖音博主数据、抖音视频列表、抖音主页数据。当用户提供抖音用户主页 URL 或想获取某抖音博主视频数据时自动激活。
1ai-news-zh
中文AI科技日报自动采集与推送。从The Verge、Wired、TechCrunch等英文源抓取最新AI资讯,自动翻译整理为中文,按分类推送到飞书/Telegram/Discord等渠道。适合关注AI行业动态的中文用户。
1xiaohongshu
XiaoHongShu (Little Red Book) data collection and interaction toolkit. Use when working with XiaoHongShu (小红书) platform for: (1) Searching and scraping notes/posts, (2) Getting user profiles and details, (3) Extracting comments and likes, (4) Following users and liking posts, (5) Fetching home feed and trending content. Automatically handles all encryption parameters (cookies, headers) including a1, webId, x-s, x-s-common, x-t, sec_poison_id, websectiga, gid, x-b3-traceid, x-xray-traceid. Supports guest mode and authenticated sessions via web_session cookie.
1