Labsco
MilesCool logo

RedNote MCP

β˜… 25

from MilesCool

Search and retrieve content from the Xiaohongshu (Red Book) platform.

πŸ”₯πŸ”₯πŸ”₯βœ“ VerifiedFreeAdvanced setup

RedNote MCP - Xiaohongshu Content Search Tool

Overview

RedNote MCP is a Model Context Protocol (MCP) server for searching and retrieving content from Xiaohongshu (Red Book) platform. It provides intelligent content extraction with automatic login management and parallel processing capabilities.

Features

  • Smart Search: Keyword-based content search on Xiaohongshu
  • Auto Login: Automatic cookie management and login handling
  • Parallel Processing: Efficient concurrent content retrieval
  • Rich Data Extraction:
    • Note titles and content
    • Author information and descriptions
    • Interaction metrics (likes, favorites, comments)
    • Images and hashtags
    • Direct note links

Technical Stack

  • Runtime: Node.js with TypeScript
  • Browser Automation: Playwright
  • Protocol: Model Context Protocol (MCP) SDK
  • Validation: Zod schema validation
  • Package Manager: pnpm

Data Structure

interface RedBookNote {
  title: string;        // Note title
  content: string;      // Note content
  author: string;       // Author name
  authorDesc?: string;  // Author description
  link: string;         // Note URL
  likes?: number;       // Like count
  collects?: number;    // Favorite count
  comments?: number;    // Comment count
  tags?: string[];      // Hashtag list
  images?: string[];    // Image URLs (WebP format)
}

Important Notes

  • First Run: Manual login to Xiaohongshu is required on first use
  • Performance: Initial searches may take 30-60 seconds due to browser startup and content loading
  • Rate Limiting: Concurrent requests are limited to 3 to avoid platform restrictions
  • Image Format: Images are provided in WebP format
  • Cookie Management: Login state is automatically saved and reused

Development

Project Structure

rednote-mcp/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ index.ts          # MCP server entry point
β”‚   └── xiaohongshu.ts    # Core scraping logic
β”œβ”€β”€ cookies/              # Auto-generated cookie storage
β”œβ”€β”€ results/              # Optional: saved search results
β”œβ”€β”€ build/                # Compiled JavaScript output
β”œβ”€β”€ package.json
β”œβ”€β”€ tsconfig.json
└── README.md

Available Scripts

  • pnpm build - Build TypeScript to JavaScript
  • pnpm start - Run the built MCP server
  • pnpm dev - Development mode with auto-reload
  • pnpm test - Run tests (if available)
  • pnpm clean - Clean build directory

Disclaimer

This tool is for educational and research purposes. Please respect Xiaohongshu's terms of service and rate limits when using this tool.