MCP Servers

模型上下文协议服务器、框架、SDK 和模板的综合目录。

RedNote (小红书/XiaoHongShu) MCP server — browser automation via Playwright

创建于 4/3/2026
更新于 about 5 hours ago
Repository documentation and setup instructions

rednote-mcp (Python)

A Python Model Context Protocol server for RedNote (小红书 / XiaoHongShu) — search, browse, and post notes via browser automation with Playwright. Works with Claude, Cursor, or any MCP-compatible client.

Tools

| Tool | Description | |------|-------------| | login | Authenticate via QR code scan. Use force=True to reset the session. | | set_browser_mode | Toggle headless/headed browser. Use headed if tools return empty results. | | search_notes | Search notes by keyword. Returns title, author, tags, URL, likes, and comments. | | get_note_details | Fetch full note body and top-level comments from a URL or share text. | | get_user_profile | Fetch a user's public profile — followers, following, likes, and recent posts. | | get_community_trending | Fetch trending notes from the explore feed. | | post_note | Post a picture-and-text note to the creator platform. Requires 1–18 images, title ≤ 20 chars, content ≤ 1000 chars. |

Requirements

  • Python ≥ 3.10
  • mcp[cli] ≥ 1.0.0
  • playwright ≥ 1.42.0
  • uv (recommended) or pip

Installation

1. Install the package

# 1. Clone and enter the directory
git clone https://github.com/Mol2017/rednote-mcp.git
cd rednote-mcp-python

# 2. Create a virtual environment and install dependencies
uv venv && source .venv/bin/activate
uv pip install -e .

# 3. Install Playwright browsers
playwright install chromium

2. Add to Claude and verify

# Register the MCP server with Claude
claude mcp add rednote .venv/bin/rednote-mcp

# Verify it is connected
claude mcp list

3. Debug

# Activate the virtual environment
source .venv/bin/activate

# Launch the MCP dev inspector
mcp dev src/rednote_mcp/server.py

First-time login

Ask the agent to log in to RedNote. It opens a real Chrome window with a QR code — scan it with the RedNote app. Cookies are persisted to ~/.mcp/rednote/cookies.json and reused automatically for all future calls.

Anti-bot detection

Mitigations included: persistent browser session, realistic Chrome 131/macOS fingerprint (viewport 1440×900, locale zh-CN, timezone Asia/Shanghai), random delays between actions, and incremental scrolling.

If tools return empty results (bot detection triggered): call set_browser_mode(headless=False), then login(force=True), scan the QR code, and retry.

Project structure

src/rednote_mcp/
├── server.py              # FastMCP server & tool definitions
├── auth/
│   ├── auth_manager.py    # Login flow, persistent session, fingerprint options
│   └── cookie_manager.py  # Cookie persistence (~/.mcp/rednote/cookies.json)
├── tools/
│   ├── rednote_tools.py   # search_notes, get_note_details, post_note
│   ├── note_detail.py     # Low-level page scraping helpers
│   ├── trending.py        # get_community_trending
│   └── user_profile.py    # get_user_profile
└── utils/
    └── logger.py          # Rotating file logger

License

MIT

快速设置
此服务器的安装指南

安装包 (如果需要)

uvx rednote-mcp

Cursor 配置 (mcp.json)

{ "mcpServers": { "mol2017-rednote-mcp": { "command": "uvx", "args": [ "rednote-mcp" ] } } }