Atlas / MCP servers / algovate / XHS CLI

XHS CLIBLOCK

mcp/algovate/xhs-cli

用于小红书(xiaohongshu.com)的 Model Context Protocol(MCP)服务器与 CLI 工具,支持登录、发布、搜索、推荐等自动化能力

Verdict
BLOCK
Grade
D
Trust score
69 /100
Exposed tools
10 7r · 2w · 1d
Transport
sse · stdio · streamable-http
License
MIT
Stars
55
01

Overview

From the repository's own README, as read at the audited commit. Badges and raw HTML are left out.

简体中文 | English

xhs-mcp 提供统一的命令行入口 xhs-mcp,并内置 MCP 服务器子命令。用于小红书(xiaohongshu.com)的 Model Context Protocol(MCP)服务器与 CLI 工具,支持登录、发布、搜索、推荐等自动化能力(基于 Puppeteer)。

[](https://www.npmjs.com/package/xhs-mcp) [](https://www.npmjs.com/package/xhs-mcp) [](https://opensource.org/licenses/MIT)

📦 NPM 信息

  • 包名: xhs-mcp
  • 运行 CLI(推荐): npx xhs-mcp
  • 启动 MCP:npx xhs-mcp mcp [--mode stdio|http] [--port 3000]

✨ 功能

  • 认证:登录、登出、状态检查
  • 发布:图文和视频发布
  • 图文发布:标题≤20字符(40显示单位)、内容≤1000、最多18图
  • 视频发布:支持 MP4、MOV、AVI、MKV、WebM、FLV、WMV 格式
  • ⭐ 新功能: 支持图片 URL 自动下载(HTTP/HTTPS)
  • ⭐ 新功能: 标题宽度精确验证(CJK字符2单位,ASCII字符1单位)
  • 支持本地图片路径
  • 支持 URL 和本地路径混合使用
  • 智能缓存机制,避免重复下载
  • 发现:推荐、搜索、详情、评论
  • 用户笔记:列表查看、删除管理
  • 自动化:Puppeteer 驱动、无头模式、Cookie 管理
  • 验证:发布功能验证脚本,支持 HTML 报告生成

📋 可用工具

  • xhs_auth_login、xhs_auth_logout、xhs_auth_status
  • xhs_discover_feeds、xhs_search_note、xhs_get_note_detail
  • xhs_comment_on_note
  • xhs_get_user_notes、xhs_delete_note(用户笔记管理)
  • xhs_publish_content(统一发布接口:type、title、content、media_paths、tags)
  • 图片发布:1-18个图片文件或URL
  • 视频发布:恰好1个视频文件
  • 混合使用:支持图片URL和本地路径混合

🚀 快速开始(MCP)

Stdio 模式(默认)

npx xhs-mcp mcp

# 调试日志
XHS_ENABLE_LOGGING=true npx xhs-mcp mcp
首次运行提示:如果未安装 Puppeteer 浏览器,先执行 ``bash npx xhs-mcp browser # 自动检查并安装 Chromium,显示可执行路径 # 或 npx puppeteer browsers install chrome ` 输出示例: `json { "success": true, "message": "Chromium is ready", "data": { "installed": true, "executablePath": "/path/to/chromium" } } ``

验证 MCP 连接:

echo '{"jsonrpc": "2.0", "id": 1, "method": "tools/list"}' | npx xhs-mcp mcp

HTTP 模式

# 启动 HTTP 服务器(默认端口 3000)
npx xhs-mcp mcp --mode http

# 指定端口
npx xhs-mcp mcp --mode h
Read from source at commit 063850d768d4OBSERVED · 2026-10-08
Advertisement
02

Connect

Built from this server's own package name, version and transport as found in its source — not copied from anyone's documentation, so it cannot drift against a page we do not control.

claude-code
claude mcp add xhs-mcp -- npx -y [email protected]
claude-desktop
{
  "mcpServers": {
    "xhs-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "[email protected]"
      ]
    }
  }
}
03

Exposed tools (10)

7 read · 2 write · 1 destructive. Blast radius: 1 tool can delete or overwrite — an agent that can be talked into calling a tool can be talked into calling this one.

ToolRiskDescription
xhs_auth_loginwriteStart XiaoHongShu login process.
xhs_auth_logoutreadLogout from XiaoHongShu (clears saved cookies).
xhs_auth_statusreadCheck XiaoHongShu login status (fast check with browser).
xhs_comment_on_notereadComment on a note.
xhs_delete_notedestructiveDelete a user note by ID or delete the last published note.
xhs_discover_feedsreadGet home page feed list.
xhs_get_note_detailreadGet detailed information about a specific note.
xhs_get_user_notesreadGet current user notes list.
xhs_publish_contentwritePublish content to XiaoHongShu (supports both images and videos).
xhs_search_notereadSearch for notes by keyword.
04

Trust audit

BLOCKgrade D · trust 69/100 Do not install this without reading the findings. The audit found something that could harm you or your machine.

LayerWhat it checksResult
L0Provenance & inventoryPASS
L1Static analysis of the codeFAIL
L2Instruction surface (what it tells the agent)PASS
L3Class-specific surfaceWARN
L4Behavioural (sandbox)SKIPPED

What the source does

Filesystem
declared (6 observation(s))
Network
declared (2 observation(s))
Shell
declared (2 observation(s))
Dependencies
not all pinned
Secrets in source
none-found

Findings (11)

HIGHCode injection · code.eval_exec · CWE-78, CWE-94, CWE-95
scripts/cli-validation.js:296
exec(command, { timeout: 60000 }, (error, stdout, stderr) => {
Why it matters. evaluates text as code
Fix. remove; use a parser or a dispatch table
HIGHPrivilege escalation / persistence · priv.escalate · CWE-269, CWE-250
src/cli/cli.ts:161
.option('--with-deps', 'Install OS-level dependencies as well (may require sudo)')
Why it matters. asks for elevated privileges
MEDIUMFilesystem / path · mcp.destructive_tools · CWE-22, CWE-59
xhs_delete_note
Why it matters. 1 tool(s) can delete or overwrite
Fix. prefer a read-only mode or scoped tokens; the page states the blast radius
LOWInventory / provenance · inv.hidden_file · CWE-1104
.cursorindexingignore
.cursorindexingignore
Why it matters. hidden member outside the usual dotfiles
Fix. review its purpose
LOWFilesystem / path · fs.traversal · CWE-22, CWE-59
src/core/auth/auth.service.ts:5
import { Config, LoginResult, StatusResult } from '../../shared/types';
LOWFilesystem / path · fs.traversal · CWE-22, CWE-59
src/core/auth/auth.service.ts:10
} from '../../shared/errors';
LOWFilesystem / path · fs.traversal · CWE-22, CWE-59
src/core/auth/auth.service.ts:11
import { BaseService } from '../../shared/base.service';
LOWFilesystem / path · fs.traversal · CWE-22, CWE-59
src/core/auth/auth.service.ts:13
import { deleteCookiesFile } from '../../shared/cookies';
LOWFilesystem / path · fs.traversal · CWE-22, CWE-59
src/core/auth/auth.service.ts:14
import { isLoggedIn, getLoginStatusWithProfile } from '../../shared/xhs.utils';
LOWSupply chain · supply.unpinned · CWE-829, CWE-1357
package.json
@modelcontextprotocol/sdk, commander, cors, express, node-fetch, puppeteer, string-width, @babel/core
Why it matters. 23 dependency range(s) float
Fix. pin exact versions or ship a lockfile
INFOPrompt injection · scope.undeclared_system · CWE-94, CWE-1427
<declared scope>
system use found in code, not declared in the description
Why it matters. the description does not admit a capability the code has
Fix. declare system use in the description, or remove it

Gates applied: no_behavioural_pass.

Audited 2026-10-08 · audit v0.4.1 · source sha 063850d768d4full audit observations/trust-audit/mcp-server/algovate__xhs-cli.json · Report an issue / request a re-scan
05

Audit history

Every audit this server has had. A grade with a past is a grade somebody is still checking.

DateSourceVerdictGradeScoreChange
2026-10-08063850d768d4BLOCKD69first audit
06

Questions

What is the XHS CLI MCP server?

用于小红书(xiaohongshu.com)的 Model Context Protocol(MCP)服务器与 CLI 工具,支持登录、发布、搜索、推荐等自动化能力

What tools does XHS CLI expose?

10 in total: 7 read-only, 2 that write, and 1 that can delete or overwrite (xhs_delete_note). Every one is listed on this page with its risk.

Is XHS CLI safe to connect to an agent?

No — not without reading the findings first. The audit graded it D (69/100) and found 2 critical or high issues in the source. Each one is listed on this page with the file and line it is on. Separately from the audit: 1 of its tools can destroy data, so scope the token you give it to what you actually need.

What credentials does XHS CLI need?

No credential environment variables were found in its source, so it appears to need none.

How does XHS CLI run?

It speaks sse, stdio and streamable-http, so it runs as a local process your client starts. It is published on npm as xhs-mcp at 0.8.13.

How current is this page?

The grade is for one exact copy of the source (063850d768d4), read on 2026-10-08. The repository is watched and re-audited when it changes.

Advertisement