rednote-mcp 0.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,148 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[codz]
4
+ *$py.class
5
+ *.so
6
+ .Python
7
+ build/
8
+ develop-eggs/
9
+ dist/
10
+ downloads/
11
+ eggs/
12
+ .eggs/
13
+ lib/
14
+ lib64/
15
+ parts/
16
+ sdist/
17
+ var/
18
+ wheels/
19
+ share/python-wheels/
20
+ *.egg-info/
21
+ .installed.cfg
22
+ *.egg
23
+ MANIFEST
24
+
25
+ # PyInstaller
26
+ *.manifest
27
+ *.spec
28
+
29
+ # Installer logs
30
+ pip-log.txt
31
+ pip-delete-this-directory.txt
32
+
33
+ # Unit test / coverage reports
34
+ htmlcov/
35
+ .tox/
36
+ .nox/
37
+ .coverage
38
+ .coverage.*
39
+ .cache
40
+ nosetests.xml
41
+ coverage.xml
42
+ *.cover
43
+ *.py.cover
44
+ .hypothesis/
45
+ .pytest_cache/
46
+ cover/
47
+
48
+ # Translations
49
+ *.mo
50
+ *.pot
51
+
52
+ # Django
53
+ *.log
54
+ local_settings.py
55
+ db.sqlite3
56
+ db.sqlite3-journal
57
+
58
+ # Flask
59
+ instance/
60
+ .webassets-cache
61
+
62
+ # Scrapy
63
+ .scrapy
64
+
65
+ # Sphinx
66
+ docs/_build/
67
+
68
+ # PyBuilder
69
+ .pybuilder/
70
+ target/
71
+
72
+ # Jupyter Notebook
73
+ .ipynb_checkpoints
74
+
75
+ # IPython
76
+ profile_default/
77
+ ipython_config.py
78
+
79
+ # Virtual environments
80
+ .env
81
+ .envrc
82
+ .venv
83
+ env/
84
+ venv/
85
+ ENV/
86
+ env.bak/
87
+ venv.bak/
88
+
89
+ # Package managers
90
+ .pdm-python
91
+ .pdm-build/
92
+ .pixi
93
+ __pypackages__/
94
+
95
+ # Celery
96
+ celerybeat-schedule
97
+ celerybeat.pid
98
+
99
+ # SageMath
100
+ *.sage.py
101
+
102
+ # Type checkers
103
+ .mypy_cache/
104
+ .dmypy.json
105
+ dmypy.json
106
+ .pyre/
107
+ .pytype/
108
+ cython_debug/
109
+ .ruff_cache/
110
+
111
+ # Spyder / Rope
112
+ .spyderproject
113
+ .spyproject
114
+ .ropeproject
115
+
116
+ # mkdocs
117
+ /site
118
+
119
+ # Abstra
120
+ .abstra/
121
+
122
+ # Marimo
123
+ marimo/_static/
124
+ marimo/_lsp/
125
+ __marimo__/
126
+
127
+ # PyPI
128
+ .pypirc
129
+
130
+ # IDE
131
+ .idea/
132
+ .vscode/
133
+ *.swp
134
+ *.swo
135
+ *~
136
+
137
+ # Cursor
138
+ .cursorignore
139
+ .cursorindexingignore
140
+
141
+ # Project-specific
142
+ browser_data/
143
+ screenshots/
144
+ logs/
145
+
146
+ # OS
147
+ .DS_Store
148
+ Thumbs.db
@@ -0,0 +1,144 @@
1
+ Metadata-Version: 2.4
2
+ Name: rednote-mcp
3
+ Version: 0.0.1
4
+ Summary: Plus version of MCP server for accessing RedNote
5
+ Project-URL: Homepage, https://github.com/MrMao007/RedNote-MCP-Plus
6
+ Author-email: MrMao007 <mty1209@gmail.com>
7
+ Requires-Python: >=3.10
8
+ Requires-Dist: mcp[cli]>=1.0.0
9
+ Requires-Dist: playwright>=1.40.0
10
+ Requires-Dist: python-dotenv>=1.0.0
11
+ Description-Content-Type: text/markdown
12
+
13
+ # rednote-mcp
14
+
15
+ `rednote-mcp` 是一个面向 MCP 客户端使用者的小红书 MCP Server。它通过 Playwright 和小红书网页能力,提供登录、笔记发布、点赞收藏评论、内容爬取等能力。
16
+
17
+ 你可以把它接入支持 MCP 的客户端,例如 Claude Code、Cline、MCP Inspector,或任何兼容 `stdio` 的 MCP 工具。
18
+
19
+ ## 它能做什么
20
+
21
+ - 登录小红书账号,手动扫码完成登录,自动保存登录态到本地
22
+ - 登录态保存在 `~/.rednote-mcp/rednote_cookies.json`,重启后无需重新登录
23
+ - 搜索笔记、爬取笔记内容(标题、正文、图片/视频、标签、互动数据)
24
+ - 爬取用户信息(昵称、简介、标签、互动数据)
25
+ - 点赞、收藏、评论笔记
26
+ - 关注用户
27
+ - 发布图文笔记
28
+
29
+ 当前项目实际注册了 **9 个 MCP tools**。
30
+
31
+ ## 环境要求
32
+
33
+ - Python 3.10 或更高版本
34
+ - 可正常启动的 Chromium 浏览器环境
35
+ - 能访问小红书网页
36
+
37
+ ## 通过 uvx 使用(推荐)
38
+
39
+ 无需手动安装,uvx 会自动处理。
40
+
41
+ ### Claude Code 配置
42
+
43
+ ```bash
44
+ claude mcp add rednote -- uvx rednote-mcp
45
+ ```
46
+
47
+ ### 首次运行
48
+
49
+ 首次运行会自动安装 Playwright Chromium(约需 1-2 分钟)。
50
+
51
+ ---
52
+
53
+ ## 快速开始
54
+
55
+ ### 默认作为 `stdio` MCP Server 运行
56
+
57
+ 默认启动方式是 `stdio`,适合 Claude Code 等 MCP 客户端以子进程方式拉起。
58
+
59
+ ```sh
60
+ uvx rednote-mcp
61
+ ```
62
+
63
+ ### 快速调试
64
+
65
+ ```sh
66
+ npx @modelcontextprotocol/inspector uvx rednote-mcp
67
+ ```
68
+
69
+ > ⚠️ **注意:** 请务必先使用 `manualLogin` 工具登录小红书后再使用其他工具!
70
+
71
+ ## MCP 客户端配置
72
+
73
+ ### Claude Code
74
+
75
+ ```bash
76
+ claude mcp add rednote -- uvx rednote-mcp
77
+ ```
78
+
79
+ ### Cline / JSON 配置
80
+
81
+ ```json
82
+ {
83
+ "mcpServers": {
84
+ "rednote-mcp": {
85
+ "command": "uvx",
86
+ "args": ["rednote-mcp"]
87
+ }
88
+ }
89
+ }
90
+ ```
91
+
92
+ ## Tools 一览
93
+
94
+ ### 账号登录
95
+
96
+ - `manualLogin`:打开浏览器,手动完成小红书登录,关闭浏览器后自动保存登录态
97
+
98
+ ### 笔记查询
99
+
100
+ - `searchNotes`:按关键词搜索笔记,返回笔记 URL 列表(支持指定返回数量)
101
+ - `dumpNote`:爬取指定笔记的完整内容,以 Markdown 格式返回(标题、正文、图片/视频、标签、互动数据、发布时间、IP 属地)
102
+
103
+ ### 用户信息
104
+
105
+ - `dumpUser`:爬取指定用户主页信息(昵称、简介、标签、互动数据)
106
+
107
+ ### 互动操作
108
+
109
+ - `likeNote`:点赞指定笔记
110
+ - `collectNote`:收藏指定笔记
111
+ - `commentNote`:评论指定笔记
112
+ - `followUser`:关注指定用户
113
+
114
+ ### 发布
115
+
116
+ - `publishText`:发布图文笔记(支持图片 URL 列表、标题、正文、标签)
117
+
118
+ ## 发布新版本到 PyPI
119
+
120
+ 修改代码后,更新 `pyproject.toml` 中的版本号,然后:
121
+
122
+ ```sh
123
+ # 安装构建工具(首次需要,指定官方源)
124
+ pip install hatch twine -i https://pypi.org/simple/
125
+
126
+ # 构建
127
+ hatch build
128
+
129
+ # 上传到 PyPI
130
+ # Username: __token__
131
+ # Password: 在 https://pypi.org/manage/account/ 的 API tokens 中创建
132
+ python -m twine upload dist/*
133
+
134
+ # 验证上传成功
135
+ uvx rednote-mcp==<新版本号> --help
136
+ ```
137
+
138
+ > 注意:上传后 PyPI 同步约需 1-2 分钟,验证前稍等片刻。
139
+
140
+ ## 使用建议
141
+
142
+ - 使用其他工具前,请先通过 `manualLogin` 完成登录
143
+ - 登录态保存在 `~/.rednote-mcp/`,重启服务后无需重新登录
144
+ - 首次启动会自动安装 Playwright/Chromium,启动超时建议适当放宽
@@ -0,0 +1,132 @@
1
+ # rednote-mcp
2
+
3
+ `rednote-mcp` 是一个面向 MCP 客户端使用者的小红书 MCP Server。它通过 Playwright 和小红书网页能力,提供登录、笔记发布、点赞收藏评论、内容爬取等能力。
4
+
5
+ 你可以把它接入支持 MCP 的客户端,例如 Claude Code、Cline、MCP Inspector,或任何兼容 `stdio` 的 MCP 工具。
6
+
7
+ ## 它能做什么
8
+
9
+ - 登录小红书账号,手动扫码完成登录,自动保存登录态到本地
10
+ - 登录态保存在 `~/.rednote-mcp/rednote_cookies.json`,重启后无需重新登录
11
+ - 搜索笔记、爬取笔记内容(标题、正文、图片/视频、标签、互动数据)
12
+ - 爬取用户信息(昵称、简介、标签、互动数据)
13
+ - 点赞、收藏、评论笔记
14
+ - 关注用户
15
+ - 发布图文笔记
16
+
17
+ 当前项目实际注册了 **9 个 MCP tools**。
18
+
19
+ ## 环境要求
20
+
21
+ - Python 3.10 或更高版本
22
+ - 可正常启动的 Chromium 浏览器环境
23
+ - 能访问小红书网页
24
+
25
+ ## 通过 uvx 使用(推荐)
26
+
27
+ 无需手动安装,uvx 会自动处理。
28
+
29
+ ### Claude Code 配置
30
+
31
+ ```bash
32
+ claude mcp add rednote -- uvx rednote-mcp
33
+ ```
34
+
35
+ ### 首次运行
36
+
37
+ 首次运行会自动安装 Playwright Chromium(约需 1-2 分钟)。
38
+
39
+ ---
40
+
41
+ ## 快速开始
42
+
43
+ ### 默认作为 `stdio` MCP Server 运行
44
+
45
+ 默认启动方式是 `stdio`,适合 Claude Code 等 MCP 客户端以子进程方式拉起。
46
+
47
+ ```sh
48
+ uvx rednote-mcp
49
+ ```
50
+
51
+ ### 快速调试
52
+
53
+ ```sh
54
+ npx @modelcontextprotocol/inspector uvx rednote-mcp
55
+ ```
56
+
57
+ > ⚠️ **注意:** 请务必先使用 `manualLogin` 工具登录小红书后再使用其他工具!
58
+
59
+ ## MCP 客户端配置
60
+
61
+ ### Claude Code
62
+
63
+ ```bash
64
+ claude mcp add rednote -- uvx rednote-mcp
65
+ ```
66
+
67
+ ### Cline / JSON 配置
68
+
69
+ ```json
70
+ {
71
+ "mcpServers": {
72
+ "rednote-mcp": {
73
+ "command": "uvx",
74
+ "args": ["rednote-mcp"]
75
+ }
76
+ }
77
+ }
78
+ ```
79
+
80
+ ## Tools 一览
81
+
82
+ ### 账号登录
83
+
84
+ - `manualLogin`:打开浏览器,手动完成小红书登录,关闭浏览器后自动保存登录态
85
+
86
+ ### 笔记查询
87
+
88
+ - `searchNotes`:按关键词搜索笔记,返回笔记 URL 列表(支持指定返回数量)
89
+ - `dumpNote`:爬取指定笔记的完整内容,以 Markdown 格式返回(标题、正文、图片/视频、标签、互动数据、发布时间、IP 属地)
90
+
91
+ ### 用户信息
92
+
93
+ - `dumpUser`:爬取指定用户主页信息(昵称、简介、标签、互动数据)
94
+
95
+ ### 互动操作
96
+
97
+ - `likeNote`:点赞指定笔记
98
+ - `collectNote`:收藏指定笔记
99
+ - `commentNote`:评论指定笔记
100
+ - `followUser`:关注指定用户
101
+
102
+ ### 发布
103
+
104
+ - `publishText`:发布图文笔记(支持图片 URL 列表、标题、正文、标签)
105
+
106
+ ## 发布新版本到 PyPI
107
+
108
+ 修改代码后,更新 `pyproject.toml` 中的版本号,然后:
109
+
110
+ ```sh
111
+ # 安装构建工具(首次需要,指定官方源)
112
+ pip install hatch twine -i https://pypi.org/simple/
113
+
114
+ # 构建
115
+ hatch build
116
+
117
+ # 上传到 PyPI
118
+ # Username: __token__
119
+ # Password: 在 https://pypi.org/manage/account/ 的 API tokens 中创建
120
+ python -m twine upload dist/*
121
+
122
+ # 验证上传成功
123
+ uvx rednote-mcp==<新版本号> --help
124
+ ```
125
+
126
+ > 注意:上传后 PyPI 同步约需 1-2 分钟,验证前稍等片刻。
127
+
128
+ ## 使用建议
129
+
130
+ - 使用其他工具前,请先通过 `manualLogin` 完成登录
131
+ - 登录态保存在 `~/.rednote-mcp/`,重启服务后无需重新登录
132
+ - 首次启动会自动安装 Playwright/Chromium,启动超时建议适当放宽
@@ -0,0 +1,88 @@
1
+ # RedNote-MCP-Plus
2
+
3
+ <p align="center"><img src= "img/logo.png" width="600"/></p>
4
+
5
+ [![English](https://img.shields.io/badge/English-Click-yellow)](docs/README.en.md)
6
+ [![简体中文](https://img.shields.io/badge/简体中文-点击查看-orange)](README.md)
7
+ [![License](https://img.shields.io/badge/license-MIT-blue)](LICENSE)
8
+ [![PyPI version](https://badge.fury.io/py/rednote_mcp_plus.svg)](https://badge.fury.io/py/rednote_mcp_plus)
9
+
10
+ ⚙️ MCP server with a more comprehensive suite of tools for RedNote(XiaoHongShu, xhs).
11
+
12
+ ## Key Features
13
+ - Easy to Get Started: Experience the tool capabilities with just a few simple commands, no additional configuration required
14
+ - Automated Interaction Tools: Includes publishing, liking, bookmarking, commenting, following and other tools to facilitate automated account management
15
+ - Automated Scraping Tools: Includes search, note content scraping, user data scraping and other tools to facilitate content discovery
16
+
17
+ ## Tool List
18
+ - ✅ Login: Must use this tool to log in to RedNote before using other tools, saves login state
19
+ - ❤️ Like: Like any note
20
+ - 📥 Bookmark: Bookmark any note
21
+ - 💬 Comment: Comment on any note
22
+ - 👤 Follow: Follow any user
23
+ - 🖼️ Publish Note: Publish any image-text note
24
+ - 🔍 Search Notes: Search notes by keyword
25
+ - 📖 Note Content Scraping: Save any note in Markdown format
26
+ - 📊 User Data Scraping: Get user nickname, bio, tags, interaction information
27
+
28
+ ## Quick Start
29
+
30
+ If you want to quickly experience the tool capabilities, follow these steps:
31
+
32
+ ### Environment Setup
33
+ 1. Install uv:
34
+ ```bash
35
+ brew install uv
36
+ ```
37
+
38
+ 2. Install playwright:
39
+ ```bash
40
+ pip install playwright
41
+ playwright install
42
+ ```
43
+
44
+ 3. Install node:
45
+ ```bash
46
+ brew install node
47
+ ```
48
+
49
+ 4. Install RedNote MCP
50
+ ```bash
51
+ uv tool install rednote_mcp_plus
52
+ ```
53
+
54
+ ### Quick Trial
55
+
56
+ **Start MCP service debugging with one command!**
57
+ ```bash
58
+ npx @modelcontextprotocol/inspector uvx rednote_mcp_plus
59
+ ```
60
+
61
+ If everything goes well, you should now see all the tools listed as shown in the image, and you can try out any MCP tools you're interested in!
62
+
63
+ ![MCP Tools List](img/mcp_tools.png "MCP Tools List")
64
+
65
+ > ⚠️ **Note:** Please make sure to use the manualLogin tool to log in to RedNote first before trying other tools!
66
+
67
+ ### Demo
68
+
69
+ The image shows the results of getting note content, including title, author, images/videos, text content, tags, interaction data, publish time, publish location, and other data.
70
+
71
+ ![RedNote Note](img/note.png "RedNote Note")
72
+
73
+ ## MCP Server Configuration
74
+
75
+ Using Cline configuration as an example:
76
+
77
+ ```json
78
+ {
79
+ "mcpServers": {
80
+ "RedNote_MCP_Plus": {
81
+ "command": "uvx",
82
+ "args": [
83
+ "rednote_mcp_plus"
84
+ ]
85
+ }
86
+ }
87
+ }
88
+ ```
Binary file
Binary file
Binary file
@@ -0,0 +1,31 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "rednote-mcp"
7
+ dynamic = ["version"]
8
+ authors = [
9
+ {name = "MrMao007", email = "mty1209@gmail.com"}
10
+ ]
11
+ description = "Plus version of MCP server for accessing RedNote"
12
+ readme = "README.md"
13
+ requires-python = ">=3.10"
14
+ dependencies = [
15
+ "mcp[cli]>=1.0.0",
16
+ "playwright>=1.40.0",
17
+ "python-dotenv>=1.0.0",
18
+ ]
19
+
20
+ [project.scripts]
21
+ rednote_mcp = "rednote_mcp_plus:main"
22
+
23
+ [project.urls]
24
+ Homepage = "https://github.com/MrMao007/RedNote-MCP-Plus"
25
+
26
+ [tool.hatch.version]
27
+ path = "src/rednote_mcp_plus/__init__.py"
28
+ validate-bump = false
29
+
30
+ [tool.hatch.build.targets.wheel]
31
+ packages = ["src/rednote_mcp_plus"]
@@ -0,0 +1,45 @@
1
+ # 5s见证一张神图的诞生
2
+
3
+ <div align="center">
4
+ <img src="https://sns-avatar-qc.xhscdn.com/avatar/1040g2jo31r9lf4sa74005oup8jh9i8aohkafpoo" width="50" style="border-radius: 50%;" />
5
+
6
+ **Turner特讷**
7
+ </div>
8
+
9
+ ## 🎬 视频
10
+
11
+ <div style="position: relative; width: 100%; padding-top: 56.25%;">
12
+ <iframe
13
+ src="http://sns-video-qc.xhscdn.com/stream/1/110/259/01e9650db30723c8010370039bb2bfe547_259.mp4?sign=4202ed58b480ba3eadca83412daca940&t=6973dd78"
14
+ style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"
15
+ scrolling="no"
16
+ border="0"
17
+ frameborder="no"
18
+ allowfullscreen="true">
19
+ </iframe>
20
+ </div>
21
+
22
+
23
+
24
+ ## 📝 正文
25
+
26
+ #一张封神[话题]#
27
+ #神图[话题]#
28
+ #神图主理人[话题]#
29
+
30
+ ## 🏷️ 标签
31
+
32
+ `#一张封神` `#神图` `#神图主理人`
33
+
34
+ ## 📊 互动数据
35
+
36
+ | 👍 点赞 | ⭐ 收藏 | 💬 评论 | 🔗 分享 |
37
+ |:---:|:---:|:---:|:---:|
38
+ | 19 | 4 | 0 | 5 |
39
+
40
+ ## ℹ️ 其他信息
41
+
42
+ - **发布时间**:2026-01-12 23:07:53
43
+ - **更新时间**:2026-01-12 23:10:51
44
+ - **IP 属地**:浙江
45
+ - **内容类型**:📹 视频