Skip to main content
Glama

📕 xhs-mcp — 把小某书变成你的 MCP 工具

本机运行 · Chrome 驱动 · 小号安全 — 小红书 ⇌ 任意 MCP 宿主(优先 DSH)

一个轻量 MCP Server,让你在 DSH / Claude / Cursor 等宿主里通过**私聊/工具调用操作小红书: **登录、搜索笔记!(发帖能力预留,需主人明确授权)


✨ 功能

能力

说明

状态

🔐 独立登录态

独立 Chrome profile,扫码一次永久免登录

🔍 搜索笔记

关键词搜索,返回标题 + 链接

🛡️ 反检测

真 Chrome + 真实 UA + 移除 webdriver 标记

👤 小号隔离

profile 独立,不碰主人日常账号

📝 发帖

接口预留(需主人明确授权)

🚧

🖥️ 多宿主

stdio MCP,DSH/Claude/Cursor 通吃


Related MCP server: Xiaohongshu (RedBook) MCP Server

🚀 快速开始(DSH 优先)

前置

  • Node.js ≥ 20

  • **Google Chrome 已装)(或指定路径)

1️⃣ 下载

git clone https://github.com/HUliangwei/xhs-mcp.git
cd xhs-mcp
npm install          # 安装 playwright-core

2️⃣ 配置

cp .env.example .env
# 按需改 XHS_PROFILE(多账号用不同名)

3️⃣ 注册到 DSH

把 dsh-bundle/ 复制进你的 profile bundles,并在 profile 的 package.json dsh.profile.bundles 加上 ./bundles/xhs-mcp:

{ "dsh": { "profile": { "bundles": [ "./bundles/xhs-mcp" ] } } }

重启 DSH → 工具组 xhs_* 可用。

4️⃣ 其他宿主

{ "mcpServers": { "xhs": { "command": "node", "args": ["<路径>/xhs-mcp-server.mjs"] } } }

🛠️ 工具

工具

说明

xhs_login

打开真实 Chrome,扫码登录(180s,持久化)

xhs_search

搜笔记:{ keyword, count } → 标题+链接

xhs_status

登录状态检查


🛡️ 安全设计

  • **仅私聊/工具调用:不接入任何群聊广播

  • **小号专用:独立 profile,登录态隔离,不碰主人主账号

  • **只读优先:当前只读+搜索;发帖需主人明确授权、低频合规

  • **本地运行:无远程服务器,数据不出本机

  • **不进 git:profiles/(登录态)、.env 全忽略


📜 开源

Apache-2.0 · GitHub

**觉得好用?⭐ Star!!

A
license - permissive license
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

View all related MCP servers

Related MCP Connectors

  • 搜索笔记、浏览首页推荐、查看笔记内容与评论,并发表你的评论。直接在工作流中与小红书内容互动,高效跟进话题。

  • Search, read, and write your Apple Notes from ChatGPT/Claude via a local Mac agent + MCP relay.

  • Browser MCP for logged-in tasks. Uses your Chrome — credentials stay local. Zero-token replay.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/HUliangwei/xhs-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server