Back to Discover

openclaw-xhs

connector

zhjiang22

๐Ÿ”ฅ ่ฎฉ OpenClaw ่ฏปๆ‡‚ไฝ ็š„ๅฐ็บขไนฆ โ€” MCP ้›†ๆˆ + ็ƒญ็‚น่ทŸ่ธช + ไธชไบบ่ฎฐๅฟ†ๅบ“ๅฏผๅ‡บ

View on GitHub
116 starsNOASSERTIONSynced Aug 2, 2026

Install to Claude Code

/plugin marketplace add zhjiang22/openclaw-xhs

README

XHS AI Toolkit

Make AI understand your Xiaohongshu (RedNote)

็ฎ€ไฝ“ไธญๆ–‡ | English

License Platform Python MCP


AI-powered toolkit for Xiaohongshu (ๅฐ็บขไนฆ / RedNote) that turns your favorite posts into AI memory.

  • MCP Integration โ€” Search, browse, comment via AI assistants
  • Trend Tracking โ€” Auto-generate topic reports with engagement analytics
  • Memory Export โ€” Convert your liked/saved posts into AI-searchable knowledge base

Built on xiaohongshu-mcp and XHS-Downloader.

Features

FeatureDescription
SearchSearch posts by keywords
FeedGet homepage recommendations
Post DetailsFetch post content, comments, engagement stats
CommentPost comments to notes
User ProfileGet user info and their posts
Trend TrackingAuto-generate topic analysis reports
Long Image ExportExport posts as annotated JPG long images
Memory ExportExport liked/saved posts as Markdown for AI memory

Quick Start

1. Install xiaohongshu-mcp

Download from GitHub Releases:

# Linux x64
wget https://github.com/xpzouying/xiaohongshu-mcp/releases/latest/download/xiaohongshu-mcp-linux-amd64.tar.gz
wget https://github.com/xpzouying/xiaohongshu-mcp/releases/latest/download/xiaohongshu-login-linux-amd64.tar.gz

# macOS ARM
wget https://github.com/xpzouying/xiaohongshu-mcp/releases/latest/download/xiaohongshu-mcp-darwin-arm64.tar.gz
wget https://github.com/xpzouying/xiaohongshu-mcp/releases/latest/download/xiaohongshu-login-darwin-arm64.tar.gz

Install:

mkdir -p ~/.local/bin
tar -xzf xiaohongshu-mcp-*.tar.gz -C ~/.local/bin/
tar -xzf xiaohongshu-login-*.tar.gz -C ~/.local/bin/

cd ~/.local/bin
mv xiaohongshu-mcp-* xiaohongshu-mcp
mv xiaohongshu-login-* xiaohongshu-login
chmod +x xiaohongshu-mcp xiaohongshu-login

2. Install This Toolkit

# Clone to OpenClaw workspace
git clone https://github.com/zhjiang22/openclaw-xhs.git
cp -r openclaw-xhs ~/.openclaw/workspace/skills/xiaohongshu

# Or use symlink
ln -s /path/to/openclaw-xhs ~/.openclaw/workspace/skills/xiaohongshu

# Verify installation
cd ~/.openclaw/workspace/skills/xiaohongshu/scripts
./install-check.sh

3. Login (Get Cookies)

Option A: Desktop Environment

./login.sh  # Opens browser, scan QR code with Xiaohongshu app

Option B: Headless Server

Get cookies on your local machine, then copy to server:

# On local machine with GUI
./xiaohongshu-login
# Cookies saved to /tmp/cookies.json

# Copy to server
scp /tmp/cookies.json user@server:~/.xiaohongshu/cookies.json

4. Start Service

./start-mcp.sh              # Headless mode
./start-mcp.sh --headless=false  # Show browser (debug)

Service runs at http://localhost:18060/mcp.

Server Deployment (Headless Linux)

On servers without a desktop environment, the underlying browser requires a virtual display. start-mcp.sh auto-detects the environment โ€” if no display is found, it starts Xvfb automatically. Just install it first:

# Debian/Ubuntu
sudo apt-get install -y xvfb

# CentOS/RHEL
sudo yum install -y xorg-x11-server-Xvfb

No extra configuration needed. The script handles:

  • Detecting the DISPLAY environment variable
  • Auto-starting Xvfb :99 when no display is available
  • Cleaning up Xvfb when stop-mcp.sh is called

Note: Without Xvfb, login and search will fail on headless servers. See Issue #3.

Usage

Basic Commands

./status.sh                    # Check login status
./search.sh "coffee"           # Search posts
./recommend.sh                 # Get recommendations
./post-detail.sh <id> <token>  # Get post details
./comment.sh <id> <token> "Great post!"  # Comment
./user-profile.sh <user_id> <xsec_token>  # Get user profile

Trend Tracking

Auto-search trending posts and generate analysis reports:

./track-topic.sh "AI" --limit 10
./track-topic.sh "travel" --limit 5 --output report.md
./track-topic.sh "iPhone" --limit 5 --feishu  # Export to Feishu

MCP Tools

ToolDescription
check_login_statusCheck login status
search_feedsSearch posts
list_feedsGet homepage feed
get_feed_detailGet post details & comments
post_comment_to_feedPost comment
user_profileGet user profile
like_feedLike/unlike post
favorite_feedSave/unsave post
publish_contentPublish image post
publish_with_videoPublish video post

Long Image Export

Export posts as annotated JPG long images (white background, black text):

# Prepare posts.json
cat > posts.json << 'EOF'
[
  {
    "title": "Post title",
    "author": "Author",
    "stats": "13k likes 100 saves",
    "desc": "Post summary",
    "images": ["https://...webp"],
    "per_image_text": {"1": "Caption for 2nd image"}
  }
]
EOF

./export-long-image.sh --posts-file posts.json -o output.jpg

Requires: Python 3.10+, Pillow (pip install Pillow)

Memory Export (Turn Likes into AI Memory)

Export your liked/saved posts as a searchable knowledge base for AI assistants.

1. Install XHS-Downloader

git clone https://github.com/JoeanAmier/XHS-Downloader.git
cd XHS-Downloader
pip install -r requirements.txt

2. Extract Post Links (Tampermonkey Script)

  1. Install Tampermonkey
  2. Install XHS-Downloader UserScript
  3. Go to Xiaohongshu web โ†’ Profile โ†’ Liked/Saved
  4. Click Tampermonkey menu โ†’ "Extract liked posts" or "Extract saved posts"
  5. Links auto-copied to clipboard
  6. Paste into links.md

3. Download & Export

# Copy helper scripts
cp tools/xhs-downloader/*.py /path/to/XHS-Downloader/

# Download posts
cd /path/to/XHS-Downloader
python batch_download.py links.md

# Export to workspace
python export_to_workspace.py
# Output: ~/.openclaw/workspace/xhs-memory/

4. Configure OpenClaw Memory Search

Edit ~/.openclaw/openclaw.json:

{
  "memorySearch": {
    "extraPaths": [
      "~/.openclaw/workspace/xhs-memory"
    ]
  }
}

Now your AI assistant can search your Xiaohongshu favorites!

Project Structure

openclaw-xhs/
โ”œโ”€โ”€ README.md             # English docs
โ”œโ”€โ”€ README_CN.md          # Chinese docs
โ”œโ”€โ”€ LICENSE
โ”œโ”€โ”€ SKILL.md              # Skill manifest
โ”œโ”€โ”€ scripts/              # MCP wrapper scripts
โ”‚   โ”œโ”€โ”€ install-check.sh
โ”‚   โ”œโ”€โ”€ start-mcp.sh
โ”‚   โ”œโ”€โ”€ stop-mcp.sh
โ”‚   โ”œโ”€โ”€ login.sh
โ”‚   โ”œโ”€โ”€ mcp-call.sh
โ”‚   โ”œโ”€โ”€ status.sh
โ”‚   โ”œโ”€โ”€ search.sh
โ”‚   โ”œโ”€โ”€ recommend.sh
โ”‚   โ”œโ”€โ”€ post-detail.sh
โ”‚   โ”œโ”€โ”€ comment.sh
โ”‚   โ”œโ”€โ”€ user-profile.sh
โ”‚   โ”œโ”€โ”€ track-topic.sh
โ”‚   โ”œโ”€โ”€ track-topic.py
โ”‚   โ”œโ”€โ”€ export-long-image.sh
โ”‚   โ””โ”€โ”€ export-long-image.py
โ””โ”€โ”€ tools/
    โ””โ”€โ”€ xhs-downloader/   # Memory export tools
        โ”œโ”€โ”€ README.md
        โ”œโ”€โ”€ batch_download.py
        โ”œโ”€โ”€ export_memory.py
        โ””โ”€โ”€ export_to_workspace.py

Security

This project implements the following security measures:

  • Cookie protection: Cookie files are copied with 600 permissions (owner-only read/write)
  • Injection prevention: All shell scripts use jq to build JSON payloads instead of string interpolation, preventing shell injection
  • Tool name validation: MCP tool names are restricted to alphanumeric characters and underscores
  • Path validation: Cross-skill script calls validate that target paths are within allowed directories
  • Third-party content: Content fetched from Xiaohongshu is user-generated; exercise appropriate caution

Disclaimer

This project is a wrapper layer for xiaohongshu-mcp.

  • Does NOT contain xiaohongshu-mcp source code
  • Users must download xiaohongshu-mcp binaries separately
  • Scripts communicate via HTTP protocol only

Acknowledgments

License

MIT License (wrapper scripts only)

Note: xiaohongshu-mcp has no declared license. Please respect the author's terms.


If this project helps you, please give it a โญ!

Rendered live from zhjiang22/openclaw-xhs's GitHub README โ€” not stored, always reflects the source repo.

0 Plugins

No plugins listed in this repo's manifest.

0 Comments

Login required
Log in to post a comment or update on this repo.

No comments yet โ€” be the first to share an update.