xhs-login
xhs-login handles Xiaohongshu account access by checking login status, generating QR codes for mobile app authentication, and resetting sessions to switch accounts. The skill guides users through each step and handles timeouts by regenerating codes when needed.
xhs-login manages Xiaohongshu authentication through QR code scanning, status checks, and account switching.
AI-generated summary based on this skill's SKILL.md
Install
autoclaw-cc/xiaohongshu-mcp-skills/xhs-login
git clone https://github.com/autoclaw-cc/xiaohongshu-mcp-skills
cp -r xiaohongshu-mcp-skills/skills/xhs-login ~/.claude/skills/xhs-loginnpx skillfed install autoclaw-cc/xiaohongshu-mcp-skills/xhs-loginFrequently asked questions
AI-generated answers based on this skill's SKILL.md and metadata
How to login xiaohongshu using xhs-login?
xhs-login enables Xiaohongshu account access by generating a QR code for mobile app authentication. Launch the skill, scan the displayed QR code with your Xiaohongshu mobile app, and follow the on-screen prompts to complete login. The skill handles the authentication handshake and confirms when your session is active.
How do I check my login status in xhs-login?
xhs-login provides account status checking by verifying your current authentication state and displaying your account information. Use the status-check feature to confirm whether you're logged in, view your profile details, and see session validity. This helps you verify active sessions before performing account operations.
小红书切换账号 with xhs-login?
xhs-login supports account switching by resetting your login session and re-authenticating with a different account. The skill clears your current session state, generates a fresh QR code, and guides you through logging in with your alternate Xiaohongshu credentials on the mobile app.
What happens if my xhs-login QR code expires?
xhs-login automatically handles QR code timeouts by detecting expiration and regenerating a new code. If your scan attempt times out or the code becomes invalid, the skill prompts you to scan the newly generated QR code. This ensures continuous authentication without manual intervention.
Can xhs-login reset my login state?
xhs-login includes session reset functionality to clear your current authentication and prepare for re-authentication. This feature is useful when switching accounts or troubleshooting login issues. After reset, the skill generates a fresh QR code for you to scan and establish a new session.
SKILL.md
rendered from the published skill — quoted content, verbatim
执行流程
1. 检查登录状态
调用 check_login_status(无参数),返回是否已登录及用户名。
- 已登录 → 告知用户当前登录账号
- 未登录 → 进入步骤 2
2. 扫码登录
调用 get_login_qrcode(无参数)。MCP 工具返回两部分内容:
- 文本:超时提示(含截止时间)
- 图片:PNG 格式二维码(MCP image content type,Base64 编码)
展示二维码:MCP 返回的图片会通过客户端渲染给用户。如果客户端无法直接展示图片(如纯文本终端),则将 Base64 数据保存为临时 PNG 文件,告知用户文件路径让其手动打开:
# fallback: 保存二维码到临时文件
echo "<base64_data>" | base64 -d > /tmp/xhs-qrcode.png
open /tmp/xhs-qrcode.png # macOS
xdg-open /tmp/xhs-qrcode.png # Linux
提示用户: - 打开小红书 App 扫描二维码 - 二维码有效期有限,过期需重新获取
扫码完成后,调用 check_login_status 确认登录成功。
3. 重新登录 / 切换账号
当用户要求重新登录或切换账号时:
- 调用
delete_cookies(⚠️ 需用户确认)— 清除当前登录状态 - 调用
get_login_qrcode— 获取新二维码 - 引导用户扫码
约束
delete_cookies会清除登录状态,执行前必须确认- 登录需要用户手动用手机 App 扫码,无法自动完成
失败处理
| 场景 | 处理 |
|---|---|
| MCP 工具不可用 | 引导用户使用 /setup-xhs-mcp 完成部署和连接配置 |
| 二维码超时 | 重新调用 get_login_qrcode |
Read as markdown · JSON record · Browse the source repository
File tree — 1 file
skills/xhs-login/SKILL.md