Content
# Automated Xiaohongshu MCP Server
This is an MCP-based Xiaohongshu content creation and management tool that helps you automate operations on the Xiaohongshu content platform, including searching for notes, publishing notes, commenting, and more.
## Features
- 🔍 Search Xiaohongshu notes
- 📝 Publish image/video notes
- 💬 Automatically comment on notes
- 🏠 Get homepage recommendations
- 🔐 Support account login and verification
## Quick Start
### 1. Environment Requirements
* node.js
* python 3.12
* uv (pip install uv)
### 2. Install Dependencies
```sh
git clone https://github.com/fancyboi999/xhs-auto-mcp.git
cd xhs-auto-mcp
uv venv
source .venv/bin/activate
uv pip install -e .
```
### 3. Get Xiaohongshu Cookie
[Open Xiaohongshu Web](https://www.xiaohongshu.com/explore)
After logging in, get the cookie of the content platform and configure the cookie to the XHS_COOKIE environment variable of the MCP server.

### 4. Configure MCP Server
There are two ways to configure and start the MCP server. The environment variable JSON_PATH is used to store the creation platform token and cookie, so please fill in the absolute path:
#### Method 1: Use stdio Protocol (Direct Connection)
Add the following to the Claude configuration:
```json
{
"mcpServers": {
"xhs-auto-mcp": {
"command": "uvx",
"args": ["xhs-auto-mcp", "--transport", "stdio"],
"env": {
"XHS_COOKIE": "xxxx",
"JSON_PATH": "your_token_save_path"
}
}
}
}
```
#### Method 2: Use HTTP Protocol
1. Start HTTP service:
```sh
env XHS_COOKIE=xxxx JSON_PATH=your_token_save_path uvx xhs-auto-mcp --transport http --port 8080
```
2. Add the following to the Claude configuration:
```json
{
"mcpServers": {
"xhs-auto-mcp": {
"type": "http",
"url": "http://localhost:8080/mcp"
}
}
}
```
## Tool Usage Instructions
This project provides a variety of tools to operate the Xiaohongshu platform:

### Content Platform Tools
- **Check Cookie Validity**: Verify whether the current cookie is valid
- **Get Homepage Recommended Notes**: Get Xiaohongshu homepage recommended content
- **Search Notes**: Search for notes based on keywords
- **Get Note Content**: Get the detailed content of the specified note
- **Get Note Comments**: Get comments for the specified note
- **Post Comment**: Post a comment on the specified note
### Creation Platform Tools
- **Login**: Log in to the Xiaohongshu creation platform via phone number and verification code
- **Publish Image Note**: Create and publish a note containing images
- **Publish Video Note**: Create and publish a note containing videos
## Demo Video
Watch the demo video to learn how to use this tool: [Demo Video](docs/demo.mp4)
## Disclaimer
This project is for learning and communication purposes only and is prohibited for other purposes. Any commercial profit-making purposes are not allowed, otherwise, the risk is at your own risk.
Connection Info
You Might Also Like
markitdown
Python tool for converting files and office documents to Markdown.
markitdown
MarkItDown-MCP is a lightweight server for converting URIs to Markdown.
Filesystem
Node.js MCP Server for filesystem operations with dynamic access control.
TrendRadar
TrendRadar: Your hotspot assistant for real news in just 30 seconds.
mempalace
The highest-scoring AI memory system ever benchmarked. And it's free.
mempalace
The highest-scoring AI memory system ever benchmarked. And it's free.