Automate Xiaohongshu with Open Source MCP Project

September 12, 2025

Automate Your Xiaohongshu Presence with the xiaohongshu-mcp Open-Source Project

The "xiaohongshu-mcp" project, hosted on GitHub, presents as a robust open-source solution for automating interactions with the popular Chinese social media platform, Xiaohongshu (Little Red Book). Developed in Go, this project leverages the Model Context Protocol (MCP) to enable programmatic control over various platform functionalities.

Key Features and Capabilities:

This project empowers users to perform a range of actions on Xiaohongshu without manual intervention. Its core features include:

  • Login and Session Management: Securely log in to your Xiaohongshu account and maintain login status. The project includes clear demonstrations of the login process and checking the current login state.
  • Content Publishing: Effortlessly publish image-and-text posts. The system supports setting titles and descriptions, with future plans to include video and pure text content posting.
  • Content Search: Search for Xiaohongshu posts based on keywords, streamlining content discovery.
  • Feed Retrieval: Fetch recommended content from the Xiaohongshu homepage, providing a stream of trending posts.
  • Detailed Post Analysis: Retrieve comprehensive details of individual posts, including content, user information, engagement metrics (likes, collections, shares, comments), and the comment section itself. Note: Requires a feed_id and xsec_token for this functionality.
  • Comment Posting: Automate the process of commenting on posts. The system can locate the comment input field, enter the comment, and submit it, compatible with both HTTP API and MCP tool calls. This also requires feed_id, xsec_token, and the comment content.

Technical Integration and Compatibility:

The xiaohongshu-mcp project adheres to the Model Context Protocol (MCP), an industry standard that facilitates seamless integration with various AI clients and tools. This includes:

  • Claude Code CLI: Easily integrate with your Claude Code workflow by adding the xiaohongshu-mcp as an HTTP MCP server.
  • Cursor: Configure Cursor to recognize and utilize the xiaohongshu-mcp service through a simple JSON configuration file, allowing for efficient in-editor automation.
  • VSCode: Integrate the project into your VSCode environment either via the command palette or by directly editing workspace configuration files.
  • Google Gemini CLI: Add the service to your Gemini CLI settings for broader AI-powered automation capabilities.
  • MCP Inspector: A debugging tool that allows you to test MCP connections and verify the availability of tools provided by the server.

Any client that supports the HTTP MCP protocol can connect to the xiaohongshu-mcp service, typically running at http://localhost:18060/mcp.

Getting Started and Usage:

To begin using the project:

  1. Clone the repository: Download the Go project from GitHub.
  2. Login: Run go run cmd/login/main.go for initial login.
  3. Start the MCP Service: Execute go run . for headless operation or go run . -headless=false for a visible browser interface.
  4. Verify with MCP Inspector: Use npx @modelcontextprotocol/inspector to connect and test the server's functionalities.

Important Considerations:

  • Title Length: Xiaohongshu titles are limited to 20 characters. Adhering to this is crucial for successful posting.
  • Posting Frequency: The project suggests a daily posting limit of 50 posts per account based on practical experience.
  • Login Restrictions: Avoid logging into the same Xiaohongshu account on multiple web instances simultaneously, as this can cause the MCP session to be logged out.
  • Risk Disclaimer: The project is intended for learning and research purposes. While the underlying system has been stable and has not led to account bans in over a year of use (only requiring cookie refreshes), all use must comply with platform terms of service and avoid any illegal activities.

Community and Contributions:

The project encourages community engagement and contributions. The developer has set up a WeChat group for discussion and collaboration on improving the project. Users experienced issues or have suggestions are welcome to join.

Original Article: View Original

Share this article