Provides an MCP server to search Xiaohongshu notes, fetch note contents, retrieve comments, and post comments.
Configuration
View docs{
"mcpServers": {
"blbl147-xhs-mcp": {
"command": "uv",
"args": [
"--directory",
"/Users/xxx/xhs-mcp",
"run",
"main.py"
],
"env": {
"XHS_COOKIE": "xxxx"
}
}
}
}You can run the Xiaohongshu MCP server to search notes, fetch note contents, retrieve comments, and post new comments by configuring a local MCP endpoint that executes a Python-based service through a lightweight runner. This setup avoids heavier browser automation and provides direct HTTP-like interactions for common Xiaohongshu actions.
Your MCP client will talk to the Xiaohongshu MCP server you configure. With it, you can search Xiaohongshu notes, retrieve the content of a specific note, fetch the notes’ comments, and publish new comments. Ensure you supply your Xiaohongshu login cookie as an environment variable so the server can access user-specific data.
Prerequisites you need to have installed on your system:
Node.js is not required for the MCP itself since the server runs as a Python process via a runner, but you will utilize a runner command in the configuration. The server configuration uses a Python-based entry point run by the uv runner.
Python 3.12 should be installed on your system to satisfy the runtime requirements.
Install the uv runner using Python’s package manager.
Prepare the following prerequisites on your machine.
git clone [email protected]:jobsonlook/xhs-mcp.git
cd xhs-mcp
uv syncOpen Xiaohongshu in a web browser and log in. Retrieve your login cookie after signing in and prepare to set it in the MCP configuration as XHS_COOKIE.
{
"mcpServers": {
"xhs-mcp": {
"command": "uv",
"args": [
"--directory",
"/Users/xxx/xhs-mcp",
"run",
"main.py"
],
"env": {
"XHS_COOKIE": "xxxx"
}
}
}
}Search Xiaohongshu notes based on keywords or filters.
Retrieve the full content for a specific Xiaohongshu note by its ID.
Fetch the list of comments for a given Xiaohongshu note.
Submit a comment to a Xiaohongshu note on behalf of the authenticated user.