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.
npx -y @ifuryst/rednote-mcpOverview
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:
Global npm install and initialize (recommended for CLI usage):
# Run initial login flow (opens a browser)
Install and run from source:
# Clone
# Install deps
# Optional: global link for CLI convenience
# Or run the init command directly
Common development commands:
# Build the project
# Start in development mode (watch / local run)
# Run tests
Cursor / MCP client configuration (stdio mode) Add an MCP server entry in your Cursor settings.json:
Alternative using npx:
Configuration keys reference:
| Key | Description |
|---|---|
| command | Executable to run (rednote-mcp or npx) |
| args | Arguments 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:
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
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.
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.
Build a content-aggregation dashboard:
- Periodically query user posts and populate a local analytics dashboard with engagement metrics and media assets.
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 initto 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 initto refresh cookies. - MCP clients must pass
--stdioto 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).