RE

RedNote MCP Server for XiaoHongShu Content

Access RedNote XiaoHongShu (xhs) content via the MCP server to search, retrieve, and stream posts, images, and user data securely and efficiently.

Quick Install
npx -y @ifuryst/rednote-mcp

Overview

RedNote MCP Server provides a Model Context Protocol (MCP) implementation that exposes XiaoHongShu (小红书 / XHS) content — posts, images, and user metadata — over a local MCP-compatible server. It wraps authenticated browser access (via Playwright) and presents search, retrieval, and streaming endpoints so other tools (for example, LLM assistants or the Cursor editor) can request XHS data in a protocol-friendly way.

This server is useful when you need to integrate XHS content into developer workflows, AI agents, or content pipelines without embedding scraping logic directly in each consumer. It handles authentication persistence, browser automation setup, and MCP communication (stdio mode), letting clients focus on requests and downstream processing.

Features

  • Persistent authentication using browser cookies (saved to ~/.mcp/rednote/cookies.json)
  • Search XHS notes by keyword
  • Retrieve note contents and images by URL or ID
  • Stream large assets (images/media) through MCP-compatible responses
  • CLI helper for initial login and cookie persistence
  • Integration mode for Cursor and other MCP clients via –stdio
  • Development support: build, dev, tests, and MCP Inspector debugging

Installation / Configuration

Prerequisites:

  • Node.js >= 16, npm >= 7
  • Playwright browser binaries (installed with Playwright installer)

Install Playwright browsers:

npx playwright install

Global npm install and initialize (recommended for CLI usage):

npm install -g rednote-mcp

# Run initial login flow (opens a browser)
rednote-mcp init

Install and run from source:

# Clone
git clone https://github.com/ifuryst/rednote-mcp.git
cd rednote-mcp

# Install deps
npm install

# Optional: global link for CLI convenience
npm install -g .

# Or run the init command directly
npm run dev -- init

Common development commands:

# Build the project
npm run build

# Start in development mode (watch / local run)
npm run dev

# Run tests
npm test

Cursor / MCP client configuration (stdio mode) Add an MCP server entry in your Cursor settings.json:

{
  "mcpServers": {
    "RedNote MCP": {
      "command": "rednote-mcp",
      "args": ["--stdio"]
    }
  }
}

Alternative using npx:

{
  "mcpServers": {
    "RedNote MCP": {
      "command": "npx",
      "args": ["rednote-mcp", "--stdio"]
    }
  }
}

Configuration keys reference:

KeyDescription
commandExecutable to run (rednote-mcp or npx)
argsArguments passed to the process (must include –stdio for MCP)

Cookie storage:

  • After running init, cookies are saved to: ~/.mcp/rednote/cookies.json
  • Treat this file as sensitive — do not share or commit it.

Available Tools / Resources

  • MCP Inspector — use to debug MCP traffic and requests:
npx @modelcontextprotocol/inspector npx rednote-mcp --stdio

What this does:

  • Launches the MCP Inspector UI
  • Runs the RedNote MCP server under the inspector
  • Lets you view requests/responses, validate protocol behavior, and iterate on handlers

Repository and issues:

  • Source and issue tracker: https://github.com/ifuryst/rednote-mcp

Use Cases

  1. Search and summarize notes for an assistant:

    • Client sends an MCP request to search a keyword, retrieves top notes, and generates a short summary for an LLM context.
  2. Fetch post content and images for moderation or analysis:

    • Use URL-based retrieval to download post text and stream associated images for automated tagging or vision models.
  3. Build a content-aggregation dashboard:

    • Periodically query user posts and populate a local analytics dashboard with engagement metrics and media assets.
  4. Integrate into Cursor or other editors:

    • Configure the MCP entry (see above) and run queries from within Cursor to insert XHS content into writing workflows.

Example: search command (CLI-style)

  • After initialization, your application can request the MCP server to search “旅行 胶片” and receive structured note entries (title, id, url, excerpt).

Security & Operational Notes

  • First-time use requires rednote-mcp init to log in interactively — the tool opens a browser for manual authentication.
  • Cookies contain authentication tokens. Keep ~/.mcp/rednote/cookies.json secure and rotate or re-authenticate if a session expires.
  • Ensure Playwright-installed browsers are present (npx playwright install). Missing browser binaries will prevent automated login and scraping.
  • Respect XiaoHongShu terms of service and rate limits when programmatically accessing content.

Troubleshooting

  • “Browser not found” — run npx playwright install.
  • “Authentication failed / 401” — re-run rednote-mcp init to refresh cookies.
  • MCP clients must pass --stdio to enable protocol communication; confirm your Cursor or client settings.

Contributing & License

Contributions are welcome via GitHub pull requests. Follow the standard fork → branch → PR workflow. The project is MIT licensed (see LICENSE in the repository).