Based on xiaohongshu-mcp wrapper.
For full documentation, see README.md
Quick Reference
| Script | Purpose |
|---|---|
install-check.sh |
Check whether dependencies are installed |
start-mcp.sh |
Start the MCP service |
stop-mcp.sh |
Stop the MCP service |
status.sh |
Check login status |
search.sh <关键词> |
Search content |
recommend.sh |
Get recommendation list |
post-detail.sh <feed_id> <xsec_token> |
Get post details |
comment.sh <feed_id> <xsec_token> <内容> |
Post a comment |
user-profile.sh <user_id> |
Get user profile |
track-topic.sh <话题> [选项] |
Trend tracking report |
export-long-image.sh |
Export post as a long image (white background, black text + image stitching) |
mcp-call.sh <tool> [args] |
General tool invocation |
Quick Start
cd scripts/
# 1. 检查依赖
./install-check.sh
# 2. 启动服务
./start-mcp.sh
# 3. 检查状态
./status.sh
# 4. 搜索内容
./search.sh "春节旅游"
MCP Tools
| Tool Name | Description |
|---|---|
check_login_status |
Check login status |
search_feeds |
Search content |
list_feeds |
Get homepage recommendations |
get_feed_detail |
Get post details and comments |
post_comment_to_feed |
Post a comment |
reply_comment_in_feed |
Reply to a comment |
user_profile |
Get user profile |
like_feed |
Like/Unlike |
favorite_feed |
Favorite/Unfavorite |
publish_content |
Publish an image-text note |
publish_with_video |
Publish a video note |
Trend tracking
./track-topic.sh "DeepSeek" --limit 5
./track-topic.sh "春节旅游" --limit 10 --output report.md
./track-topic.sh "iPhone 16" --limit 5 --feishu
Long image export
Export search results or post details as a JPG long image with text annotations:
# 准备 posts.json(搜索+拉详情后整理)
cat > posts.json << 'EOF'
[
{
"title": "帖子标题",
"author": "作者名",
"stats": "1.3万赞 100收藏",
"desc": "正文摘要,支持\n换行",
"images": ["https://...webp", "https://...webp"],
"per_image_text": {"1": "第2张图的专属说明"}
}
]
EOF
./export-long-image.sh --posts-file posts.json -o output.jpg
Style: white background with black text (mimicking the original Xiaohongshu look), with a text block before each post (title + author + body), and divider lines between posts.
per_image_text Optional: if the original post text explicitly points to a certain image (e.g., "images 7-9 are Qinglong Bridge"), place the description above the corresponding image. If unspecified, all text is concentrated in the text block.
Font: Automatically detect Chinese fonts on the system (STHeiti > Hiragino > Arial Unicode > Noto CJK).
Notes
- The first run will download a headless browser (~150MB)
- Avoid using the same account on multiple clients at the same time
- Publishing limits: title ≤20 characters, body ≤1000 characters, daily posts ≤50
- Linux servers need to obtain cookies from a local machine; see README.md