Xiaohongshu API MCP Server | 小红书 API 微服务
LocalAbout Xiaohongshu API MCP Server | 小红书 API 微服务
Xiaohongshu API MCP Server packages Xiaohongshu operations as a RESTful API microservice deployable with Docker and usable by multiple clients. Its endpoints cover notes, users, and recommendation feeds.
Key features
- 01Manage multiple Xiaohongshu clients
- 02Retrieve notes by ID
- 03Search notes and users
- 04Fetch user information and notes
- 05Access feed categories and content
- 06Docker container deployment
Use cases
- 01Search Xiaohongshu notes by keyword
- 02Retrieve a user's profile and notes
- 03Read note details or HTML content
- 04Deploy the Xiaohongshu API with Docker
MCP support
The input identifies it as an MCP server, but the README describes RESTful API endpoints and does not specify MCP protocol tools or resources that it exposes.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.
Tools
Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.
Details
From the project READMEXiaohongshu API MCP Server | 小红书 API 微服务
这是一个将小红书 API 封装成 RESTful API 服务器的微服务。可以使用 Docker 进行部署。
功能特点
- RESTful API for Xiaohongshu operations | 小红书操作的 RESTful API
- Multiple client support | 支持多客户端
- Docker containerization | Docker 容器化
- Easy to deploy and scale | 易于部署和扩展
API 端点
服务器提供以下端点:
/clients- 创建和管理小红书客户端实例/clients/{client_id}/note- 通过 ID 获取笔记/clients/{client_id}/note/html- 从 HTML 通过 ID 获取笔记/clients/{client_id}/search/notes- 通过关键词搜索笔记/clients/{client_id}/search/users- 通过关键词搜索用户/clients/{client_id}/user/info- 通过 ID 获取用户信息/clients/{client_id}/user/notes- 获取用户笔记/clients/{client_id}/feed/categories- 获取推荐流分类/clients/{client_id}/feed/{feed_type}- 通过类型获取推荐流/health- 健康检查端点
项目结构
.
├── xhs_mcp_server/ # 主服务器目录
│ ├── app/ # 应用程序核心
│ ├── xhs/ # 小红书API模块
│ ├── Dockerfile # Docker构建文件
│ └── requirements.txt # Python依赖
└── xhs_api.py # API实现
快速开始
前提条件
- Docker
- Docker Compose
安装和运行
- 构建并启动 Docker 容器:
cd xhs_mcp_server
docker-compose up -d
服务将在 http://localhost:8000 运行。
- 通过Python直接运行:
pip install -r xhs_mcp_server/requirements.txt
python xhs_api.py
API 文档
服务器运行后,您可以在以下位置访问 API 文档:
- Swagger UI:
http://localhost:8000/docs - ReDoc:
http://localhost:8000/redoc
使用示例
- 创建客户端:
curl -X POST "http://localhost:8000/clients" \
-H "Content-Type: application/json" \
-d '{"cookie": "your_cookie_here"}'
- 通过 ID 获取笔记:
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"}'
许可证
本项目仅用于教育目的。使用风险自负。
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.