Skip to main content
Glama

小红书 MCP Server

让 AI 助手搜索、浏览、发布小红书笔记

AGPL-3.0 Python 3.10+


✨ 功能

功能

MCP 工具

说明

🔍 搜索笔记

xhs_search(keyword, limit)

搜索小红书笔记,返回标题+链接

📖 获取笔记

xhs_get_note(url)

查看笔记详情、正文、评论

📤 发布笔记

xhs_publish(title, content, images)

发布图文笔记

🔑 扫码登录

xhs_login_qrcode()

获取二维码,手机扫码登录

检查登录

xhs_check_login()

检查当前登录状态

Related MCP server: Redbook-Search-Comment-MCP2.0

🚀 快速开始

# 1. 安装
pip install xhs-mcp-tool
playwright install chromium

# 2. 启动
python -m xiaohongshu_mcp.server

# 3. 配置到你的 MCP 客户端

扫码登录

# 启动后运行:
xhs_login_qrcode()  # 获取二维码 → 小红书 App 扫码
xhs_check_login()   # 确认已登录

🐳 Docker 部署

docker build -t xhs-mcp .
docker run -d -p 6789:6789 -v $HOME/.xiaohongshu_mcp:/data xhs-mcp

💰 定价

版本

价格

适用

🌟 个人版

免费 (AGPL-3.0)

个人开发者

💼 商业版

¥499

单项目商用

🏢 企业版

¥2999

无限项目 + 优先支持

📦 项目结构

xiaohongshu-mcp/
├── xiaohongshu_mcp/
│   ├── __init__.py
│   ├── server.py      # FastMCP 入口 + 工具定义
│   └── core.py        # Playwright 控制器
├── data/              # 存储目录(cookies、二维码)
├── pyproject.toml
└── README.md

🔗 相关项目

⭐ Star 支持

如果这个项目对你有帮助,欢迎 Star 支持!

Available Tools

8 tools
xhs_check_loginA

检查当前小红书登录状态

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.5/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, yet the description does not specify what the output indicates (e.g., returns a boolean or object with login state). Minimal behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single, efficient sentence with no wasted words. Front-loaded and to the point.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Output schema exists (not shown) so return value explanation is unnecessary, but the description lacks usage context and behavioral details, making it slightly incomplete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0 parameters and 100% schema coverage (empty schema), the description adds no param info, but none is needed. Baseline 4 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description '检查当前小红书登录状态' clearly states the verb (check) and resource (login status), distinguishing it from sibling tools like xhs_login_qrcode.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives. Could mention to verify login before actions requiring authentication, but it's absent.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

xhs_commentB

评论小红书笔记

Args: url: 笔记链接 text: 评论内容

ParametersJSON Schema
NameRequiredDescriptionDefault
urlYes
textYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description must disclose behavioral traits. It only states the basic action, omitting details like authentication needs, side effects, or rate limits. Output schema exists but is not described.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Description is very concise, with one line and an Args block. No unnecessary text, though structure could be improved (e.g., bullet points).

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Despite simple parameters and an output schema, the description lacks context on when to use, error handling, or requirement for login. Sibling tool xhs_check_login suggests auth is important but not mentioned here.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema has 0% description coverage; description adds Chinese labels ('笔记链接', '评论内容') which provide basic meaning beyond property names. However, no further details like format or constraints.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states the tool's action: '评论小红书笔记' (comment on Xiaohongshu note), which is a specific verb+resource. It is distinct from sibling tools like xhs_like (like) and xhs_publish (publish).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool vs alternatives. Does not mention prerequisites (e.g., login status) or conditions for use.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

xhs_get_noteB

获取小红书笔记详情及评论

Args: url: 笔记链接 (https://www.xiaohongshu.com/explore/{note_id})

ParametersJSON Schema
NameRequiredDescriptionDefault
urlYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

B3.3/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description bears full responsibility for behavioral disclosure. It only states a read operation but does not mention any side effects, auth requirements, rate limits, or error handling, leaving significant gaps for an agent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is short with the purpose stated first, followed by parameter details. It is efficient without unnecessary fluff, though the Args format could be slightly more streamlined.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the presence of an output schema, the description does not need to detail return values. It adequately explains the parameter but does not mention expected output structure (e.g., that it includes both note details and comments). This is minimally sufficient but leaves some uncertainty.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0% description coverage, but the tool description compensates by explicitly providing the URL format and an example, adding meaning that the schema alone lacks. This helps the agent correctly construct the parameter.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool fetches note details and comments from Xiaohongshu, using the verb '获取' (get) and specifying the resource. It is unambiguous but does not differentiate from sibling tools like xhs_search or xhs_user_profile.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides a concrete parameter example with URL format, aiding correct invocation. However, it lacks guidance on when to use this tool versus alternatives, such as when the user wants a specific note versus searching.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

xhs_likeC

点赞/取消点赞小红书笔记

Args: url: 笔记链接

ParametersJSON Schema
NameRequiredDescriptionDefault
urlYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It only states the action without disclosing whether login is required, idempotency, or side effects. Lacks behavioral detail.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is very short and front-loaded with the main action. It is concise, but the lack of detail on toggle behavior slightly reduces effectiveness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple tool with one parameter and an output schema, the description covers basic functionality. However, it lacks usage context and behavioral details, making it only adequate.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%. The description adds '笔记链接' (note link), clarifying the parameter's purpose. However, it does not specify expected format or constraints, providing minimal added value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb '点赞/取消点赞' (like/unlike) and the resource '小红书笔记' (Xiaohongshu notes), distinguishing it from sibling tools like comment or publish. However, it does not explicitly clarify the toggle nature.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives. For example, it does not explain when to use like vs unlike, or prerequisites like login.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

xhs_login_qrcodeA

获取小红书登录二维码(扫码登录)

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.5/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description should disclose behavior. It only says 'get QR code', leaving unclear if it returns a URL or image, and no mention of side effects (e.g., creating a session) or rate limits.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence, front-loaded, no wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Tool has no parameters and an output schema exists, but the description lacks context about the login flow (e.g., that this should be followed by polling xhs_check_login). Adequate but incomplete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

No parameters, so baseline is 4. The description adds value by clarifying the tool's purpose beyond the empty schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('get') and the resource ('Xiaohongshu login QR code'), distinguishing it from siblings like xhs_check_login which checks login status.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool (e.g., to initiate login) or that xhs_check_login should follow. No mention of prerequisites or alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

xhs_publishA

发布小红书图文笔记(需登录创作者平台)

Args: title: 笔记标题(不超过20字) content: 笔记正文(不超过1000字) images: 图片本地路径列表

ParametersJSON Schema
NameRequiredDescriptionDefault
titleYes
contentYes
imagesYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description discloses the requirement to be logged into the creator platform, which is a key behavioral constraint. There are no annotations to contradict, and the description adds context about the operation without being misleading.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise with three key sentences plus the Args section. No redundant information; every part contributes to understanding the tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description covers input parameters and a critical prerequisite. Although it does not detail return values, an output schema exists, so that is not required. It is sufficient for a standard publish tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Parameter descriptions add significant value beyond the schema: title must be ≤20 characters, content ≤1000 characters, and images must be local paths. This compensates for the 0% schema description coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb '发布' (publish) and the specific resource '小红书图文笔记' (Xiaohongshu image-text note). It distinguishes from sibling tools like xhs_comment or xhs_search, which have different purposes.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It mentions the prerequisite of login to the creator platform, which gives context. However, it does not provide explicit guidance on when to use this tool versus alternatives, nor does it exclude any conditions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

xhs_user_profileC

获取小红书用户主页信息

Args: user_id: 用户ID

ParametersJSON Schema
NameRequiredDescriptionDefault
user_idYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations exist, so the description carries full burden. It only states the basic function without disclosing behavioral traits such as authentication needs, rate limits, or data scope.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is very short, but it could be more informative while remaining concise. It is not overly verbose but lacks substance.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Despite having an output schema, the description lacks behavioral context, usage guidance, and parameter details, making it insufficient for a complete understanding.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description merely repeats the parameter name and type in an Args section, adding no meaning beyond the input schema (which has 0% coverage).

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb '获取' (get) and the resource '小红书用户主页信息' (Xiaohongshu user profile info), distinguishing it from sibling tools like xhs_get_note.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives, nor any prerequisites or context for usage.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 8 tool updatesv0.1.0
    • First observedxhs_check_login
    • First observedxhs_comment
    • First observedxhs_get_note
    • First observedxhs_like
    • First observedxhs_login_qrcode
    • First observedxhs_publish
    • First observedxhs_search
    • First observedxhs_user_profile

TDQS

A3.5/5.0

Scored across 8 tools

Disambiguation5/5

All tools have clearly distinct purposes: login checks, QR code login, note retrieval, commenting, liking, publishing, searching, and user profile. There is no functional overlap between any two tools.

Naming Consistency3/5

While all tools share the 'xhs_' prefix, the naming patterns vary: some are verb-only (e.g., xhs_comment, xhs_like), some verb_noun (e.g., xhs_check_login, xhs_get_note), and some noun_noun (e.g., xhs_login_qrcode, xhs_user_profile). This inconsistency may confuse agents slightly.

Tool Count5/5

With 8 tools, the server covers essential operations for interacting with Xiaohongshu without being overwhelming. Each tool serves a distinct purpose and contributes to a coherent workflow.

Completeness4/5

The tool set covers core actions like login, note retrieval, commenting, liking, publishing, searching, and profile access. Minor gaps exist, such as missing update/delete operations for notes and follow/unfollow actions, but the set is functional for common tasks.

Maintenance

ActivityInactive
ResponsivenessUnresponsive

Related MCP Connectors

Related MCP Servers

  • F
    license
    C
    quality
    Not graded
    maintenance
    A Model Context Protocol (MCP) server that enables AI assistants to search, retrieve, and analyze content from Xiaohongshu (Little Red Book), providing access to notes, user information, and trending topics.
    6
    1
    -
  • A
    license
    A
    quality
    D
    maintenance
    MCP server enabling AI assistants to search, analyze, and generate content for Xiaohongshu (RedNote), China's leading lifestyle social media platform.
    6
    9
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables automation of Xiaohongshu (Little Red Book) operations including content publishing, searching, and interacting, with MCP protocol support for AI agent integration.
    1
    MIT