browser-automationdeveloper-tools

XiaoHongShu (Little Red Book)

algovate

by algovate

Integrate with XiaoHongShu (Little Red Book) for seamless authentication, content discovery, publishing, and social inte

Integrates with XiaoHongShu (Little Red Book) through browser automation to enable authentication, content discovery, social interaction, and publishing with support for images and videos.

github stars

42

0 commentsdiscussion

Both formats append explainx.ai attribution and the canonical URL for this MCP server listing.

No API key neededSupports mixed local and URL media uploadsHeadless browser automation with Puppeteer

best for

  • / Social media managers automating XiaoHongShu posting
  • / Content creators batch publishing to Little Red Book
  • / Developers building XiaoHongShu integrations
  • / Marketing teams managing Chinese social media presence

capabilities

  • / Publish image and video posts with automatic media download
  • / Search and discover content from XiaoHongShu feeds
  • / Manage user authentication and session handling
  • / Comment on posts and interact with content
  • / View and delete user's published notes
  • / Download images from URLs automatically

what it does

Automates interactions with XiaoHongShu (Little Red Book) social platform through browser automation, enabling content publishing, discovery, and user management without API keys.

about

XiaoHongShu (Little Red Book) is a community-built MCP server published by algovate that provides AI assistants with tools and capabilities via the Model Context Protocol. Integrate with XiaoHongShu (Little Red Book) for seamless authentication, content discovery, publishing, and social inte It is categorized under browser automation, developer tools.

how to install

You can install XiaoHongShu (Little Red Book) in your AI client of choice. Use the install panel on this page to get one-click setup for Cursor, Claude Desktop, VS Code, and other MCP-compatible clients. This server runs locally on your machine via the stdio transport.

license

MIT

XiaoHongShu (Little Red Book) is released under the MIT license. This is a permissive open-source license, meaning you can freely use, modify, and distribute the software.

readme

xhs-mcp

简体中文 | English

xhs-mcp 提供统一的命令行入口 xhs-mcp,并内置 MCP 服务器子命令。用于小红书(xiaohongshu.com)的 Model Context Protocol(MCP)服务器与 CLI 工具,支持登录、发布、搜索、推荐等自动化能力(基于 Puppeteer)。

npm version npm downloads License: MIT

📦 NPM 信息

  • 包名: xhs-mcp
  • 运行 CLI(推荐): npx xhs-mcp <subcommand>
  • 启动 MCP:npx xhs-mcp mcp [--mode stdio|http] [--port 3000]

✨ 功能

  • 认证:登录、登出、状态检查
  • 发布:图文和视频发布
    • 图文发布:标题≤20字符(40显示单位)、内容≤1000、最多18图
    • 视频发布:支持 MP4、MOV、AVI、MKV、WebM、FLV、WMV 格式
    • 新功能: 支持图片 URL 自动下载(HTTP/HTTPS)
    • 新功能: 标题宽度精确验证(CJK字符2单位,ASCII字符1单位)
    • 支持本地图片路径
    • 支持 URL 和本地路径混合使用
    • 智能缓存机制,避免重复下载
  • 发现:推荐、搜索、详情、评论
  • 用户笔记:列表查看、删除管理
  • 自动化:Puppeteer 驱动、无头模式、Cookie 管理
  • 验证:发布功能验证脚本,支持 HTML 报告生成

📋 可用工具

  • xhs_auth_loginxhs_auth_logoutxhs_auth_status
  • xhs_discover_feedsxhs_search_notexhs_get_note_detail
  • xhs_comment_on_note
  • xhs_get_user_notesxhs_delete_note(用户笔记管理)
  • xhs_publish_content(统一发布接口:typetitlecontentmedia_pathstags
    • 图片发布:1-18个图片文件或URL
    • 视频发布:恰好1个视频文件
    • 混合使用:支持图片URL和本地路径混合

🚀 快速开始(MCP)

Stdio 模式(默认)

npx xhs-mcp mcp

# 调试日志
XHS_ENABLE_LOGGING=true npx xhs-mcp mcp

首次运行提示:如果未安装 Puppeteer 浏览器,先执行

npx xhs-mcp browser    # 自动检查并安装 Chromium,显示可执行路径
# 或
npx puppeteer browsers install chrome

输出示例:

{
  "success": true,
  "message": "Chromium is ready",
  "data": {
    "installed": true,
    "executablePath": "/path/to/chromium"
  }
}

验证 MCP 连接:

echo '{"jsonrpc": "2.0", "id": 1, "method": "tools/list"}' | npx xhs-mcp mcp

HTTP 模式

# 启动 HTTP 服务器(默认端口 3000)
npx xhs-mcp mcp --mode http

# 指定端口
npx xhs-mcp mcp --mode http --port 8080

# 调试模式
XHS_ENABLE_LOGGING=true npx xhs-mcp mcp --mode http

HTTP 服务器支持:

  • Streamable HTTP (协议版本 2025-03-26) - 端点:/mcp
  • SSE (协议版本 2024-11-05) - 端点:/sse/messages
  • 健康检查 - 端点:/health

详细文档请参考:HTTP Transports

🧰 CLI 子命令

# 认证
npx xhs-mcp login --timeout 120
npx xhs-mcp logout
npx xhs-mcp status

# 浏览器依赖
npx xhs-mcp browser [--with-deps]  # 检查并安装 Chromium,显示可执行路径

# 发现与检索
npx xhs-mcp feeds [-b /path/to/chromium]
npx xhs-mcp search -k 关键字 [-b /path/to/chromium]

# 当前用户笔记
npx xhs-mcp usernote list [-l 20] [--cursor <cursor>] [-b /path/to/chromium]

# 删除用户笔记
npx xhs-mcp usernote delete --note-id <id> [-b /path/to/chromium]
npx xhs-mcp usernote delete --last-published [-b /path/to/chromium]

# 互动
npx xhs-mcp comment --feed-id <id> --xsec-token <token> -n "Nice!" [-b /path/to/chromium]

# 发布
# 使用本地图片
npx xhs-mcp publish --type image --title 标题 --content 内容 -m path1.jpg,path2.png --tags a,b [-b /path/to/chromium]

# ⭐ 使用图片 URL(自动下载)
npx xhs-mcp publish --type image --title 标题 --content 内容 -m "https://example.com/img1.jpg,https://example.com/img2.png" --tags a,b

# 混合使用 URL 和本地路径
npx xhs-mcp publish --type image --title 标题 --content 内容 -m "https://example.com/img1.jpg,./local/img2.jpg" --tags a,b

# 发布视频
npx xhs-mcp publish --type video --title 视频标题 --content 视频描述 -m path/to/video.mp4 --tags a,b [-b /path/to/chromium]

# 查看可用工具
npx xhs-mcp tools [--detailed] [--json]

# 启动 MCP
npx xhs-mcp mcp [--mode stdio|http] [--port 3000]

🔧 客户端接入(Cursor)

Stdio 模式

.cursor/mcp.json

{
  "mcpServers": {
    "xhs-mcp": {
      "command": "npx",
      "args": ["xhs-mcp", "mcp"],
      "env": { "XHS_ENABLE_LOGGING": "true" }
    }
  }
}

HTTP 模式

.cursor/mcp.json

{
  "mcpServers": {
    "xhs-mcp-http": {
      "command": "npx",
      "args": ["xhs-mcp", "mcp", "--mode", "http", "--port", "3000"],
      "env": { "XHS_ENABLE_LOGGING": "true" }
    }
  }
}

或者使用 HTTP 客户端直接连接:

{
  "mcpServers": {
    "xhs-mcp-http": {
      "url": "http://localhost:3000/mcp"
    }
  }
}

⚠️ 注意事项

  • 图文发布:标题≤20、内容≤1000、图片≤18
  • 视频发布:支持多种格式,文件大小建议≤500MB
  • 避免同账号多端同时网页登录
  • 合理控制发帖频率
  • 图片 URL 自动下载到 ./temp_images/ 目录(自动缓存)
  • 图片 URL 支持格式:JPEG、PNG、GIF、WebP、BMP

📖 文档和示例

📚 文档

🎨 示例

🧪 测试

  • 运行测试 - 测试说明和用法
  • 运行所有测试:npm test
  • 验证脚本: npm run validate - 发布功能验证测试,生成 HTML 报告

🛠️ 构建说明

  • 统一使用单一生产构建配置:config/webpack.config.js
  • 已移除开发与优化变体;开发请直接运行:
    • npm run dev(直接运行 TypeScript CLI)
    • npm run build(打包到 dist/xhs-mcp.cjs

🙏 致谢

基于 xiaohongshu-mcp 重构与扩展(TypeScript、Puppeteer、MCP 优化、日志清理、NPM 发布)。

FAQ

What is the XiaoHongShu (Little Red Book) MCP server?
XiaoHongShu (Little Red Book) is a Model Context Protocol (MCP) server profile on explainx.ai. MCP lets AI hosts (e.g. Claude Desktop, Cursor) call tools and resources through a standard interface; this page summarizes categories, install hints, and community ratings.
How do MCP servers relate to agent skills?
Skills are reusable instruction packages (often SKILL.md); MCP servers expose live capabilities. Teams frequently combine both—skills for workflows, MCP for APIs and data. See explainx.ai/skills and explainx.ai/mcp-servers for parallel directories.
How are reviews shown for XiaoHongShu (Little Red Book)?
This profile displays 33 aggregated ratings (sample rows for discoverability plus signed-in user reviews). Average score is about 4.5 out of 5—verify behavior in your own environment before production use.

Use Cases

Web Research & Information Gathering

Fetch and extract information from websites automatically

Example

Research competitor pricing, scrape product reviews, monitor news mentions

Automate 5-10 hours/week of manual web research

Content Monitoring & Alerts

Track website changes, new content, price updates

Example

Monitor competitor blog for new posts, track stock availability, watch for pricing changes

Stay informed without manual checking, never miss important updates

Data Extraction & Aggregation

Extract structured data from multiple websites

Example

Compile product listings from 10 e-commerce sites, aggregate job postings, collect real estate data

Build datasets 100x faster than manual copying

API-less Integration

Interact with services that don't offer APIs

Example

Check form submissions, validate website functionality, test user flows

Automate interactions with any website, even without API

Implementation Guide

Prerequisites

  • Claude Desktop or Cursor with MCP support
  • Understanding of web scraping ethics and robots.txt
  • Rate limiting awareness to avoid overwhelming target sites
  • Knowledge of legal restrictions on data collection

Time Estimate

20-40 minutes including configuration and testing

Installation Steps

  1. 1.Install web automation MCP server via npm or pip
  2. 2.Configure allowed domains and rate limits in MCP config
  3. 3.Test with simple fetch: 'Get content from example.com'
  4. 4.Progress to extraction: 'Extract all product prices from this page'
  5. 5.Set up monitoring: 'Check this URL daily for changes'
  6. 6.Parse structured data: 'Create CSV from this table'
  7. 7.Respect robots.txt and rate limits always

Troubleshooting

  • 403 Forbidden: Website blocks bots—respect their wishes, use official API instead
  • Rate limit errors: Slow down requests, add delays between fetches
  • Stale data: Target site changed HTML structure—update selectors
  • Timeout errors: Site is slow or blocking—increase timeout, try different user agent
  • JavaScript-rendered content: Use headless browser MCP servers for dynamic sites

Best Practices

✓ Do

  • +Check robots.txt and respect crawl rules
  • +Rate limit requests: 1-2 requests/second maximum
  • +Use official APIs when available instead of scraping
  • +Identify your bot with descriptive user agent
  • +Cache results to minimize repeated requests
  • +Handle errors gracefully with retries and fallbacks
  • +Validate extracted data for accuracy

✗ Don't

  • Don't scrape sites that explicitly forbid it (robots.txt, ToS)
  • Don't overwhelm servers with rapid requests—use rate limiting
  • Don't scrape personal data without consent and legal basis
  • Don't ignore copyright on extracted content
  • Don't assume HTML structure is stable—handle changes
  • Don't use scraped data for commercial purposes without permission

💡 Pro Tips

  • Use CSS selectors or XPath for robust data extraction
  • Set up monitoring alerts for extraction failures (structure changed)
  • Implement exponential backoff for retries on failures
  • Store raw HTML for reprocessing if extraction logic changes
  • Combine with data analysis tools for insights from extracted data
  • Consider using official APIs or RSS feeds as more stable alternatives

Technical Details

Architecture

MCP server handles HTTP requests, HTML parsing, JavaScript rendering (if headless browser), and returns structured data to Claude.

Protocols

  • HTTP/HTTPS
  • WebSocket (for real-time sites)
  • Puppeteer/Playwright (for JavaScript sites)

Compatibility

  • Static HTML sites
  • JavaScript-rendered SPAs (with headless browser)
  • REST APIs
  • GraphQL endpoints

When to Use This

✓ Use When

Use for research automation, content monitoring, data aggregation from multiple sources, and when official APIs don't exist. Best for read-only information gathering.

✗ Avoid When

Avoid for sites with APIs (use API instead), sites that explicitly forbid scraping, when data is copyrighted, or for login-required content without proper authorization.

Integration

  • Scheduled monitoring with change detection
  • Multi-source data aggregation pipelines
  • Fallback to web scraping when API rate limits hit
  • Headless browser for JavaScript-heavy sites

Discussion

Product Hunt–style comments (not star reviews)
  • No comments yet — start the thread.

List & Promote Your MCP Server

Share your MCP server with the developer community

GET_STARTED →
MCP server reviews

Ratings

4.533 reviews
  • Pratham Ware· Dec 24, 2024

    We evaluated XiaoHongShu (Little Red Book) against two servers with overlapping tools; this profile had the clearer scope statement.

  • Evelyn Iyer· Dec 4, 2024

    We wired XiaoHongShu (Little Red Book) into a staging workspace; the listing’s GitHub and npm pointers saved time versus hunting across READMEs.

  • Ren Abbas· Nov 23, 2024

    XiaoHongShu (Little Red Book) reduced integration guesswork — categories and install configs on the listing matched the upstream repo.

  • Yash Thakker· Nov 15, 2024

    XiaoHongShu (Little Red Book) has been reliable for tool-calling workflows; the MCP profile page is a good permalink for internal docs.

  • Ren Rao· Oct 14, 2024

    Useful MCP listing: XiaoHongShu (Little Red Book) is the kind of server we cite when onboarding engineers to host + tool permissions.

  • Dhruvi Jain· Oct 6, 2024

    According to our notes, XiaoHongShu (Little Red Book) benefits from clear Model Context Protocol framing — fewer ambiguous “AI plugin” claims.

  • Oshnikdeep· Sep 25, 2024

    We wired XiaoHongShu (Little Red Book) into a staging workspace; the listing’s GitHub and npm pointers saved time versus hunting across READMEs.

  • Meera Park· Sep 9, 2024

    XiaoHongShu (Little Red Book) is among the better-indexed MCP projects we tried; the explainx.ai summary tracks the official description.

  • Ren Thomas· Sep 5, 2024

    Strong directory entry: XiaoHongShu (Little Red Book) surfaces stars and publisher context so we could sanity-check maintenance before adopting.

  • Meera Khanna· Aug 28, 2024

    We evaluated XiaoHongShu (Little Red Book) against two servers with overlapping tools; this profile had the clearer scope statement.

showing 1-10 of 33

1 / 4