Provides a unified MCP server and CLI to automate Xiaohongshu interactions including login, publish, search, and discovery.
Configuration
View docs{
"mcpServers": {
"algovate-xhs-mcp": {
"url": "http://localhost:3000/mcp",
"headers": {
"XHS_ENABLE_LOGGING": "true"
}
}
}
}You can run a unified MCP server and CLI to automate Xiaohongshu interactions, including login, publishing content, discovery, searching, and notes management. This MCP server provides both a local stdio interface and an HTTP server option for remote clients to connect and issue commands.
You will run the MCP server locally and choose between two connection methods: a standard input/output (stdio) interface for direct local use or an HTTP server for remote clients. The stdio mode starts a local process that you interact with directly through the command line. The HTTP mode runs a server you can connect to over HTTP, suitable for external tooling or your own automation scripts.
Common workflows include authenticating, publishing content (images or videos), discovering feeds, searching notes, and managing your notes. The MCP server integrates with Puppeteer to drive a headless browser for automation, handles cookies, and supports both local image paths and image URLs for publishing.
Prerequisites: you need Node.js and npm installed on your system. Ensure you have standard command line tools available.
Install and run the MCP server in stdio mode (default) using the following command.
npx xhs-mcp mcpIf you want to enable verbose logging for debugging, prepend the environment variable when starting.
XHS_ENABLE_LOGGING=true npx xhs-mcp mcpTo start an HTTP server, which serves the MCP endpoint over HTTP, use the HTTP mode and optionally specify a port.
npx xhs-mcp mcp --mode httpIf you want to serve on a custom port, specify it like this.
npx xhs-mcp mcp --mode http --port 8080Authenticate the user, store session cookies, and enable subsequent actions.
Clear session data and end the authenticated session.
Check the current authentication state and session validity.
Publish content using a unified interface for images or videos, with optional tags.
Publish an image-based post using local files or image URLs.
Publish a video-based post with a title and description.
Discover recommended feeds and content streams.
Search for notes or content using keywords.
Fetch detailed information for a specific note.
List notes owned by the authenticated user.
Delete a user's note by ID or delete the last published note.
Post a comment on a specific feed item or note.