Content
# Xiaohongshu API MCP Server | 小红书 API 微服务
This is a microservice that wraps the Xiaohongshu API into a RESTful API server. It can be deployed using Docker.
## Features
- RESTful API for Xiaohongshu operations | 小红书操作的 RESTful API
- Multiple client support | 支持多客户端
- Docker containerization | Docker 容器化
- Easy to deploy and scale | 易于部署和扩展
## API Endpoints
The server provides the following endpoints:
- `/clients` - Create and manage Xiaohongshu client instances
- `/clients/{client_id}/note` - Get note by ID
- `/clients/{client_id}/note/html` - Get note from HTML by ID
- `/clients/{client_id}/search/notes` - Search notes by keyword
- `/clients/{client_id}/search/users` - Search users by keyword
- `/clients/{client_id}/user/info` - Get user information by ID
- `/clients/{client_id}/user/notes` - Get user notes
- `/clients/{client_id}/feed/categories` - Get recommended feed categories
- `/clients/{client_id}/feed/{feed_type}` - Get recommended feed by type
- `/health` - Health check endpoint
## Project Structure
```
.
├── xhs_mcp_server/ # Main server directory
│ ├── app/ # Core application
│ ├── xhs/ # Xiaohongshu API module
│ ├── Dockerfile # Docker build file
│ └── requirements.txt # Python dependencies
└── xhs_api.py # API implementation
```
## Quick Start
### Prerequisites
- Docker
- Docker Compose
### Installation and Running
1. Build and start the Docker container:
```bash
cd xhs_mcp_server
docker-compose up -d
```
The service will run at `http://localhost:8000`.
2. Run directly with Python:
```bash
pip install -r xhs_mcp_server/requirements.txt
python xhs_api.py
```
### API Documentation
Once the server is running, you can access the API documentation at:
- Swagger UI: `http://localhost:8000/docs`
- ReDoc: `http://localhost:8000/redoc`
## Usage Examples
1. Create a client:
```bash
curl -X POST "http://localhost:8000/clients" \
-H "Content-Type: application/json" \
-d '{"cookie": "your_cookie_here"}'
```
2. Get note by ID:
```bash
curl -X POST "http://localhost:8000/clients/client_1/note" \
-H "Content-Type: application/json" \
-d '{"note_id": "your_note_id", "xsec_token": "your_xsec_token"}'
```
## License
This project is for educational purposes only. Use at your own risk.
Connection Info
You Might Also Like
awesome-mcp-servers
A collection of MCP servers.
git
A Model Context Protocol server for Git automation and interaction.
Appwrite
Build like a team of hundreds
TrendRadar
TrendRadar: Your hotspot assistant for real news in just 30 seconds.
chatbox
User-friendly Desktop Client App for AI Models/LLMs (GPT, Claude, Gemini, Ollama...)
oh-my-opencode
Background agents · Curated agents like oracle, librarians, frontend...