📦 小红书MCP补丁包 — 技能工具

v1.0.0

自动检测并修复小红书MCP部署常见问题,包括端口占用、cookie路径、服务状态及超时等待。

0· 396·2 当前·2 累计
tinadu-ai 头像by @tinadu-ai (NANA)·MIT-0
下载技能包
License
MIT-0
最后更新
2026/4/16
0
安全扫描
VirusTotal
可疑
查看报告
OpenClaw
可疑
medium confidence
Scripts largely match the stated goal of fixing MCP deployment issues, but there are several practical and security concerns (running binaries from /tmp, aggressive process kills, ambiguous cookie path usage) that make it unsafe to run blindly.
评估建议
Do not run these scripts blindly on a production system. Specific recommendations: - Inspect each script line-by-line before executing. Ensure COOKIE_SOURCE and other paths point to files you control. - Avoid running the one-click script as root or on a multi-user host. kill -9 and broad lsof|xargs patterns can terminate unrelated processes. - Do not start executables directly from /tmp unless you trust the binary. Prefer keeping the MCP binary in a controlled directory and verify its checksum/s...
详细分析 ▾
用途与能力
The name/description (MCP deployment fixes) align with the provided repair scripts (port release, cookie placement, waiting for Chrome, service check/start). Minor metadata inconsistency: registry metadata lists 'Homepage: none' while skill.json contains a homepage URL — this is likely a packaging/metadata mismatch but not itself dangerous.
指令范围
The SKILL.md scripts perform system-level actions: forcibly killing processes (kill -9), copying cookie files into multiple filesystem locations, and launching an executable from /tmp (nohup ./xiaohongshu-mcp-linux-amd64). Running executables from /tmp and launching whatever binary resides there can execute arbitrary code if an attacker or other user places a malicious binary in /tmp. The cookie script expects a source path but the example hardcodes COOKIE_SOURCE, creating potential for user error or accidental copying of sensitive files. The one-click script runs lsof|xargs kill -9 which can be destructive if misapplied. All of these are within the general scope of deployment repair, but they grant the operator-wide discretion and can have side effects; therefore caution is warranted.
安装机制
Instruction-only skill with no install spec and no code files—lowest install risk. The skill does expect common system tools (lsof, pgrep, curl, nohup) to exist but does not declare them as required; that's common for instruction-only patches but worth noting.
凭证需求
No environment variables, credentials, or config paths are requested. Scripts operate on local filesystem paths (/tmp, ~/.cache) and localhost. No external network endpoints are contacted beyond localhost. The required privileges (ability to kill processes, read/write files, start binaries) are typical for a deployment-fix script but should be granted deliberately.
持久化与权限
Skill is not always-enabled and does not request persistent privileges. It does not modify other skills or agent-wide configuration in the provided instructions.
安全有层次,运行前请审查代码。

License

MIT-0

可自由使用、修改和再分发,无需署名。

运行时依赖

无特殊依赖

版本

latestv1.0.02026/3/4

- 初始发布,提供小红书 MCP 常见部署问题的自动化修复脚本集。 - 修复端口占用、cookie 路径缺失、Chrome 安装卡住、服务状态异常等问题。 - 每个问题提供独立的 Bash 修复脚本及使用说明。 - 提供一键修复总脚本,实现端到端自动检测与修正。 - 适用于小红书 MCP 服务部署常见故障场景。

可疑

安装命令

点击复制
官方npx clawhub@latest install xiaohongshu-mcp-patch
镜像加速npx clawhub@latest install xiaohongshu-mcp-patch --registry https://cn.longxiaskill.com

技能文档

部署小红书 MCP 时常见问题的自动化修复方案。

问题一:端口被占用

问题描述:启动 MCP 服务时提示 bind: address already in use

自动修复代码

#!/bin/bash
# 检查并释放端口 18060

echo "检查端口 18060..." PID=$(lsof -ti:18060 2>/dev/null)

if [ -n "$PID" ]; then echo "发现占用进程: $PID,正在终止..." kill -9 $PID sleep 2 echo "进程已终止" else echo "端口空闲" fi

# 验证 if lsof -i :18060 >/dev/null 2>&1; then echo "错误:端口仍被占用" exit 1 else echo "端口已释放,可以启动服务" fi

使用方法

chmod +x fix-port.sh
./fix-port.sh

问题二:Cookie 路径问题

问题描述:MCP 服务找不到 cookies.json 文件

自动修复代码

#!/bin/bash
# 将 cookie 文件复制到所有可能的位置

COOKIE_SOURCE="/path/to/your/cookies.json"

echo "复制 cookie 文件到多个位置..."

# 创建目录 mkdir -p /tmp/cookies mkdir -p ~/.cache/rod/browser

# 复制到多个位置 cp "$COOKIE_SOURCE" /tmp/cookies.json cp "$COOKIE_SOURCE" /tmp/cookies/cookies.json cp "$COOKIE_SOURCE" ./cookies.json 2>/dev/null || true cp "$COOKIE_SOURCE" ~/.cache/rod/browser/cookies.json

echo "Cookie 文件已放置到:" find /tmp -name "cookies.json" 2>/dev/null find ~ -name "cookies.json" 2>/dev/null | head -5

使用方法

chmod +x fix-cookie.sh
./fix-cookie.sh /path/to/your/cookies.json

问题三:调用卡住/超时

问题描述:调用 MCP 工具时无响应,可能是 Chrome 下载中

自动修复代码

#!/bin/bash
# 等待 Chrome 下载完成

echo "等待 Chrome 下载完成..." LOG_FILE="/tmp/mcp.log"

for i in {1..120}; do if grep -q "Downloaded:" "$LOG_FILE" 2>/dev/null; then echo "✅ Chrome 下载完成" break fi if grep -q "Unzip:" "$LOG_FILE" 2>/dev/null; then echo "✅ Chrome 解压中..." break fi PROGRESS=$(grep "Progress:" "$LOG_FILE" 2>/dev/null | tail -1) if [ -n "$PROGRESS" ]; then echo "进度: $PROGRESS" fi sleep 5 done

echo "准备就绪"

使用方法

chmod +x wait-chrome.sh
./wait-chrome.sh

问题四:检查服务状态

问题描述:不确定 MCP 服务是否正常运行

自动修复代码

#!/bin/bash
# 检查并重启 MCP 服务

echo "检查 MCP 服务状态..."

# 检查进程 if pgrep -f "xiaohongshu-mcp" >/dev/null; then echo "服务正在运行" ps aux | grep xiaohongshu-mcp | grep -v grep else echo "服务未运行,正在启动..." cd /tmp nohup ./xiaohongshu-mcp-linux-amd64 >/tmp/mcp.log 2>&1 & sleep 3 if pgrep -f "xiaohongshu-mcp" >/dev/null; then echo "✅ 服务已启动" tail -3 /tmp/mcp.log else echo "❌ 启动失败" exit 1 fi fi

# 测试连接 echo "测试 MCP 连接..." SESSION=$(curl -s -N -D - -X POST http://localhost:18060/mcp \ -H "Content-Type: application/json" \ -H "Accept: application/json, text/event-stream" \ -d '{"jsonrpc":"2.0","method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}},"id":1}' 2>/dev/null | \ grep -i "Mcp-Session-Id" | awk '{print $2}' | tr -d '\r')

if [ -n "$SESSION" ]; then echo "✅ MCP 连接正常,Session: $SESSION" else echo "❌ MCP 连接失败" exit 1 fi

使用方法

chmod +x check-service.sh
./check-service.sh

一键修复脚本

#!/bin/bash
# 小红书 MCP 一键修复

echo "===== 小红书 MCP 补丁包 ====="

# 1. 修复端口 echo "[1/4] 检查端口..." lsof -ti:18060 | xargs kill -9 2>/dev/null sleep 1

# 2. 检查 cookie if [ -f "/tmp/cookies/cookies.json" ]; then echo "[2/4] Cookie 文件存在" else echo "[2/4] ⚠️ 缺少 cookie 文件,请手动放置" fi

# 3. 启动服务 echo "[3/4] 启动服务..." cd /tmp if pgrep -f "xiaohongshu-mcp" >/dev/null; then echo "服务已在运行" else nohup ./xiaohongshu-mcp-linux-amd64 >/tmp/mcp.log 2>&1 & sleep 3 echo "服务已启动" fi

# 4. 测试连接 echo "[4/4] 测试连接..." SESSION=$(curl -s -N -D - -X POST http://localhost:18060/mcp \ -H "Content-Type: application/json" \ -H "Accept: application/json, text/event-stream" \ -d '{"jsonrpc":"2.0","method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}},"id":1}' 2>/dev/null | \ grep -i "Mcp-Session-Id" | awk '{print $2}' | tr -d '\r')

if [ -n "$SESSION" ]; then echo "✅ 修复完成,MCP 正常工作" else echo "❌ 连接失败,请检查日志: tail -f /tmp/mcp.log" fi


参考

  • 小红书 MCP 项目:https://github.com/xpzouying/xiaohongshu-mcp
  • OpenClaw 文档:https://docs.openclaw.ai
数据来源ClawHub ↗ · 中文优化:龙虾技能库