Sends push notifications to WeChat/App via Server酱 (方糖). Supports both Turbo (SCT) and SC3 variants, auto-detected by SendKey prefix. Includes Markdown body, tags, short, and channel parameters.
Ships in serverchan. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
通过 Server 酱把消息推送到微信/App。逻辑对齐 easychen/serverchan-sdk, 同时兼容 Server酱Turbo(SCT) 与 Server酱³(SC3),按 SendKey 前缀自动选择端点,无需额外配置:
sctp 开头 → SC3:https://<num>.push.ft07.com/send/<sendkey>.send(num 取自 sctp<num>t)SCT…)→ Turbo:https://sctapi.ftqq.com/<sendkey>.send本技能自包含,所有命令内联在本文件中,不依赖任何外部脚本文件——直接复制运行即可。
SERVERCHAN_SENDKEY——它会进入 stdout 被平台采集并展示。SendKey 等同推送凭证,泄露即可被他人冒发。-v/--verbose(端点 URL 内含 SendKey,会被打到日志)。下面的命令已用 -sS 并且不回显 URL。--data-urlencode 传 title/desp,转义交给 curl,无需手工拼接 JSON。if [ -z "${SERVERCHAN_SENDKEY:-}" ]; then
echo "[serverchan] ✗ 缺少环境变量 SERVERCHAN_SENDKEY,已停止。"
echo " 请在 Server 酱后台获取 SendKey 并加入当前项目环境变量 SERVERCHAN_SENDKEY:"
echo " · Server酱Turbo(SCT):https://sct.ftqq.com → SendKey 形如 SCTxxxxxx"
echo " · Server酱³(SC3) :https://sc3.ft07.com → SendKey 形如 sctp<数字>t<token>"
else
case "$SERVERCHAN_SENDKEY" in
sctp*) echo "[serverchan] ✓ SendKey 已配置(SC3 / sctp…,长度 ${#SERVERCHAN_SENDKEY})" ;;
SCT*) echo "[serverchan] ✓ SendKey 已配置(SCT / SCT…,长度 ${#SERVERCHAN_SENDKEY})" ;;
*) echo "[serverchan] ⚠ SendKey 已配置,但前缀既非 sctp(SC3) 也非 SCT(Turbo),请确认是否正确" ;;
esac
fi
若提示缺失,不要硬编码任何 SendKey,向用户索取后写入当前项目环境变量 SERVERCHAN_SENDKEY 再继续。
把 title、desp 换成你要推送的内容即可。端点会按 SendKey 前缀自动选择:
KEY="$SERVERCHAN_SENDKEY"
case "$KEY" in
sctp*)
NUM="$(printf '%s' "$KEY" | sed -n 's/^sctp\([0-9][0-9]*\)t.*/\1/p')"
URL="https://${NUM}.push.ft07.com/send/${KEY}.send" ;;
*)
URL="https://sctapi.ftqq.com/${KEY}.send" ;;
esac
curl -sS -X POST "$URL" \
--data-urlencode "title=部署完成" \
--data-urlencode "desp=服务已上线 ✅
版本 v1.2.3"
desp 支持 Markdown,多行直接写换行即可(上例正文含标题+空行+版本号)。{"code":0,...} 表示成功;code 非 0 或 HTTP 非 2xx 表示失败,按返回内容排查。Server 酱支持额外字段,追加 --data-urlencode 即可透传:
curl -sS -X POST "$URL" \
--data-urlencode "title=服务器告警" \
--data-urlencode "desp=CPU **95%**,请及时处理" \
--data-urlencode "tags=运维|告警" \
--data-urlencode "short=CPU 95%"
常用字段:tags(| 分隔多标签)、short(卡片摘要)、channel(指定通道)、noip(隐藏调用 IP)。
KEY="$SERVERCHAN_SENDKEY"
case "$KEY" in
sctp*) NUM="$(printf '%s' "$KEY" | sed -n 's/^sctp\([0-9][0-9]*\)t.*/\1/p')"; URL="https://${NUM}.push.ft07.com/send/${KEY}.send" ;;
*) URL="https://sctapi.ftqq.com/${KEY}.send" ;;
esac
if some_task; then
curl -sS -X POST "$URL" --data-urlencode "title=任务成功" --data-urlencode "desp=✅ 已完成于 $(date '+%F %T')" >/dev/null
else
curl -sS -X POST "$URL" --data-urlencode "title=任务失败" --data-urlencode "desp=❌ 请查看日志排查" --data-urlencode "short=任务失败" >/dev/null
fi
批量/高频场景:请把多条结果合并成一条摘要推送,尊重免费额度(每天有限),避免刷屏。
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/serverchan:serverchanfrom serverchan
npx claudepluginhub easychen/skills --plugin serverchanOther plugins' skills for the same job