小红书MCP服务
该项目为小红书提供MCP服务,包括搜索笔记、获取笔记内容以及发表评论。它通过JS逆向解析出x-s和x-t,可以直接请求HTTP接口,无需使用笨重的Playwright等工具。
MCP 服务配置
复制以下 JSON 到 OPClaw 或其他 MCP 客户端的配置文件中即可使用
{
"mcpServers": {
"xhs-mcp": {
"args": [
"--directory",
"/Users/xxx/xhs-mcp",
"run",
"main.py"
],
"command": "uv",
"env": {
"XHS_COOKIE": "xxxx"
}
}
}
}
该服务需要配置环境变量:XHS_COOKIE
服务介绍
Xiaohongshu MCP Service
Features
- Uses js to reverse-engineer x-s and x-t, directly requests the HTTP interface, without the need for the cumbersome playwright.
- Search for notes
- Get note content
- Get comments on a note
- Post a comment

Quick Start
1. Environment
- node
- python 3.12
- uv (pip install uv)
2. Install Dependencies
sh
git clone git@github.com:jobsonlook/xhs-mcp.git
cd xhs-mcp
uv sync
3. Obtain Xiaohongshu's Cookie
Open Xiaohongshu Webpage
After logging in, obtain the cookie and configure it into the XHS_COOKIE environment variable as described in step 4.

4. Configure MCP Server
json
{
"mcpServers": {
"xhs-mcp": {
"command": "uv",
"args": [
"--directory",
"/Users/xxx/xhs-mcp",
"run",
"main.py"
],
"env": {
"XHS_COOKIE": "xxxx"
}
}
}
}
Disclaimer
This project is intended solely for learning and communication purposes. It is strictly prohibited from being used for any other purpose, especially for commercial profit. Any use for commercial gain is not allowed, and doing so will be at your own risk.