post-to-xhs

post-to-xhs is a skill for Claude Code, Codex from xpzouying/xiaohongshu-mcp. It costs 96 tokens per session (2,232 once invoked), scanned A, original, Apache-2.0.

A publishing guide for 小红书, a Chinese social-media platform. It covers posting image-and-text content or a longer formatted article, using supplied content or a webpage.

In plain words
What is it for?
Use it to prepare and publish a short post with images, or a long article, from user-provided material or extracted webpage content.
Why use it?
It gives the posting process a defined format and handles basic title, language, spacing, and image requirements before publishing.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: names the AskUserQuestion tool.

Good fit Use it to prepare and publish a short post with images, or a long article, from user-provided material or extracted webpage content.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/xpzouying/xiaohongshu-mcp/post-to-xhs
About the project

xiaohongshu-mcp is an MCP server that lets AI assistants access and interact with Xiaohongshu, a social content platform. It supports tasks such as checking login status, searching content, and publishing image, text, and video posts. The catalogue includes a skill and instructions for using it.

xpzouying/xiaohongshu-mcp · 16,942 stars · on GitHub · haha.ai

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add xpzouying/xiaohongshu-mcp --skill post-to-xhs
Clone the repo
git clone --depth 1 https://github.com/xpzouying/xiaohongshu-mcp

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for post-to-xhs

README.md
[![agentmods](https://agentmods.dev/badge/skills/xpzouying/xiaohongshu-mcp/post-to-xhs/github.svg)](https://agentmods.dev/skills/xpzouying/xiaohongshu-mcp/post-to-xhs)
Your own site
<a href="https://agentmods.dev/skills/xpzouying/xiaohongshu-mcp/post-to-xhs"><img src="https://agentmods.dev/badge/skills/xpzouying/xiaohongshu-mcp/post-to-xhs/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for post-to-xhs

Your own site · 80×15
<a href="https://agentmods.dev/skills/xpzouying/xiaohongshu-mcp/post-to-xhs"><img src="https://agentmods.dev/badge/skills/xpzouying/xiaohongshu-mcp/post-to-xhs.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 96 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,232 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00096 $0.02232
Opus 5.5 $0.00038 $0.00893
Sonnet 5.5 $0.00019 $0.00446
Haiku 4.5 $0.00010 $0.00223

Measured 2mo ago against content hash 9e6eb054cff8, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

post-to-xhs scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

The scan reads SKILL.md. This mod also ships 5 executable files (scripts/account_manager.py, scripts/cdp_publish.py, scripts/chrome_launcher.py, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/post-to-xhs/SKILL.md · 252 lines

How it starts

The opening of the file, as written. The whole thing — 252 lines — stays where its author put it; the contents beside it link to each section on GitHub.

小红书内容发布

根据用户输入自动判断发布方式和发布模式,简化发布流程。

发布模式

  • 上传图文(默认):图片 + 短文,适合日常分享
  • 写长文:长篇文章 + 排版模板选择,适合深度内容。用户明确说"发长文"时使用

工作流程

用户输入
    │
    ├─ 完整内容 + 图片/图片URL → 判断模式 → 发布流程
    │
    └─ 网页 URL → WebFetch 提取内容和图片
                      │
                      ├─ 有图片 → 适当总结内容 → 判断模式 → 发布流程
                      │
                      └─ 无图片 → 提示用户手动下载图片
                                  │
                                  └─ 用户提供图片后 → 发布流程

Step 1: 判断输入类型

根据用户输入判断:

  • 完整内容模式:用户提供了标题、正文内容、以及图片(本地路径或URL)
  • URL 提取模式:用户只提供了一个网页 URL

如果不确定,询问用户。

Step 2: 处理内容

完整内容模式

直接使用用户提供的标题和正文,跳到 Step 3。

URL 提取模式

  1. 使用 WebFetch 提取网页内容
  2. 提取关键信息:标题、正文、图片URL
  3. 适当总结内容,保持:
    • 关键信息完整
    • 语言自然流畅
    • 适合小红书阅读习惯
图片提取失败处理

如果从网页中提取不到图片URL,或图片URL无法访问,必须:

  1. 告知用户图片提取失败
  2. 提供原网页链接,请用户手动访问
  3. 指导用户:
    • 在浏览器中打开原网页
    • 右键点击想要的图片 → "图片另存为" 或 "复制图片地址"
    • 将保存的图片路径或复制的图片URL提供给我
  4. 等待用户提供图片后再继续发布流程

示例提示语:

从网页中未能提取到可用的图片。请手动获取:

1. 打开原文链接:[URL]
2. 找到合适的配图,右键另存为本地,或复制图片地址
3. 将图片路径或URL发给我

拿到图片后我们继续发布。

Step 3: 内容检查

标题检查

标题长度必须 ≤ 38,计算规则:

  • 中文字符和中文标点(《》、,。等):每个计 2
  • 英文字母/数字/空格/ASCII标点:每个计 1

如果超长,自动生成符合长度要求的新标题,保持语义一致。

正文格式

  • 段落之间使用双换行分隔
  • 语言自然,避免机器翻译感
  • 简体中文

Step 4: 发布到小红书

完整发布流程参考: references/publish-workflow.md

4.1 用户确认内容

通过 AskUserQuestion 向用户展示即将发布的内容(标题、正文、图片),获得明确确认后再继续。

4.2 选择发布模式

通过 AskUserQuestion 让用户选择发布模式:

  • 无头模式(推荐):后台运行,速度快,无浏览器窗口。发布完成后直接报告结果。
  • 有窗口模式:显示浏览器窗口,可以预览内容。需要用户确认后再点击发布。
AskUserQuestion 示例:
问题:选择发布模式
选项:
  - 无头模式(推荐):后台快速发布,无需预览
  - 有窗口模式:显示浏览器,可预览确认

4.3 写入临时文件

将标题和正文写入临时 UTF-8 文本文件。不要在 python -c 中内联中文文本。

4.4 运行发布(根据模式分流)

A. 上传图文模式(默认)

根据用户选择的模式执行发布脚本:

无头模式(添加 --headless 参数):

python "C:\Users\admin\AI\.claude\skills\post-to-xhs\scripts\publish_pipeline.py" --headless --title-file title.txt --content-file content.txt --image-urls "URL1" "URL2"

有窗口模式(不添加 --headless):

python "C:\Users\admin\AI\.claude\skills\post-to-xhs\scripts\publish_pipeline.py" --title-file title.txt --content-file content.txt --image-urls "URL1" "URL2"

Read the full file on GitHub · 252 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago First seen · 252 lines · 96 tokens per session scan A 9e6eb054cff8

Subscribe to this mod's changes

post-to-xhs is a skill published in the GitHub repository xpzouying/xiaohongshu-mcp (16,942 stars, last pushed yesterday), licensed Apache-2.0. It adds 96 tokens to every session and 2,232 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

post-to-xhs compared with skills from other repositories

post-to-xhs next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
post-to-xhsxpzouying/xiaohongshu-mcpSkill17kyesterdayApache-2.0A96Claude Code, Codex
opik-diagnosecomet-ml/opik-mcpSkill2259d agoApache-2.0A187Claude Code
ue-mcp-epic-routingdb-lyon/ue-mcpSkill476yesterdayMITA81Claude Code, Codex
qa-knowledgegriddynamics/rosettaSkill370todayApache-2.0A32Claude Code, Codex
apitapn1byn1kt/apitapSkill13116d agoApache-2.0A0Claude Code, Codex
frontmcp-setupagentfront/frontmcpSkill148todayApache-2.0A176Claude Code, Codex
x-use-reviewihuzaifashoukat/x-useSkill1814d agoMITA56Claude Code