Skip to main content

An MCP server that enables LLMs to analyze, understand, and generate RedNote (小红书) content through structured tools and prompts.

Project description

RedNote Analyzer MCP

PyPI version Python 3.11+ License: MIT

让 AI 助手能够搜索、分析、生成小红书内容的 MCP 服务器。

English | 中文


先决条件

  • Python 3.11+
  • pipxuv
  • Chromium 浏览器(安装后会自动下载)

安装

第一步:安装

pipx install "rednote-analyzer-mcp[browser]"
playwright install chromium

第二步:登录小红书(必须)

rednote-login

浏览器会打开小红书,扫码或手机号登录,登录成功后自动保存 Cookie。

⚠️ 不登录直接用会返回空结果!

第三步:配置 AI 工具

选择你用的工具:

Claude Code

在项目根目录创建 .mcp.json 文件:

{
  "mcpServers": {
    "rednote-analyzer-mcp": {
      "command": "uvx",
      "args": ["rednote-analyzer-mcp[browser]"],
      "env": {
        "REDNOTE_ADAPTER": "playwright",
        "REDNOTE_HEADLESS": "true"
      }
    }
  }
}

或者用命令添加:

# 添加到当前项目
claude mcp add rednote-analyzer-mcp -s local \
  -e REDNOTE_ADAPTER=playwright \
  -e REDNOTE_HEADLESS=true \
  -- uvx "rednote-analyzer-mcp[browser]"

# 添加到全局(所有项目可用)
claude mcp add rednote-analyzer-mcp -s user \
  -e REDNOTE_ADAPTER=playwright \
  -e REDNOTE_HEADLESS=true \
  -- uvx "rednote-analyzer-mcp[browser]"

Claude Desktop

编辑 claude_desktop_config.json

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "rednote-analyzer-mcp": {
      "command": "uvx",
      "args": ["rednote-analyzer-mcp[browser]"],
      "env": {
        "REDNOTE_ADAPTER": "playwright",
        "REDNOTE_HEADLESS": "true"
      }
    }
  }
}

Cursor

创建 .cursor/mcp.json(项目级)或 ~/.cursor/mcp.json(全局):

{
  "mcpServers": {
    "rednote-analyzer-mcp": {
      "command": "uvx",
      "args": ["rednote-analyzer-mcp[browser]"],
      "env": {
        "REDNOTE_ADAPTER": "playwright",
        "REDNOTE_HEADLESS": "true"
      }
    }
  }
}

VS Code (GitHub Copilot)

创建 .vscode/mcp.json

{
  "servers": {
    "rednote-analyzer-mcp": {
      "command": "uvx",
      "args": ["rednote-analyzer-mcp[browser]"],
      "env": {
        "REDNOTE_ADAPTER": "playwright",
        "REDNOTE_HEADLESS": "true"
      }
    }
  }
}

Windsurf

编辑 ~/.codeium/mcp_config.json

{
  "mcpServers": {
    "rednote-analyzer-mcp": {
      "command": "uvx",
      "args": ["rednote-analyzer-mcp[browser]"],
      "env": {
        "REDNOTE_ADAPTER": "playwright",
        "REDNOTE_HEADLESS": "true"
      }
    }
  }
}

其他工具

通用配置模式:

配置项
command uvx
args ["rednote-analyzer-mcp[browser]"]
env {"REDNOTE_ADAPTER": "playwright", "REDNOTE_HEADLESS": "true"}

使用

配置完成后,直接跟 AI 对话:

"搜索小红书上关于美股的热门笔记"

"分析这些笔记的爆款规律"

"帮我写一篇关于基金定投的小红书文案"

"把这段文字改写成小红书风格"


工具列表

工具 功能
rednote_search_notes 搜索笔记
rednote_get_note_detail 获取笔记详情和评论
rednote_analyze_note 分析笔记结构和爆款元素
rednote_extract_patterns 批量分析,提取规律
rednote_generate_post 生成帖子大纲
rednote_rewrite_in_style 改写为小红书风格

常见问题

Q: 怎么更新?

pipx upgrade rednote-analyzer-mcp

Q: 搜索返回空结果?

A: 没有登录。运行 rednote-login 登录一次。

Q: Cookie 过期了?

A: 重新运行 rednote-login

Q: 怎么查看 MCP 是否连接成功?

A: Claude Code 运行 claude mcp list,其他工具看各自的 MCP 状态面板。


License

MIT | 开发指南


English

Prerequisites

  • Python 3.11+
  • pipx or uv
  • Chromium browser (auto-downloaded during install)

Installation

Step 1: Install

pipx install "rednote-analyzer-mcp[browser]"
playwright install chromium

Step 2: Log in to Xiaohongshu (required)

rednote-login

A browser will open. Log in with your phone number or scan QR code. Cookies are saved automatically after login.

⚠️ Skipping login will result in empty search results!

Step 3: Configure your AI tool

Choose your tool:

Claude Code

Create .mcp.json in your project root:

{
  "mcpServers": {
    "rednote-analyzer-mcp": {
      "command": "uvx",
      "args": ["rednote-analyzer-mcp[browser]"],
      "env": {
        "REDNOTE_ADAPTER": "playwright",
        "REDNOTE_HEADLESS": "true"
      }
    }
  }
}

Or use CLI:

# Add to current project
claude mcp add rednote-analyzer-mcp -s local \
  -e REDNOTE_ADAPTER=playwright \
  -e REDNOTE_HEADLESS=true \
  -- uvx "rednote-analyzer-mcp[browser]"

# Add globally (all projects)
claude mcp add rednote-analyzer-mcp -s user \
  -e REDNOTE_ADAPTER=playwright \
  -e REDNOTE_HEADLESS=true \
  -- uvx "rednote-analyzer-mcp[browser]"

Claude Desktop

Edit claude_desktop_config.json:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "rednote-analyzer-mcp": {
      "command": "uvx",
      "args": ["rednote-analyzer-mcp[browser]"],
      "env": {
        "REDNOTE_ADAPTER": "playwright",
        "REDNOTE_HEADLESS": "true"
      }
    }
  }
}

Cursor

Create .cursor/mcp.json (project) or ~/.cursor/mcp.json (global):

{
  "mcpServers": {
    "rednote-analyzer-mcp": {
      "command": "uvx",
      "args": ["rednote-analyzer-mcp[browser]"],
      "env": {
        "REDNOTE_ADAPTER": "playwright",
        "REDNOTE_HEADLESS": "true"
      }
    }
  }
}

VS Code (GitHub Copilot)

Create .vscode/mcp.json:

{
  "servers": {
    "rednote-analyzer-mcp": {
      "command": "uvx",
      "args": ["rednote-analyzer-mcp[browser]"],
      "env": {
        "REDNOTE_ADAPTER": "playwright",
        "REDNOTE_HEADLESS": "true"
      }
    }
  }
}

Windsurf

Edit ~/.codeium/mcp_config.json:

{
  "mcpServers": {
    "rednote-analyzer-mcp": {
      "command": "uvx",
      "args": ["rednote-analyzer-mcp[browser]"],
      "env": {
        "REDNOTE_ADAPTER": "playwright",
        "REDNOTE_HEADLESS": "true"
      }
    }
  }
}

Other Tools

General config pattern:

Key Value
command uvx
args ["rednote-analyzer-mcp[browser]"]
env {"REDNOTE_ADAPTER": "playwright", "REDNOTE_HEADLESS": "true"}

Usage

After setup, talk to your AI:

"Search for trending posts about US stocks (美股) on RedNote"

"Analyze the viral patterns of these notes"

"Help me write a RedNote post about ETF investing"

"Rewrite this text in RedNote style"


Tools

Tool Function
rednote_search_notes Search notes
rednote_get_note_detail Get note details and comments
rednote_analyze_note Analyze note structure and viral elements
rednote_extract_patterns Batch analyze, extract patterns
rednote_generate_post Generate post outline
rednote_rewrite_in_style Rewrite in RedNote style

FAQ

Q: How to update?

pipx upgrade rednote-analyzer-mcp

Q: Search returns empty results?

A: You haven't logged in. Run rednote-login to log in.

Q: Cookie expired?

A: Run rednote-login again.

Q: How to check if MCP is connected?

A: Claude Code: run claude mcp list. Other tools: check their MCP status panel.


License

MIT | Contributing

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rednote_analyzer_mcp-0.1.2.tar.gz (29.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rednote_analyzer_mcp-0.1.2-py3-none-any.whl (37.0 kB view details)

Uploaded Python 3

File details

Details for the file rednote_analyzer_mcp-0.1.2.tar.gz.

File metadata

  • Download URL: rednote_analyzer_mcp-0.1.2.tar.gz
  • Upload date:
  • Size: 29.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.1 CPython/3.13.2 Darwin/24.6.0

File hashes

Hashes for rednote_analyzer_mcp-0.1.2.tar.gz
Algorithm Hash digest
SHA256 af8b4403a90f2abc1d2ba807122c721fa27b4b176b9164d686e66f9cfb2c19bb
MD5 02d17a0ee59f3140d7868da97ff41b04
BLAKE2b-256 e1befd4303a3279500d1335b51e59073d6fea929a4ad7557f65ada58783c92d9

See more details on using hashes here.

File details

Details for the file rednote_analyzer_mcp-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for rednote_analyzer_mcp-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5afdbf9f38d75a6d6d7bdb2a8d99a9e6a86f4453bd2d2061ae9dbd4188516fb3
MD5 bc3a0bcf97511d153ac441f2accc674e
BLAKE2b-256 d2e6d69e770810c959531df7c27c1d2de008215c67eab8aeb383675c2ff7404e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page