Get the FREE Ultimate OpenClaw Setup Guide →
B

Xiaohongshu (小红书) Automation

Scanned

@Borye

npx machina-cli add skill @Borye/xiaohongshu-mcp --openclaw
Files (1)
SKILL.md
3.8 KB

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.

PlatformMCP ServerLogin Tool
macOS (Apple Silicon)xiaohongshu-mcp-darwin-arm64xiaohongshu-login-darwin-arm64
macOS (Intel)xiaohongshu-mcp-darwin-amd64xiaohongshu-login-darwin-amd64
Windowsxiaohongshu-mcp-windows-amd64.exexiaohongshu-login-windows-amd64.exe
Linuxxiaohongshu-mcp-linux-amd64xiaohongshu-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

CommandDescriptionExample
statusCheck login statuspython scripts/xhs_client.py status
search <keyword>Search for notespython scripts/xhs_client.py search "咖啡"
detail <id> <token>Get note detailspython scripts/xhs_client.py detail "note_id" "xsec_token"
feedsGet recommended feedpython scripts/xhs_client.py feeds
publish <title> <content> <images>Publish a notepython scripts/xhs_client.py publish "Title" "Content" "url1,url2"

Example Workflow: Market Research

  1. Check Status: First, ensure the server is running and you are logged in.

    python ~/clawd/skills/xiaohongshu-mcp/scripts/xhs_client.py status
    
  2. Search for a Keyword: Find notes related to your research topic. The output will include the feed_id and xsec_token needed for the next step.

    python ~/clawd/skills/xiaohongshu-mcp/scripts/xhs_client.py search "户外电源"
    
  3. Get Note Details: Use the feed_id and xsec_token from 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"
    
  4. Analyze: Review the note's content, comments, and engagement data to gather insights.

Source

git clone https://clawhub.ai/Borye/xiaohongshu-mcpView on GitHub

Overview

Automate Xiaohongshu (小红书) content operations with a bundled Python client that talks to the local xiaohongshu-mcp server. It enables publishing image/text/video notes, searching for notes and trends, and analyzing post details and comments. It also helps manage user profiles and content feeds for streamlined social media workflows.

How This Skill Works

Run the xiaohongshu-mcp server locally and authenticate via a QR-based login. Use the bundled Python client (scripts/xhs_client.py) to issue commands such as status, search, detail, feeds, and publish. The client interacts with the local server to publish notes, fetch notes and trend data, and retrieve detailed post content and comments, returning structured results.

When to Use It

  • Market research: discover trending notes and topics on Xiaohongshu.
  • Publish new image/text/video notes to RedNote from a local workflow.
  • Analyze post details, comments, and engagement to extract insights.
  • Manage brand profiles and content feeds for campaigns or multiple accounts.
  • Ongoing social media management and trend monitoring across Xiaohongshu accounts.

Quick Start

  1. Step 1: Download MCP binaries for your OS, make them executable, and launch the server.
  2. Step 2: Run the login tool to scan the QR code with the Xiaohongshu app, then start the MCP server in headless mode.
  3. Step 3: Use the Python client (python scripts/xhs_client.py) to run status, search '<keyword>', and publish '<title>' '<content>' '<images>'.

Best Practices

  • Run and test the MCP server locally and keep a single login session per browser to avoid invalidating sessions.
  • Use the provided client commands (status, search, detail, feeds, publish) in sequence and capture feed_id and xsec_token when needed.
  • Validate publish inputs (title, content, image URLs) and ensure media is accessible by the server before publishing.
  • Inspect results and persist important identifiers (feed_id, tokens) for repeatable workflows and auditing.
  • Keep the server binaries up to date with official releases and monitor logs for failures or rate-limit hints.

Example Use Cases

  • Market research: run search for a keyword like '户外电源', then fetch details for selected notes to extract topics and engagement metrics.
  • Publish a new note: use publish with a title, content, and image URLs to post a multimedia update to Xiaohongshu.
  • Engagement analysis: retrieve detail for a note and review comments and like counts to assess sentiment.
  • Campaign management: manage a brand's Xiaohongshu profile, curate feeds, and schedule posts via publish and feeds.
  • Trend digest: regularly fetch feeds, summarize trends, and export insights for a weekly report.

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers