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
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 ---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" ] } } } ---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). ---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."Part of MCP Servers