Skip to main content

rednote-mcp

rednote-mcp 是一个面向 MCP 客户端使用者的小红书 MCP Server。它通过 Playwright 和小红书网页能力,提供登录、笔记发布、点赞收藏评论、内容爬取等能力。

你可以把它接入支持 MCP 的客户端,例如 Claude Code、Cline、MCP Inspector,或任何兼容 stdio 的 MCP 工具。

它能做什么

  • 登录小红书账号,手动扫码完成登录,自动保存登录态到本地
  • 登录态保存在 ~/.rednote-mcp/rednote_cookies.json,重启后无需重新登录
  • 搜索笔记、爬取笔记内容(标题、正文、图片/视频、标签、互动数据)
  • 爬取用户信息(昵称、简介、标签、互动数据)
  • 点赞、收藏、评论笔记
  • 关注用户
  • 发布图文笔记

当前项目实际注册了 9 个 MCP tools。

环境要求

  • Python 3.10 或更高版本
  • 可正常启动的 Chromium 浏览器环境
  • 能访问小红书网页

通过 uvx 使用(推荐)

无需手动安装,uvx 会自动处理。

Claude Code 配置

claude mcp add rednote -- uvx rednote-mcp

首次运行

首次运行会自动安装 Playwright Chromium(约需 1-2 分钟)。


快速开始

默认作为 stdio MCP Server 运行

默认启动方式是 stdio,适合 Claude Code 等 MCP 客户端以子进程方式拉起。

uvx rednote-mcp

快速调试

npx @modelcontextprotocol/inspector uvx rednote-mcp

⚠️ 注意: 请务必先使用 manualLogin 工具登录小红书后再使用其他工具!

MCP 客户端配置

Claude Code

claude mcp add rednote -- uvx rednote-mcp

Cline / JSON 配置

{
  "mcpServers": {
    "rednote-mcp": {
      "command": "uvx",
      "args": ["rednote-mcp"]
    }
  }
}

Tools 一览

账号登录

  • manualLogin:打开浏览器,手动完成小红书登录,关闭浏览器后自动保存登录态

笔记查询

  • searchNotes:按关键词搜索笔记,返回笔记 URL 列表(支持指定返回数量)
  • dumpNote:爬取指定笔记的完整内容,以 Markdown 格式返回(标题、正文、图片/视频、标签、互动数据、发布时间、IP 属地)

用户信息

  • dumpUser:爬取指定用户主页信息(昵称、简介、标签、互动数据)

互动操作

  • likeNote:点赞指定笔记
  • collectNote:收藏指定笔记
  • commentNote:评论指定笔记
  • followUser:关注指定用户

发布

  • publishText:发布图文笔记(支持图片 URL 列表、标题、正文、标签)

发布新版本到 PyPI

修改代码后,更新 pyproject.toml 中的版本号,然后:

# 安装构建工具(首次需要,指定官方源)
pip install hatch twine -i https://pypi.org/simple/

# 构建
hatch build

# 上传到 PyPI
# Username: __token__
# Password: 在 https://pypi.org/manage/account/ 的 API tokens 中创建
python -m twine upload dist/*

# 验证上传成功
uvx rednote-mcp==<新版本号> --help

注意:上传后 PyPI 同步约需 1-2 分钟,验证前稍等片刻。

使用建议

  • 使用其他工具前,请先通过 manualLogin 完成登录
  • 登录态保存在 ~/.rednote-mcp/,重启服务后无需重新登录
  • 首次启动会自动安装 Playwright/Chromium,启动超时建议适当放宽

Metadata

Release files for rednote-mcp 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rednote-mcp 0.0.2
File Size Uploaded Provenance
rednote_mcp-0.0.2.tar.gz 4.1 MB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for rednote-mcp 0.0.2
File Interpreter ABI Platform
rednote_mcp-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 4.1 MB

Release files / rednote_mcp-0.0.2.tar.gz

Download URL rednote_mcp-0.0.2.tar.gz
Size 4.1 MB
Tags Source
SHA-256 checksum
How to use checksums
aa6f97fe3277390bb0bf88062e7d3d3014ce910a7ca9f9964ad809af619b02b1
BLAKE2b-256 checksum
How to use checksums
2a9fb0b3b1b2df89b5df490eea58a0af2e84553960eb986d18d5b6df2e37af45
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / rednote_mcp-0.0.2-py3-none-any.whl

Download URL rednote_mcp-0.0.2-py3-none-any.whl
Size 28.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
85ba93d80f467a9de50aaff2c5487f6151eab9fc4f0e2a96423058ae244d1055
BLAKE2b-256 checksum
How to use checksums
e3a37a1e1dc9e505c817240bb4a358921e001ca2f8812feb8689dbad9639dfb6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Security for rednote-mcp 0.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page