Skip to main content
Glama

📕 xhs-mcp — Turn Xiaohongshu into your MCP tool

Runs locally · Chrome-driven · Alt-account safe — Xiaohongshu ⇌ any MCP host (DSH first)

A lightweight MCP Server that lets you operate Xiaohongshu from hosts like DSH / Claude / Cursor via private chat / tool calls: login, search notes! (Posting capability reserved, requires explicit owner authorization)


✨ Features

Capability

Description

Status

🔐 Independent login state

Independent Chrome profile, scan once for permanent login

🔍 Search notes

Keyword search, returns title + link

🛡️ Anti-detection

Real Chrome + real UA + removes webdriver flag

👤 Alt-account isolation

Independent profile, doesn't touch owner's daily account

📝 Posting

Interface reserved (requires explicit owner authorization)

🚧

🖥️ Multi-host

stdio MCP, works with DSH/Claude/Cursor


Related MCP server: Xiaohongshu (RedBook) MCP Server

🚀 Quick Start (DSH first)

Prerequisites

  • Node.js ≥ 20

  • Google Chrome installed (or specify a path)

1️⃣ Download

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

2️⃣ Configure

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

3️⃣ Register with DSH

Copy dsh-bundle/ into your profile bundles, and add ./bundles/xhs-mcp to dsh.profile.bundles in the profile's package.json:

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

Restart DSH → the xhs_* tool group becomes available.

4️⃣ Other hosts

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

🛠️ Tools

Tool

Description

xhs_login

Opens real Chrome, scan-code login (180s, persistent)

xhs_search

Search notes: { keyword, count } → title + link

xhs_status

Login status check


🛡️ Security Design

  • Private chat / tool calls only: no group chat broadcast

  • Alt-account only: independent profile, isolated login state, doesn't touch owner's main account

  • Read-only first: currently read-only + search; posting requires explicit owner authorization, low-frequency compliance

  • Runs locally: no remote server, data never leaves the machine

  • Not in git: profiles/ (login state), .env all ignored


📜 Open Source

Apache-2.0 · GitHub

Like it? ⭐ Star it!!

Related MCP Connectors

Related MCP Servers