Skill flagged — review recommended

ClawHub Security found sensitive or high-impact capabilities. Review the scan results before using.

小红书 MCP 服务

v1.1.0

小红书(XHS/RED)自动化助手。完整的小红书操作能力,包含 MCP 服务端。 当用户提到小红书、红书、XHS、RED、发笔记、搜笔记、小红书运营等任何与小红书相关的操作时使用此技能。

0· 300· 2 versions· 1 current· 1 all-time· Updated 11h ago· MIT-0
bywezn@weznai

Install

openclaw skills install skill-xiaohongshu

小红书 MCP 技能

完整的小红书自动化技能,包含独立服务端,开箱即用。

快速开始

首次使用:

cd <技能目录>
npm install
npm run login  # 扫码登录

日常使用: 技能会自动启动服务,无需手动操作。

功能列表(13个工具)

工具说明参数
check_login_status检查登录状态
get_login_qrcode获取登录二维码
delete_cookies删除登录状态
list_feeds获取首页推荐
search_feeds搜索笔记keyword, filters?
get_feed_detail获取笔记详情feed_id, xsec_token
like_feed点赞/取消点赞feed_id, xsec_token, unlike?
favorite_feed收藏/取消收藏feed_id, xsec_token, unfavorite?
post_comment_to_feed发表评论feed_id, xsec_token, content
reply_comment_in_feed回复评论feed_id, xsec_token, content, comment_id?
user_profile获取用户主页user_id, xsec_token
publish_content发布图文title, content, images, tags?
publish_with_video发布视频title, content, video, tags?

使用方式

方式1:Node.js 直接调用(推荐)

import { searchFeeds, likeFeed, publishContent } from './scripts/xhs-tools.js';

// 搜索笔记
const results = await searchFeeds('咖啡');

// 点赞
if (results.feeds[0]) {
  await likeFeed(results.feeds[0].id, results.feeds[0].xsec_token);
}

// 发布图文
await publishContent({
  title: '我的笔记',
  content: '正文内容',
  images: ['./photo1.jpg'],
  tags: ['美食']
});

方式2:MCP 服务调用

服务默认运行在 http://localhost:18060/mcp

# 启动服务(通常自动启动)
npm start

# 通过 MCP Inspector 调试
npx @modelcontextprotocol/inspector http://localhost:18060/mcp

方式3:命令行快速操作

# 检查登录
node -e "import('./scripts/xhs-tools.js').then(m => m.checkLoginStatus()).then(console.log)"

# 搜索
node -e "import('./scripts/xhs-tools.js').then(m => m.searchFeeds('美食')).then(r => console.log(r.feeds.length))"

服务管理

检查服务状态:

node scripts/ensure-service.js status

启动服务:

node scripts/ensure-service.js start

停止服务:

node scripts/ensure-service.js stop

详细文档

注意事项

  1. 账号安全:同一账号不能在多个网页端登录
  2. 发布限制:每天最多 50 篇笔记
  3. 标题限制:最多 20 字
  4. 正文限制:最多 1000 字
  5. Cookie 有效期:建议每周重新登录一次

环境变量

变量说明默认值
XHS_PORT服务端口18060
XHS_HOST绑定地址0.0.0.0
XHS_PROXY代理地址-

使用代理:

XHS_PROXY=http://proxy:port npm start

Version tags

latestvk971x6sz79kppcd9bewsmrtrn182ynhw