xhs-mcp: Instructions file for Claude Code

CLAUDE.md

xhs-mcp CLAUDE.md is an instructions file for Claude Code from ShunL12324/xhs-mcp. It costs 4,400 tokens per session, scanned A, original, MIT.

An MCP server for Xiaohongshu, also known as Little Red Book or RedNote, a Chinese social-media platform. It uses browser automation to interact with the site and supports multiple accounts.

In plain words
What is it for?
Use it for account management, browsing or selecting notes, generating comments, publishing images, and handling downloaded media.
Why use it?
It gives coding agents a structured way to work with the platform instead of requiring every action to be performed manually in a browser.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md.

This is ShunL12324/xhs-mcp's own configuration. It tells Claude Code how to work on xhs-mcp itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything xhs-mcp configures →

Reuse

Borrowing it

Nothing to install: this file belongs to ShunL12324/xhs-mcp. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/ShunL12324/xhs-mcp/master/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/ShunL12324/xhs-mcp

Made for: Claude Code.

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 xhs-mcp CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/shunl12324/xhs-mcp/claude-md/github.svg)](https://agentmods.dev/instructions/shunl12324/xhs-mcp/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/shunl12324/xhs-mcp/claude-md"><img src="https://agentmods.dev/badge/instructions/shunl12324/xhs-mcp/claude-md/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 xhs-mcp CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/shunl12324/xhs-mcp/claude-md"><img src="https://agentmods.dev/badge/instructions/shunl12324/xhs-mcp/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 4,400 This file is loaded in full into every session.
When invoked 4,400 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.04400 $0.04400
Opus 5 $0.02200 $0.02200
Sonnet 5 $0.00880 $0.00880
Haiku 4.5 $0.00440 $0.00440

Measured 10d ago against content hash b2525c03dee4, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

xhs-mcp CLAUDE.md 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 10d ago.

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.

CLAUDE.md · 372 lines

How it starts

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

Xiaohongshu MCP Server

Project Overview

A Model Context Protocol (MCP) server that provides tools for interacting with Xiaohongshu (小红书/RedNote). Uses Playwright for browser automation. Version 2.0 adds multi-account support with SQLite database storage.

Tech Stack

  • Runtime: Bun (also compatible with Node.js)
  • Language: TypeScript (ESNext, strict mode)
  • Browser Automation: Playwright
  • HTTP Framework: Hono (for HTTP transport mode)
  • Database: SQLite (better-sqlite3)
  • MCP: @modelcontextprotocol/sdk
  • Validation: Zod v4

Project Structure

~/.xhs-mcp/                   # Data directory
├── data.db                   # SQLite database (accounts, logs, etc.)
├── logs/                     # Log files
│   └── xhs-mcp.log           # Application log
├── prompts/                  # Account prompt files (new in v2.5)
│   └── {accountName}_{accountId}/
│       ├── persona.txt       # Character definition
│       ├── select.txt        # Note selection prompt
│       └── comment.txt       # Comment generation prompt
├── temp/                     # Temporary files
│   └── images/               # Downloaded HTTP images for publishing
└── downloads/
    ├── images/{noteId}/
    └── videos/{noteId}/

src/
├── index.ts                  # Entry point with stdio/http mode switch
├── server.ts                 # MCP Server configuration and tool registration
├── http-server.ts            # HTTP transport server (StreamableHTTP)
├── core/
│   ├── config.ts             # Unified configuration with environment variables
│   ├── paths.ts              # Path utilities (re-exports from config)
│   ├── logger.ts             # Structured logging (console + file)
│   ├── account-pool.ts       # Multi-account client pool (池化管理)
│   ├── account-lock.ts       # Concurrent access prevention (互斥锁)
│   ├── multi-account.ts      # Multi-account operation helpers (并行/串行执行)
│   ├── login-session.ts      # Multi-step login session manager
│   ├── gemini.ts             # Gemini AI integration (image generation, etc.)
│   ├── explore-ai.ts         # AI decision module for explore (note selection, comment generation)
│   ├── prompt-manager.ts     # Prompt file management (read/write/render with LiquidJS)
│   ├── image-upload.ts       # Image upload utilities
│   ├── qrcode-utils.ts       # QR code generation and display utilities
│   └── prompts/              # AI prompt templates
│       └── defaults.ts       # Default prompt templates (persona, select, comment)
├── db/
│   ├── index.ts              # XhsDatabase class (组合所有 Repository)
│   ├── schema.ts             # Table definitions
│   └── repos/                # Repository 模式 - 按实体分离数据访问
│       ├── index.ts          # Repository 导出
│       ├── accounts.ts       # AccountRepository - 账户 CRUD
│       ├── profiles.ts       # ProfileRepository - 用户资料
│       ├── operations.ts     # OperationRepository - 操作日志
│       ├── published.ts      # PublishedRepository - 发布记录
│       ├── interactions.ts   # InteractionRepository - 互动记录
│       ├── downloads.ts      # DownloadRepository - 下载记录
│       ├── config.ts         # ConfigRepository - 配置键值对
│       ├── my-notes.ts       # MyNotesRepository - 我的已发布笔记缓存
│       └── explore.ts        # ExploreRepository - 探索会话和日志
├── tools/
│   ├── account.ts            # xhs_list_accounts, xhs_add_account, xhs_check_login_session, xhs_remove_account, xhs_set_account_config, xhs_get/set_account_prompt
│   ├── auth.ts               # xhs_check_auth_status (+account parameter, syncs profile)
│   ├── content.ts            # xhs_search, xhs_get_note, xhs_user_profile, xhs_list_feeds (+account parameter)
│   ├── publish.ts            # xhs_publish_content, xhs_publish_video (+account/accounts parameter)
│   ├── interaction.ts        # xhs_like_feed, xhs_favorite_feed, xhs_post_comment, xhs_reply_comment, xhs_like_comment, xhs_delete_cookies (+account/accounts)
│   ├── stats.ts              # xhs_get_account_stats, xhs_get_operation_logs
│   ├── download.ts           # xhs_download_images, xhs_download_video
│   ├── draft.ts              # xhs_create_draft, xhs_list_drafts, xhs_publish_draft, etc.
│   ├── creator.ts            # xhs_get_my_notes, xhs_query_my_notes
│   ├── notification.ts       # xhs_get_notifications
│   └── explore.ts            # xhs_explore (自动浏览)
└── xhs/
    ├── index.ts              # XhsClient facade class (supports account options)
    ├── types.ts              # TypeScript interfaces
    ├── clients/
    │   ├── browser.ts        # BrowserClient - Facade 组合所有服务
    │   ├── context.ts        # BrowserContextManager - 共享浏览器上下文
    │   ├── constants.ts      # 常量定义 (TIMEOUTS, DELAYS, SCROLL_CONFIG)
    │   └── services/         # 组合模式 - 按功能分离服务
    │       ├── index.ts      # 服务导出
    │       ├── auth.ts       # AuthService - 登录认证
    │       ├── search.ts     # SearchService - 搜索功能
    │       ├── content.ts    # ContentService - 内容获取
    │       ├── publish.ts    # PublishService - 发布功能
    │       ├── interact.ts   # InteractService - 互动功能
    │       ├── creator.ts    # CreatorService - 创作者中心
    │       ├── notification.ts # NotificationService - 通知获取
    │       └── explore.ts    # ExploreService - 自动浏览
    └── utils/
        ├── index.ts          # Utilities (sleep, humanScroll, generateWebId)
        └── stealth.js        # Browser automation script

Read the full file on GitHub · 372 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. 10d ago First seen · 372 lines · 4,400 tokens per session scan A b2525c03dee4

Subscribe to this mod's changes

xhs-mcp CLAUDE.md is an instructions file published in the GitHub repository ShunL12324/xhs-mcp (46 stars, last pushed 6mo ago), licensed MIT. It adds 4,400 tokens to every session, about $0.0220 per session on Opus 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

Other instructions, from other repositories

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,296 tokens

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,153 tokens

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens

spec-kit AGENTS.md

AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.

github/spec-kit · 7,104 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,469 tokens