xhs-mcp
Provides tools for searching notes, retrieving note content, fetching comments, and posting comments on Xiaohongshu (Little Red Book).
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@xhs-mcpsearch for 'summer outfit ideas' and list top 5 results"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
小红书MCP服务
特点
采用js逆向出x-s,x-t,直接请求http接口,无须笨重的playwright
搜索笔记
获取笔记内容
获取笔记的评论
发表评论

Related MCP server: Xiaohongshu API MCP Server
快速开始
1. 环境
node
python 3.12
uv (pip install uv)
2. 安装依赖
git clone git@github.com:jobsonlook/xhs-mcp.git
cd xhs-mcp
uv sync
3. 获取小红书的cookie
打开web小红书
登录后,获取cookie,将cookie配置到第4步的 XHS_COOKIE 环境变量中

4. 配置mcp server
{
"mcpServers": {
"xhs-mcp": {
"command": "uv",
"args": [
"--directory",
"/Users/xxx/xhs-mcp",
"run",
"main.py"
],
"env": {
"XHS_COOKIE": "xxxx"
}
}
}
}免责声明
本项目仅用于学习交流,禁止用于其他用途,任何涉及商业盈利目的均不得使用,否则风险自负。
Available Tools
6 toolscheck_cookieBInspect
检测cookie是否失效
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must disclose behavioral traits itself. It only says "check if cookie is invalid" but does not explain what the tool does beyond that (e.g., whether it is a read-only operation, what it returns, how it determines invalidity, or if it has side effects). The description carries a minimal burden but offers no 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.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single short sentence that is front-loaded and contains no extraneous words. It is appropriately concise for a zero-parameter tool, though it is minimal and could benefit from a bit more detail about the check outcome without breaking conciseness.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity (no parameters, no output schema), the description should at least explain what the result indicates or in what situations to expect it. The description only states the function, leaving the agent to guess what happens when the cookie is or isn't valid. The lack of return-value information is a significant gap because there is no output schema to fill in that detail.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has zero parameters, and schema description coverage is trivially 100%. Per the rubric, zero-parameter tools get a baseline score of 4. Since there are no parameters, the description cannot add parameter semantics, and no additional explanation is needed.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's function: "检测cookie是否失效" (check whether the cookie is invalid). This is a specific verb (check) and resource (cookie), and it is distinct from the sibling tools, which are all content-related operations (get comments, post comments, home feed, search notes, get note content). The purpose is unambiguous.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives, or any prerequisites. There is no mention of context that would trigger its use, such as before making authenticated requests. The only clue is the tool name and the sibling tools, but no explicit or implicit usage direction is provided.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_note_commentsCInspect
获取笔记评论,参数url要带上xsec_token
Args:
url: 笔记 url| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of disclosure. It mentions the xsec_token requirement but does not disclose any other behavioral aspects such as return format, pagination, or error conditions.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise, consisting of a single sentence plus an Args section. It is well-structured and to the point, with no unnecessary words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the simplicity of a one-parameter getter, the description covers the basic purpose and a key prerequisite. However, it lacks details about the response structure or error handling, and there is no output schema to compensate, leaving some gaps.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The description adds meaning to the url parameter by specifying that it must include xsec_token, which is not in the schema. However, it does not explain the format or provide examples, leaving room for interpretation.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states the tool's purpose clearly: '获取笔记评论' means 'get note comments', which is a specific verb+resource. It does not explicitly distinguish from siblings like get_note_content, but the name and action are unambiguous.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
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. The only usage note is the prerequisite that the url must include xsec_token, which is a technical requirement rather than a selection guideline.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_note_contentAInspect
获取笔记内容,参数url要带上xsec_token
Args:
url: 笔记 url
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden. It only notes the xsec_token requirement, omitting authentication needs (especially given sibling check_cookie), return format, and error behaviors. This is a significant transparency gap.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is highly concise, with no filler. It communicates the action and a critical parameter requirement in just a few words, earning full marks for succinctness.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a single-parameter tool with no output schema, the description is incomplete. It omits authentication requirements (relevant given sibling check_cookie), response structure, and edge cases. The xsec_token note is helpful but insufficient for reliable autonomous use.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The description adds crucial meaning to the parameter beyond the bare schema: it specifies that the url must contain xsec_token. Since schema coverage is 0%, this compensation is valuable, though it does not cover other potential parameter nuances.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool retrieves note content ('获取笔记内容'), using a specific verb and resource. It is distinguishable from siblings like get_note_comments, which focus on comments.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides a critical usage prerequisite: the URL must include xsec_token. However, it does not explicitly mention alternatives or when to choose this tool over siblings; usage context is implied rather than stated.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
home_feedBInspect
获取首页推荐笔记
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It does not mention whether authentication is required, whether the tool is read-only, what the response format is, or any rate limits or side effects. The single sentence offers no behavioral context beyond the basic action.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single short sentence with no wasted words. It is appropriately sized for the tool's simplicity and immediately front-loads the core function.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool has no output schema and no parameter schema, so the description must compensate by explaining what the response looks like or any operational context. It does not mention return value structure, pagination, or authentication requirements, leaving the agent with insufficient information to predict the tool's full behavior.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has no properties, and the description covers the tool's purpose. With 0 parameters, the description does not need to explain parameter semantics, so the baseline of 4 applies. It adds no parameter-specific information, but none is required.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description '获取首页推荐笔记' clearly states a specific action (获取/get) and resource (首页推荐笔记/homepage recommended notes). It distinguishes itself from siblings like search_notes and get_note_content by focusing on the home feed specifically, though it could be more explicit about returning a list of recommended notes.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives, no exclusions, and no context about prerequisites (e.g., authentication via check_cookie). It simply states the action without any usage direction.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
post_commentAInspect
发布评论到指定笔记
Args:
note_id: 笔记 note_id
comment: 要发布的评论内容
| Name | Required | Description | Default |
|---|---|---|---|
| comment | Yes | ||
| note_id | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must disclose behavioral traits. It indicates a write operation ('发布') but lacks details on auth requirements, rate limits, side effects, or error behavior. Minimal transparency but no contradictions.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise with a single purpose sentence and two parameter lines. There is no fluff; every element contributes to understanding the tool. It is front-loaded and easy to parse.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple two-parameter write tool, the description covers the basic action and arguments. However, it omits potential context like authentication (relevant given the check_cookie sibling), expected response, or error conditions. Adequate but with clear gaps.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With 0% schema description coverage, the description compensates by explaining both parameters: note_id as the target note and comment as the content to publish. This adds clear meaning beyond the bare schema names and types, though it could benefit from examples or constraints.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('发布评论' = post a comment) and the target resource ('指定笔记' = specified note). This distinguishes it from sibling tools that are primarily read-focused (get_note_comments, home_feed, search_notes) or authentication-related (check_cookie).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
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 such as authentication. While the action is implied, there is no explicit when/when-not or contextual advice.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_notesCInspect
根据关键词搜索笔记
Args:
keywords: 搜索关键词
| Name | Required | Description | Default |
|---|---|---|---|
| keywords | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries full behavioral disclosure burden, but it only says 'search' without detailing return format, pagination, or whether it searches title/content. This is a significant gap.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is short and front-loaded, but the Args repetition adds no value. It is appropriately sized but not information-dense.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple search tool, the description lacks information about search scope (e.g., title vs content) and result format, making it incomplete for an agent to confidently invoke.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema has zero description coverage, and the description merely restates 'keywords: search keyword', adding no new semantics beyond the parameter name.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action (search) and resource (notes) with a keyword criterion. It distinguishes itself from siblings like get_note_content and home_feed by the 'search' verb.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No usage context is provided. It does not mention when to prefer search_notes over home_feed or get_note_content, nor any prerequisites or alternatives.
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.
6 tool updates
v0.1.0- First observed
check_cookie - First observed
get_note_comments - First observed
get_note_content - First observed
home_feed - First observed
post_comment - First observed
search_notes
TDQS
Scored across 6 tools
Each tool targets a distinct resource and action: comments retrieval, comment posting, cookie validation, feed browsing, note search, and note content retrieval. No two tools overlap in purpose.
Names follow a consistent verb_noun pattern: get_note_comments, post_comment, check_cookie, search_notes, get_note_content. home_feed is the only slight deviation but still reads as a noun phrase and is predictable.
Six tools is well-scoped for a XiaoHongShu focused server, covering browsing, searching, reading content, and commenting without unnecessary bloat.
The core workflows are covered: read notes, search notes, view comments, post comments, and check session validity. Minor gap: no ability to update or delete comments, but this is not essential for typical consumption use cases.
Maintenance
Related MCP Connectors
XHS note/product search/detail, suggestions, comments/replies; PGY 20pts success, failures uncharged
Weibo hot search, post search/details, comments/replies, users, posts, transcript.
Public TikTok profiles, videos, comments and keyword search as JSON. No developer account.
Liepin job search and resume workflows backed by the official Liepin MCP server.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA server that enables access to Xiaohongshu (Little Red Book) content, allowing users to search for notes and retrieve content via URLs with authentication management and cookie persistence.52 npm7MIT
- FlicenseNot gradedqualityDmaintenanceA microservice that wraps Xiaohongshu (Little Red Book) API into a RESTful API server, enabling users to perform various operations on the platform such as retrieving notes, searching users and content, and accessing user information.18-
- FlicenseNot gradedqualityDmaintenanceEnables automated interaction with Xiaohongshu (Little Red Book) platform including searching posts, retrieving content and comments, and posting AI-generated comments with persistent login support.453-
- FlicenseNot gradedqualityDmaintenanceEnables automated interaction with Xiaohongshu (Little Red Book) to search for notes, retrieve content or comments, and post targeted smart comments. It utilizes Playwright to manage browser-based tasks such as secure login and automated engagement.124-