xhs-login

Original🇨🇳 Chinese
Translated

Manage Xiaohongshu login status: Check login status, QR code login, reset login to switch accounts. Use this when the user mentions login, QR code scanning, account, account switching, logout, login status check, or when other skills report "not logged in" requiring prior login.

12installs
Added on

NPX Install

npx skill4agent add autoclaw-cc/xiaohongshu-mcp-skills xhs-login

SKILL.md Content (Chinese)

View Translation Comparison →

Execution Flow

1. Check Login Status

Call
check_login_status
(no parameters), which returns whether the user is logged in and the username.
  • Logged in → Inform the user of the currently logged-in account
  • Not logged in → Proceed to Step 2

2. QR Code Login

Call
get_login_qrcode
(no parameters). The MCP tool returns two parts:
  • Text: Timeout prompt (including deadline)
  • Image: PNG format QR code (MCP image content type, Base64 encoded)
Display QR Code: The image returned by MCP will be rendered to the user via the client. If the client cannot directly display images (such as a plain text terminal), save the Base64 data as a temporary PNG file and inform the user of the file path to open manually:
bash
# fallback: 保存二维码到临时文件
echo "<base64_data>" | base64 -d > /tmp/xhs-qrcode.png
open /tmp/xhs-qrcode.png   # macOS
xdg-open /tmp/xhs-qrcode.png  # Linux
Prompt the user:
  • Open the Xiaohongshu App to scan the QR code
  • The QR code has a limited validity period; re-obtain it if it expires
After scanning, call
check_login_status
to confirm successful login.

3. Re-login / Switch Accounts

When the user requests re-login or account switching:
  1. Call
    delete_cookies
    (⚠️ User confirmation required) — Clear current login status
  2. Call
    get_login_qrcode
    — Obtain new QR code
  3. Guide the user to scan the code

Constraints

  • delete_cookies
    will clear the login status; must confirm with the user before execution
  • Login requires manual QR code scanning via the mobile App; cannot be completed automatically

Failure Handling

ScenarioHandling
MCP tool unavailableGuide the user to use
/setup-xhs-mcp
to complete deployment and connection configuration
QR code expiredRe-call
get_login_qrcode