xiaohongshu-mcp
Allows interaction with Xiaohongshu (Little Red Book), providing tools for searching notes, fetching recommended feeds and note details, publishing image-text posts, and liking/favoriting feeds.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@xiaohongshu-mcp 帮我搜一下小红书上的露营攻略,取前三条"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
@the-thing/xiaohongshu-mcp
小红书 MCP Server(浏览器自动化实现)。扫码登录后,AI 助手可直接搜索笔记、获取推荐/详情、发布图文、点赞收藏。
借鉴 xpzouying/xiaohongshu-mcp 的实现思路(__INITIAL_STATE__ 数据提取、人性化延迟模拟、发布成功验证),采用 Node.js + puppeteer-core 实现,复用本机 Chrome/Edge,无需下载浏览器,npx 一行接入。
安装(一行配置)
在你的 MCP 客户端配置文件(如 ~/.siact/mcps/xiaohongshu.json)中添加:
{
"mcpServers": {
"xiaohongshu": {
"command": "npx",
"args": ["-y", "@the-thing/xiaohongshu-mcp@latest"]
}
}
}要求:Node.js 18+,本机装有 Google Chrome 或 Microsoft Edge(自动探测,也可用环境变量 PUPPETEER_EXECUTABLE_PATH 指定)。
Related MCP server: XHS MCP
可用工具(9 个)
工具 | 说明 | 必填参数 |
| 扫码登录小红书(首次使用),登录态自动保存 | 无 |
| 检查登录状态,返回当前账号昵称 | 无 |
| 退出登录,清除本地登录态 | 无 |
| 按关键词搜索笔记 | keyword, limit? |
| 获取首页推荐列表 | limit? |
| 获取笔记详情(正文/图片/互动/评论) | feedId, xsecToken |
| 发布图文笔记(本地图片或 URL) | title, content, images |
| 点赞/取消点赞(自动检测状态防重复) | feedId, xsecToken |
| 收藏/取消收藏(自动检测状态防重复) | feedId, xsecToken |
搜索/推荐结果会返回
id与xsecToken,二者组合才能访问详情页(小红书安全机制),详情/点赞/收藏均需传入。
使用示例
帮我搜索小红书上的"咖啡探店"笔记,取 5 条
→ xhs_search_feeds(keyword="咖啡探店", limit=5)
看一下第一条笔记的详细内容和评论
→ xhs_get_feed_detail(feedId=..., xsecToken=...)
帮我把这张图配一段文案发到小红书:C:\pics\coffee.jpg
→ xhs_publish_note(title="...", content="...", images=["C:\\pics\\coffee.jpg"])环境变量
变量 | 说明 |
| 指定 Chrome/Edge 可执行文件路径(默认自动探测) |
| 登录态 cookies 文件路径(默认 |
| 浏览器 profile 目录(默认临时目录,登录态由 cookies 管理) |
|
|
| 代理地址(如 |
本地开发
git clone <repo>
cd xiaohongshu-mcp
npm install
npm start # 启动 MCP server(stdio)
node client.js # 联调:列出工具并调用 xhs_check_login免责声明
本项目仅用于学习与研究,使用者应遵守小红书平台规则,控制操作频率,账号风险自负。
Available Tools
9 toolsxhs_check_loginA
检查小红书登录状态:验证本地保存的登录态是否有效,已登录时返回当前账号昵称并刷新登录态。
Inputs: no named parameters.
xhs_favorite_feedA
为笔记收藏或取消收藏:智能检测当前状态,已处于目标状态时自动跳过。需要笔记 ID 与 xsecToken。
Inputs: feedId (required), xsecToken (required), unfavorite.
xhs_get_feed_detailA
获取小红书笔记详情:返回笔记标题、正文、图片列表、作者信息、互动数据与前若干条评论。需要笔记 ID 与 xsecToken(两者缺一不可,从搜索/推荐结果获取)。
Inputs: feedId (required), xsecToken (required).
xhs_get_recommend_feedsA
获取小红书首页推荐笔记列表(返回笔记 ID、xsecToken、标题、作者、互动数据)。
Inputs: limit.
xhs_like_feedA
为笔记点赞或取消点赞:智能检测当前状态,已处于目标状态时自动跳过。需要笔记 ID 与 xsecToken。
Inputs: feedId (required), xsecToken (required), unlike.
xhs_loginA
登录小红书:打开浏览器窗口弹出登录二维码,等待扫码。扫码成功后自动保存登录态,后续无需重复登录。
Inputs: no named parameters.
xhs_logoutA
退出登录:清除本地保存的小红书登录态。
Inputs: no named parameters.
xhs_publish_noteA
发布图文笔记到小红书:需要标题(最多 20 字)、正文、至少 1 张图片(本地绝对路径或 HTTP 图片链接),可选话题标签。发布前需已登录。
Inputs: title (required), images (required), content (required), tags.
xhs_search_feedsA
搜索小红书笔记:按关键词搜索,返回笔记列表(含笔记 ID、xsecToken、标题、作者、互动数据)。返回的 id + xsecToken 可用于 xhs_get_feed_detail / xhs_like_feed / xhs_favorite_feed。
Inputs: keyword (required), limit.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 9 tools
Each tool has a clear, distinct purpose: authentication (login/check/logout), feed retrieval (search vs recommend), detail fetch, publishing, and engagement (like vs favorite). No two tools appear to do the same thing.
All tools follow a consistent xhs_verb_noun pattern in snake_case, such as xhs_search_feeds, xhs_get_feed_detail, and xhs_publish_note. This makes the tool set highly predictable.
9 tools is well within the ideal range for a client MCP server. Each tool serves a distinct and necessary function for interacting with the platform.
Core workflows are covered: authentication, search, recommend, detail, publish, like, and favorite. Notable gaps include comment creation, user follow, and note update/delete, but these are not critical for basic read/write interactions.
Maintenance
Related MCP Connectors
搜索笔记、浏览首页推荐、查看笔记内容与评论,并发表你的评论。直接在工作流中与小红书内容互动,高效跟进话题。
RedNote (Xiaohongshu, 小红书) note search, full notes, comment threads and creator profiles.
XHS search/details, PGY, comments/replies, users/ID resolution/posts, transcript
Social data for AI agents: TikTok, RedNote, Douyin, WeChat, X, YouTube and more. Pay per call.
Related MCP Servers
- FlicenseBqualityDmaintenanceEnables automated interaction with Xiaohongshu (Little Red Book) social media platform through browser automation. Supports login management, status checking, and publishing text content with images to Xiaohongshu accounts.33-
- AlicenseNot gradedqualityDmaintenanceEnables interaction with Xiaohongshu (Little Red Book) platform through automated browser operations. Supports authentication, content publishing, search, discovery, and commenting using Puppeteer-based automation.546 npm58MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to publish content to XiaoHongShu (Little Red Book) social platform, including checking login status and posting with titles, content, images, and hashtags through browser automation.4ISC
- FlicenseNot gradedqualityDmaintenanceEnables automated interaction with Xiaohongshu (Little Red Book) platform including searching posts, retrieving content and comments, and posting AI-generated comments with persistent login support.460-