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 助理透過無頭瀏覽器工作階段在小紅書上發布、搜尋與管理內容。

可以做什麼
以 QR 碼登入小紅書、檢查登入狀態、輪詢掃碼狀態,並從磁碟重新載入已儲存的 Cookie。發布含標題、內文、圖片與標籤的圖文筆記。依關鍵字搜尋筆記並取得筆記完整詳情。查詢使用者個人檔案資訊。
適用情境
適合讓助理草擬並發布小紅書筆記、研究某個主題下的內容,或在不手動開啟應用程式的情況下查看帳號與筆記詳情。
執行需求
以 Python 套件形式在本機執行(需 Python 3.12+),支援 stdio 或 HTTP 傳輸;需透過 Playwright 安裝 Chromium。需要小紅書帳號,以掃描 QR 碼登入,工作階段 Cookie 會存成本機檔案。產生 QR 碼圖片需額外選用套件。
安裝前請注意
發布筆記是在真實社群帳號上公開且難以復原的操作。工作階段 Cookie 存放在磁碟上,可據以存取帳號。此伺服器透過無頭瀏覽器呼叫小紅書內部 API 以繞過反機器人偵測,可能與平台條款衝突,並有帳號受限的風險。

安裝

在 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 分