npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@siact/xiaohongshu-mcp

v0.1.0

Published

An MCP server for Xiaohongshu (小红书) via browser automation. 扫码登录+搜索/推荐/笔记详情/发布图文/点赞收藏,只需配置一行 MCP 即可使用。

Readme

@siact/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", "@siact/xiaohongshu-mcp@latest"]
    }
  }
}

要求:Node.js 18+,本机装有 Google Chrome 或 Microsoft Edge(自动探测,也可用环境变量 PUPPETEER_EXECUTABLE_PATH 指定)。

可用工具(9 个)

| 工具 | 说明 | 必填参数 | |---|---|---| | xhs_login | 扫码登录小红书(首次使用),登录态自动保存 | 无 | | xhs_check_login | 检查登录状态,返回当前账号昵称 | 无 | | xhs_logout | 退出登录,清除本地登录态 | 无 | | xhs_search_feeds | 按关键词搜索笔记 | keyword, limit? | | xhs_get_recommend_feeds | 获取首页推荐列表 | limit? | | xhs_get_feed_detail | 获取笔记详情(正文/图片/互动/评论) | feedId, xsecToken | | xhs_publish_note | 发布图文笔记(本地图片或 URL) | title, content, images | | xhs_like_feed | 点赞/取消点赞(自动检测状态防重复) | feedId, xsecToken | | xhs_favorite_feed | 收藏/取消收藏(自动检测状态防重复) | feedId, xsecToken |

搜索/推荐结果会返回 idxsecToken,二者组合才能访问详情页(小红书安全机制),详情/点赞/收藏均需传入。

使用示例

帮我搜索小红书上的"咖啡探店"笔记,取 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"])

环境变量

| 变量 | 说明 | |---|---| | PUPPETEER_EXECUTABLE_PATH | 指定 Chrome/Edge 可执行文件路径(默认自动探测) | | XHS_COOKIES_PATH | 登录态 cookies 文件路径(默认 ~/.xiaohongshu-mcp/cookies.json) | | XHS_USER_DATA_DIR | 浏览器 profile 目录(默认 ~/.xiaohongshu-mcp/profile) | | XHS_HEADLESS | false 时所有操作显示浏览器窗口(默认无头) | | XHS_PROXY | 代理地址(如 http://127.0.0.1:7890) |

本地开发

git clone <repo>
cd xiaohongshu-mcp
npm install
npm start        # 启动 MCP server(stdio)
node client.js   # 联调:列出工具并调用 xhs_check_login

免责声明

本项目仅用于学习与研究,使用者应遵守小红书平台规则,控制操作频率,账号风险自负。