Price Per TokenPrice Per Token

Xiaohongshu MCP Server

by aki66938

0

About

Xiaohongshu MCP Server is a social media automation toolkit that enables AI-powered content management for the Xiaohongshu (Little Red Book) platform through the Model Context Protocol. Key features: - Secure cookie-based authentication and login credential management - Automated publishing of image/text posts and video notes with topic tags - Data collection from creator dashboard including follower metrics, engagement analytics, and content performance statistics - Scheduled automated data scraping using cron expressions - AI-friendly data formatting with Chinese headers for direct analysis by AI agents - Local CSV data storage for performance tracking - Seamless integration with Claude Desktop, Cherry Studio, and other MCP-compatible AI clients - Support for both local Chrome automation and remote browser deployment via Selenium/WebDriver

README

📕 小红书创作者MCP工具包

[](LICENSE) []((https://kayin-1253854796.cos.ap-shanghai.myqcloud.com/ownmedia/20250622023225261.jpg?imageSlim))

一个强大的小红书自动化工具包,支持通过MCP协议与AI客户端(如Claude Desktop等)集成,实现与AI对话即可进行内容创作、发布及创作者数据分析。

✨ 主要特性

  • 🍪 Cookie管理: 安全获取、验证和管理小红书登录凭证
  • 🤖 MCP协议支持: 与Claude Desktop、CherryStudio等AI客户端无缝集成
  • 📝 自动发布: 支持图文和视频笔记的自动化发布
  • 🖼️ 多样化图片支持: 支持本地图片、网络URL
  • 定时任务: 支持cron表达式的定时数据采集
  • 📊 数据采集: 自动采集创作者中心仪表板、内容分析、粉丝数据
  • 🧠 AI数据分析: 中文表头数据,AI可直接理解和分析
  • 💾 数据存储: 支持csv本地存储(sql目前保留,暂不开发)
  • 🎯 统一接口: 一个工具解决llm操作小红书自动化需求
  • 📋 功能清单

    登录

  • [x] 登录 - 支持传统的命令行登录和通过与AI对话完成登录
  • 内容发布

  • [x] 图文发布 - 支持发布图文笔记
  • [x] 视频发布 - 支持发布视频笔记
  • [x] 话题标签 - 支持自动添加话题标签,提升内容曝光度
  • [ ] 内容搜索 - 支持指定搜索(开发计划中)
  • 数据采集

  • [x] 仪表板数据 - 采集账号概览数据(粉丝数、获赞数等)
  • [x] 内容分析数据 - 采集笔记表现数据(浏览量、点赞数等)
  • [x] 粉丝数据 - 采集粉丝增长和分析数据
  • [x] 定时采集 - 支持cron表达式的自动定时采集
  • [x] 数据存储 - CSV本地存储(默认)
  • 📋 环境要求

    🌐 浏览器环境

  • Google Chrome 浏览器 (最新版本推荐)
  • ChromeDriver (版本必须与Chrome版本完全匹配)
  • 🔍 查看Chrome版本

    在Chrome浏览器中访问:chrome://version/

    📥 ChromeDriver安装方式

    #### 方法一:自动下载(推荐)

    # 使用webdriver-manager自动管理
    pip install webdriver-manager
    

    #### 方法二:手动下载 1. 📋 访问官方下载页面:Chrome for Testing 2. 🎯 选择与您Chrome版本完全匹配的ChromeDriver 3. 📁 下载后解压到合适位置(如 /usr/local/bin/C:\tools\) 4. ⚙️ 在 .env 文件中配置正确路径

    #### 方法三:包管理器安装

    # macOS (Homebrew)
    brew install --cask chromedriver

    Windows (Chocolatey)

    choco install chromedriver

    Linux (Ubuntu/Debian)

    sudo apt-get install chromium-chromedriver

    > ⚠️ 重要提示:版本不匹配是最常见的问题原因,请确保ChromeDriver版本与Chrome浏览器版本完全一致!

    🌐 远程浏览器连接

    支持连接到已运行的远程Chrome实例,提高性能和支持远程部署场景。

    #### 🔧 配置方法

    .env 文件中添加以下配置:

    # 启用远程浏览器连接
    ENABLE_REMOTE_BROWSER=true
    REMOTE_BROWSER_HOST=http://xx.xx.xx.xx
    REMOTE_BROWSER_PORT=xxxx
    

    #### 🚀 启动远程Chrome

  • 如果报错没有权限,请检查 ./chrome-data 目录是否存在切查看是否有读写权限,如果没有读写权限,请按照下面的步骤修复
  • 1. docker run --rm selenium/standalone-chrome id seluser 获取seluser的uid,例如返回 uid=1200(seluser) gid=1200(seluser) groups=1200(seluser) 2. sudo chown -R 1200:1200 ./chrome-data 赋予seluser的读写权限,1200是seluser的uid 3. 重新执行 docker-compose up --force-recreate 启动容器

    version: '3.8'

    services: selenium-chrome: image: selenium/standalone-chrome:latest container_name: selenium-chrome ports: - "54444:4444" - "57900:7900" shm_size: 2g environment: - SE_VNC_NO_PASSWORD=1 volumes: - ./chrome-data:/home/seluser # 更换挂载路径,确保权限 restart: unless-stopped command: > bash -c "mkdir -p /home/seluser/.config/google-chrome && touch /home/seluser/.config/google-chrome/test.txt && /opt/bin/entry_point.sh"

    #### 💡 使用场景

  • 远程部署:在服务器上运行Chrome,本地连接使用
  • 性能优化:复用已运行的Chrome实例,避免重复启动
  • 开发调试:连接到已登录的Chrome实例,保持会话状态
  • Docker环境:在容器间共享Chrome实例
  • #### ⚠️ 注意事项

  • 远程连接时不会启动新的Chrome实例
  • 确保目标Chrome实例已开启远程调试功能
  • 某些操作(如窗口大小调整)在远程模式下可能不支持
  • 🚀 快速开始

    💡 极简使用方式

    # 克隆项目
    git clone https://github.com/aki66938/xhs-toolkit.git
    cd xhs-toolkit

    运行(会自动安装依赖)

    ./xhs # Mac/Linux xhs.bat # Windows

    或使用 Python

    python install_deps.py # 安装依赖向导 ./xhs # 启动程序

    🎮 交互式菜单

    运行 ./xhs 后会显示友好的菜单界面:

    ╭─────────────────────────────────────────╮
    │         小红书MCP工具包 v1.3.0           │
    │           快速操作菜单系统                │
    ╰─────────────────────────────────────────╯

    【主菜单】 1. 🔄 数据收集 2. 🌐 浏览器操作 3. 📊 数据管理 4. 🍪 Cookie管理 5. 🚀 MCP服务器 6. ⚙️ 系统工具 0. 退出

    🛠️ 从源码运行

    #### 方法一:uv (推荐 ⚡)

    # 克隆项目
    git clone https://github.com/aki66938/xhs-toolkit.git
    cd xhs-toolkit

    使用uv安装依赖并运行

    uv sync uv run python xhs_toolkit.py status ## 验证工具是否可用

    > 💡 uv使用提示:文档中所有 python 命令都可以用 uv run python 替代,享受更快的依赖管理体验!

    #### 方法二:pip (传统方式)

    # 克隆项目
    git clone https://github.com/aki66938/xhs-toolkit.git
    cd xhs-toolkit

    创建虚拟环境(推荐)

    python -m venv venv source venv/bin/activate # Windows: venv\Scripts\activate

    安装依赖

    pip install -r requirements.txt python xhs_toolkit.py status ## 验证工具是否可用

    🛠️ 使用指南

    1. 创建配置文件

    复制并编辑配置文件:

    cp env_example .env
    vim .env  # 编辑配置
    

    必需配置

    # Chrome浏览器路径
    CHROME_PATH="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"

    ChromeDriver路径

    WEBDRIVER_CHROME_DRIVER="/opt/homebrew/bin/chromedriver"

    2. 获取登录凭证

    # 方式一:使用交互式菜单
    ./xhs
    

    选择 4 -> Cookie管理 -> 1 -> 获取新的Cookies

    方式二:直接命令

    ./xhs cookie save

    在弹出的浏览器中, 如果是连接的远程浏览器,可以访问 http://ip:57900 访问vnc界面,然后执行下面的步骤: 1. 登录小红书创作者中心 2. 确保能正常访问创作者中心功能 3. 完成后按回车键保存

    3. 启动MCP服务器

    ```bash

    方式一:使用交互式菜单

    ./xhs

    选择 5 -> MCP服务器 -> 1 -> 启动服务器

    方式二:直接命

    Related MCP Servers

    AI Research Assistant

    AI Research Assistant

    hamid-vakilzadeh

    AI Research Assistant provides comprehensive access to millions of academic papers through the Semantic Scholar and arXiv databases. This MCP server enables AI coding assistants to perform intelligent literature searches, citation network analysis, and paper content extraction without requiring an API key. Key features include: - Advanced paper search with multi-filter support by year ranges, citation thresholds, field of study, and publication type - Title matching with confidence scoring for finding specific papers - Batch operations supporting up to 500 papers per request - Citation analysis and network exploration for understanding research relationships - Full-text PDF extraction from arXiv and Wiley open-access content (Wiley TDM token required for institutional access) - Rate limits of 100 requests per 5 minutes with options to request higher limits through Semantic Scholar

    Web & Search
    12 8
    Linkup

    Linkup

    LinkupPlatform

    Linkup is a real-time web search and content extraction service that enables AI assistants to search the web and retrieve information from trusted sources. It provides source-backed answers with citations, making it ideal for fact-checking, news gathering, and research tasks. Key features of Linkup: - Real-time web search using natural language queries to find current information, news, and data - Page fetching to extract and read content from any webpage URL - Search depth modes: Standard for direct-answer queries and Deep for complex research across multiple sources - Source-backed results with citations and context from relevant, trustworthy websites - JavaScript rendering support for accessing dynamic content on JavaScript-heavy pages

    Web & Search
    2 24
    Math-MCP

    Math-MCP

    EthanHenrickson

    Math-MCP is a computation server that enables Large Language Models (LLMs) to perform accurate numerical calculations through the Model Context Protocol. It provides precise mathematical operations via a simple API to overcome LLM limitations in arithmetic and statistical reasoning. Key features of Math-MCP: - Basic arithmetic operations: addition, subtraction, multiplication, division, modulo, and bulk summation - Statistical analysis functions: mean, median, mode, minimum, and maximum calculations - Rounding utilities: floor, ceiling, and nearest integer rounding - Trigonometric functions: sine, cosine, tangent, and their inverses with degrees and radians conversion support

    Developer Tools
    22 81