Xiaohongshu (Little Red Book) MCP Server

io.github.shanyang-me由 GitHub 账号 shanyang-me 发布v0.1.1更新于 Oct 24, 2026

Publish, search, and manage Xiaohongshu (Little Red Book) content via MCP tools.

已验证STDIO仅桌面浏览器自动化沟通与协作

概览

AI 生成的概览

本地运行的 MCP 服务器,让 AI 助手通过无头浏览器会话在小红书上发布、搜索和管理内容。

可以做什么
通过二维码登录小红书、检查登录状态、轮询扫码状态并从磁盘重新加载已保存的 Cookie。发布带标题、正文、图片和标签的图文笔记。按关键词搜索笔记并查看笔记完整详情。查询用户主页信息。
适用场景
适合让助手起草并发布小红书笔记、调研某个话题下的内容,或在不手动打开应用的情况下查看账号与笔记详情。
运行要求
以 Python 包形式本地运行(需 Python 3.12+),支持 stdio 或 HTTP 传输;需通过 Playwright 安装 Chromium。需要小红书账号,通过扫码登录,会话 Cookie 保存在本地文件。生成二维码图片需额外可选包。
安装前请注意
发布笔记是在真实社交账号上公开且难以撤回的操作。会话 Cookie 保存在磁盘上,可用于访问账号。该服务器通过无头浏览器调用小红书内部接口以绕过反爬检测,可能与平台条款冲突并带来账号受限风险。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Xiaohongshu (Little Red Book) MCP Server,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

xiaohongshu-mcp-server

A Model Context Protocol (MCP) server for Xiaohongshu (Little Red Book) - China's leading lifestyle social media platform.

Publish image notes, search content, view note details, and manage your account - all through MCP tools that AI assistants can use directly.

How It Works

Uses Playwright to run a headless Chromium browser that:

  1. Loads your XHS session cookies
  2. Generates authentic API signatures via the XHS web app's built-in signing function
  3. Makes API calls through the browser's network context (bypasses anti-bot detection)
  4. Uploads images directly to XHS CDN

No browser automation of UI elements - all interactions go through XHS's internal API.

Tools

ToolDescription
check_login_statusCheck if you're logged in
get_login_qrcodeGenerate QR code for login
check_qrcode_statusPoll QR scan status & save session
reload_cookiesReload cookies from disk
publish_contentPublish an image note with title, text, images, and tags
search_feedsSearch XHS notes by keyword
get_feed_detailGet full details of a note
user_profileGet user profile information

Installation

bash
pip install xiaohongshu-mcp-serverplaywright install chromium

For QR code image generation (optional):

bash
pip install "xiaohongshu-mcp[qrcode]"

Quick Start

1. Start the server

HTTP mode (for Claude Code, Cursor, etc.):

bash
xhs-mcp --transport http --port 18060

stdio mode (for Claude Desktop):

bash
xhs-mcp --transport stdio

2. Login

Call the get_login_qrcode tool, scan the QR code with the Xiaohongshu app, then call check_qrcode_status with the returned qr_id and code. Cookies are saved to ~/.xhs-mcp/cookies.json and persist across restarts.

3. Use

Ask your AI assistant to publish a note, search for content, etc.

Configuration

Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

json
{  "mcpServers": {    "xhs-mcp": {      "command": "xhs-mcp",      "args": ["--transport", "stdio"]    }  }}

Claude Code

bash
claude mcp add xhs-mcp --transport http http://localhost:18060/mcp

Then start the server: xhs-mcp

As a LaunchAgent (macOS auto-start)

Create ~/Library/LaunchAgents/com.xhs-mcp.plist:

xml
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"><plist version="1.0"><dict>    <key>Label</key>    <string>com.xhs-mcp</string>    <key>ProgramArguments</key>    <array>        <string>/path/to/your/venv/bin/xhs-mcp</string>    </array>    <key>RunAtLoad</key>    <true/>    <key>KeepAlive</key>    <true/>    <key>StandardOutPath</key>    <string>/tmp/xhs-mcp.log</string>    <key>StandardErrorPath</key>    <string>/tmp/xhs-mcp.err</string></dict></plist>
bash
launchctl load ~/Library/LaunchAgents/com.xhs-mcp.plist

Example: Publish a Note

python
# Via MCP tool callpublish_content(    title="Hello XHS!",    content="My first post published via MCP.",    images=["/path/to/photo.jpg"],    tags=["MCP", "AI"])

Requirements

  • Python 3.12+
  • Chromium (installed via playwright install chromium)
  • A Xiaohongshu account

License

MIT

来源:README.md,提交 e4fb862

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.1.1最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分