Xiaohongshu (Little Red Book) MCP Server

السجل الرسمي البحث والويب

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

التثبيت

أضف هذا إلى إعدادات MCP في عميلك (Claude Desktop: claude_desktop_config.json، وCursor: ‏.cursor/mcp.json، ويستخدم VS Code وغيره الصيغة نفسها «mcpServers»).

PYPI package xiaohongshu-mcp-server
Claude Code
claude mcp add xiaohongshu-little-red-book-mcp-server -- uvx xiaohongshu-mcp-server==0.1.1
إعداد JSON (Claude Desktop وCursor وVS Code)
{
    "mcpServers": {
        "xiaohongshu-little-red-book-mcp-server": {
            "command": "uvx",
            "args": [
                "xiaohongshu-mcp-server==0.1.1"
            ]
        }
    }
}

التوثيق

مأخوذ من ملف README للمشروع على GitHub ويُحدَّث أسبوعيًا. تفتح الروابط على GitHub.

المحتويات
  1. xiaohongshu-mcp-server
  2. How It Works
  3. Tools
  4. Installation
  5. Quick Start
  6. Configuration
  7. Example: Publish a Note
  8. Requirements
  9. License

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

pip install xiaohongshu-mcp-server
playwright install chromium

For QR code image generation (optional):

pip install "xiaohongshu-mcp[qrcode]"

Quick Start

1. Start the server

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

xhs-mcp --transport http --port 18060

stdio mode (for Claude Desktop):

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:

{
  "mcpServers": {
    "xhs-mcp": {
      "command": "xhs-mcp",
      "args": ["--transport", "stdio"]
    }
  }
}
Claude Code
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 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>
launchctl load ~/Library/LaunchAgents/com.xhs-mcp.plist

Example: Publish a Note

# Via MCP tool call
publish_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

الأسئلة الشائعة

ما هو Xiaohongshu (Little Red Book) MCP Server؟

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

كيف أثبّت Xiaohongshu (Little Red Book) MCP Server؟

يعمل على جهازك. في Claude Code: claude mcp add xiaohongshu-little-red-book-mcp-server -- uvx xiaohongshu-mcp-server==0.1.1. وفي العملاء الآخرين، الصق إعداد JSON من هذه الصفحة في إعدادات MCP الخاصة بهم.

هل يحتاج Xiaohongshu (Little Red Book) MCP Server إلى مفتاح API؟

لا يذكر إدراجه في السجل أي مفتاح أو سر إلزامي. قد تتطلب بعض الميزات حسابًا لدى الخدمة التي يتصل بها.

هل Xiaohongshu (Little Red Book) MCP Server مفتوح المصدر؟

نعم. شيفرته متاحة على GitHub بترخيص MIT.

من يصون Xiaohongshu (Little Red Book) MCP Server؟

ينشره shanyang-me. يدرجه AI.tn لكنه لا يصونه ولا يوصي به.

من سجل MCP الرسمي. الإدراج ليس توصية: راجع شيفرة الخادم وصلاحياته قبل منحه الوصول إلى بياناتك.