Xiaohongshu Search & Comment

This tool acts as a friendly digital assistant for Xiaohongshu, one of the world's most popular social media and e-commerce platforms. In simple terms, it allows an AI assistant to browse the platform just like a human would—searching for specific topics, reading through posts, and keeping up with the latest trends. Instead of a user having to manually click through dozens of pages, this tool gathers all the information and presents it in a clear, easy-to-read format. On a more technical level, the tool is built using Playwright for robust browser automation and Python for seamless integration. It handles complex tasks like manual QR code login with session persistence, meaning it stays logged in for future sessions without constant re-authentication. It offers deep data extraction capabilities, pulling not just the text of a note, but also metadata like author details, timestamps, and full comment sections. This allows for a comprehensive analysis of the platform's content and community sentiment. For developers and AI enthusiasts, this MCP server is a powerful bridge between Large Language Models and real-world social data. It enables an AI to perform "Smart Commenting," where the model analyzes a post's context and chooses from different interaction styles—such as professional, inquisitive, or engagement-focused—to post natural-sounding responses. Because the latest version modularizes note analysis and comment generation, developers can leverage an AI's reasoning to create sophisticated, automated community management workflows that feel personal and context-aware rather than robotic.

Category: Browser & Web Automation

Tags: automation, playwright, social-media, web scraping, xiaohongshu

Visit Xiaohongshu Search & Comment

How to install and configure Xiaohongshu Search & Comment

1. Installation This MCP server is based on Python and Playwright. Follow these steps to install: 1. Python Environment: Ensure Python 3.8 or higher is installed. 2. Project Acquisition: Clone or download the RedBook-Search-Comment-MCP repository to your local machine. 3. Create Virtual Environment: bash # Create virtual environment python3 -m venv venv # Activate virtual environment # Windows venv\Scripts\activate # macOS/Linux source venv/bin/activate 4. Install Dependencies: bash pip install -r requirements.txt pip install fastmcp 5. Install Browser: bash playwright install ---

2. Configuration Add the following configuration to your MCP Client settings file (e.g., claude_desktop_config.json). You must use absolute paths for the Python executable and the script file. json { "mcpServers": { "xiaohongshu MCP": { "command": "/ABSOLUTE_PATH/TO/venv/bin/python3", "args": [ "/ABSOLUTE_PATH/TO/xiaohongshu_mcp.py", "--stdio" ] } } } ---

3. Available Tools The server provides the following functions: * mcp0_login(): Opens a browser window for manual QR code login to Xiaohongshu. Saves login state for future sessions. * mcp0_search_notes(keywords, limit): Searches for notes using keywords. * keywords (string): Search terms. * limit (number): Number of results to return (default: 5). * mcp0_get_note_content(url): Retrieves detailed content including title, author, time, and text. * url (string): The Xiaohongshu note URL. * mcp0_get_note_comments(url): Retrieves the comment section for a specific note. * url (string): The Xiaohongshu note URL. * mcp0_post_smart_comment(url, comment_type): Posts an AI-generated comment to a note. * url (string): The Xiaohongshu note URL. * comment_type (string): Options include "引流" (Traffic/Lead gen), "点赞" (Simple like/interact), "咨询" (Inquiry/Question), or "专业" (Professional/Authoritative). ---

4. Example Prompts You can use the following prompts in your MCP-enabled client: * Login: "帮我登录小红书账号" (Help me log in to my Xiaohongshu account) * Search: "帮我搜索小红书笔记,关键词为:美食" (Help me search Xiaohongshu notes for the keyword: Gourmet food) * Get Content: "请查看这个小红书笔记的内容:https://www.xiaohongshu.com/..." (Please check the content of this Xiaohongshu note: [URL]) * Comment: "请在这个小红书笔记下发布一条引流评论:[URL]" (Please post a traffic-leading comment under this Xiaohongshu note: [URL])

What you can do with Xiaohongshu Search & Comment

Use Case 1: Competitor Sentiment and Market Research Problem: Marketing teams often spend hours manually scrolling through Xiaohongshu to understand how users feel about a competitor's product or to identify common pain points in a specific niche. Solution: This MCP allows a user to automate the gathering of market intelligence. By searching for competitor brand names and extracting both the note content and user comments, an AI (like Claude) can analyze thousands of words of feedback in seconds to identify trends, complaints, or unmet needs. Example: A skincare brand manager asks Claude to: "Search for 'Brand X Moisturizer,' retrieve the content and comments of the top 10 notes, and summarize the top 3 reasons why users are dissatisfied with it."

Use Case 2: Automated Authority Building for Personal Brands Problem: To grow an account on Xiaohongshu, users need to interact with trending posts in their niche. Manually writing high-quality, professional comments on dozens of posts every day is exhausting. Solution: Using the mcp0_post_smart_comment tool with the "Professional" or "Inquiry" types, a creator can automate high-value engagement. The MCP reads the note content and uses the LLM to generate a relevant, insightful comment that establishes the creator as an expert in that field. Example: A fitness coach sets a workflow: "Search for 'weight loss tips' every morning, find the top 5 notes from the last 24 hours, and post a 'Professional' type comment sharing one additional scientific tip related to the note's content."

Use Case 3: Targeted Lead Generation and Customer Support Problem: Businesses often miss opportunities to help potential customers who are asking questions in the comment sections of viral posts (e.g., "Where can I buy this?" or "Does this work for beginners?"). Solution: This MCP can be used to scan comment sections of popular notes for specific "buying intent" keywords. Once a potential lead is identified, the user can use the "Lead Generation" (引流) comment type to provide an answer and direct the user to their own profile or services. Example: A travel agency uses the MCP to search for "Tokyo travel guide," retrieves comments for the top-ranking notes, and identifies users asking about private tours. The agency then posts a "Lead Gen" comment: "I just posted a detailed 7-day private itinerary on my profile that covers these spots, feel free to check it out!"

Use Case 4: Content Strategy and "Viral Gap" Analysis Problem:…

Key facts

  • Open Source
  • https://github.com/chenningling/RedBook-Search-Comment-MCP
  • Browser & Web Automation, Communication & Messaging, CRM, ERP & E-commerce
  • automation, playwright, social-media, web scraping, xiaohongshu

Part of MCP Servers

Related MCP servers

  • MCP JSON — MCP JSON is an MCP server collection that bundles tools for file system operations, Google search, browser-based web automation, and…
  • MCP NPX Fetch — MCP NPX Fetch is an MCP server that retrieves online resources and transforms web content into structured formats including HTML,…
  • MCP Microsoft Office Bridge — MCP Microsoft Office Bridge is an MCP server that connects AI assistants like Claude to Microsoft 365 services through the…
  • MCP Naver News — MCP Naver News is an MCP server that connects AI assistants to the Naver News API, enabling automated search and…
  • MCP NIF.PT — MCP NIF.PT is an MCP server that connects LLM clients to the Portuguese NIF.PT public API to retrieve and analyze…
  • MCP Node Fetch — MCP Node Fetch is an MCP server that enables language model assistants to retrieve web content and query remote endpoints…

How do I install Xiaohongshu Search & Comment?

To install Xiaohongshu Search & Comment, clone the repository and set up a Python virtual environment. Install the dependencies using pip install -r requirements.txt and pip install fastmcp, then execute playwright install to configure the necessary browser binaries. Finally, add the server command and python script path using absolute file paths to your MCP client configuration file.

What can Xiaohongshu Search & Comment do?

The server allows LLM clients to automate Xiaohongshu interactions. It provides tools to search notes with custom keyword queries, retrieve note text and metadata, extract comment sections, and publish automated comments. Available comment styles include lead generation, basic interaction, inquiry questions, and professional domain insights.

Which MCP clients work with Xiaohongshu Search & Comment?

Any client supporting the Model Context Protocol over standard input and output can use Xiaohongshu Search & Comment. Common compatible clients include Claude for Desktop, Cursor, and custom FastMCP client wrappers. You configure the client by supplying the absolute path to your Python interpreter and the server script.

How does authentication work in Xiaohongshu Search & Comment?

Initial authentication requires calling the login tool, which opens a Playwright browser window. The user manually scans the displayed QR code with the Xiaohongshu mobile app. Once logged in, the browser context and session cookies are preserved locally, allowing future MCP tool invocations to run without scanning again.

Is Xiaohongshu Search & Comment open source?

Yes, Xiaohongshu Search & Comment is an open-source project hosted on GitHub. Anyone can inspect the Python and Playwright code, adjust scraping behavior, or extend the automated comment types. The public repository also provides access to newer version updates and instructions for community contributions.

  • AI Tools
  • Categories
  • Industries
  • CLI Coding Agents
  • MCP Servers
  • MCP Categories