Skip to main content
Glama
xhs-mcp

xhs-mcp

by blbl147

小红书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 

打开web小红书 登录后,获取cookie,将cookie配置到第4步的 XHS_COOKIE 环境变量中 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 tools
get_note_commentsCInspect

获取笔记评论,参数url要带上xsec_token

Args:
    url: 笔记 url

Inputs: url (required).

get_note_contentAInspect

获取笔记内容,参数url要带上xsec_token

Args:
    url: 笔记 url

Inputs: url (required).

home_feedBInspect

获取首页推荐笔记

Inputs: no named parameters.

post_commentAInspect

发布评论到指定笔记

Args:
    note_id: 笔记 note_id
    comment: 要发布的评论内容

Inputs: comment (required), note_id (required).

search_notesCInspect

根据关键词搜索笔记

    Args:
        keywords: 搜索关键词

Inputs: keywords (required).

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 6 tools

    Disambiguation5/5

    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.

    Naming Consistency5/5

    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.

    Tool Count5/5

    Six tools is well-scoped for a XiaoHongShu focused server, covering browsing, searching, reading content, and commenting without unnecessary bloat.

    Completeness4/5

    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

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      A 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.
      121 npm
      7
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables automated interaction with Xiaohongshu (Little Red Book) platform including searching posts, retrieving content and comments, and posting AI-generated comments with persistent login support.
      458
      -
    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables 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.
      131
      -