xhs-mcp
Enables login to Xiaohongshu via local Chrome and searching notes by keyword, returning titles and links. It maintains a separate Chrome profile for isolated login state and is compatible with DSH, Claude, and Cursor through the MCP protocol.
README
📕 xhs-mcp — 把小某书变成你的 MCP 工具
本机运行 · Chrome 驱动 · 小号安全 — 小红书 ⇌ 任意 MCP 宿主(优先 DSH)
一个轻量 MCP Server,让你在 DSH / Claude / Cursor 等宿主里通过**私聊/工具调用操作小红书: **登录、搜索笔记!(发帖能力预留,需主人明确授权)
✨ 功能
| 能力 | 说明 | 状态 |
|---|---|---|
| 🔐 独立登录态 | 独立 Chrome profile,扫码一次永久免登录 | ✅ |
| 🔍 搜索笔记 | 关键词搜索,返回标题 + 链接 | ✅ |
| 🛡️ 反检测 | 真 Chrome + 真实 UA + 移除 webdriver 标记 | ✅ |
| 👤 小号隔离 | profile 独立,不碰主人日常账号 | ✅ |
| 📝 发帖 | 接口预留(需主人明确授权) | 🚧 |
| 🖥️ 多宿主 | stdio MCP,DSH/Claude/Cursor 通吃 | ✅ |
🚀 快速开始(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!!
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.