home / mcp / xiaohongshu mcp server

Xiaohongshu MCP Server

xiaohongshu-mcp-python是一个基于现代Python技术栈开发的小红书内容自动化发布工具,通过Model Context Protocol (MCP)协议为AI客户端提供强大的小红书操作能力。 项目核心功能包括小红书账户登录管理、图文内容发布、视频内容发布、内容搜索与获取、帖子详情查看以及评论互动等。支持多种图片格式(JPG、PNG、GIF)和视频格式(MP4、MOV、AVI),既可处理本地文件路径,也支持HTTP/HTTPS链接,为用户提供灵活的内容发布方案。 该工具特别适合内容创作者、营销人员和开发者使用,能够显著提升小红书内容发布的效率和自动化程度。通过标准化的MCP接口,用户可以轻松地将小红书操作能力集成到各种AI工作流中,实现智能化的内容管理和发布。

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "luyike221-xiaohongshu-mcp-python": {
      "url": "http://localhost:8003",
      "headers": {
        "OPENAI_API_KEY": "YOUR_OPENAI_API_KEY",
        "WANT2I_API_KEY": "YOUR_WANT2I_API_KEY",
        "PEXELS_API_KEYS": "KEY1,KEY2",
        "WANT2I_BASE_URL": "https://dashscope.aliyuncs.com/compatible-mode/v1",
        "PIXABAY_API_KEYS": "KEY1",
        "VIDEO_OUTPUT_DIR": "./output",
        "OPENAI_MODEL_NAME": "gpt-3.5-turbo"
      }
    }
  }
}

You are set to run a modular MCP server stack that automates Xiaohongshu content creation, image and video generation, platform operations, and AI-driven scheduling. This server collection enables end-to-end content workflows—from writing and generating media to publishing and analyzing results—across multiple Xiaohongshu services with centralized coordination and extensibility.

How to use

To use this MCP server, connect via an MCP client to the provided HTTP endpoints for each service, or start the local processes to run them as standard input/output servers. Each service exposes its own capabilities, such as content generation, image creation, video production, browser automation for posting, and data collection. The AI scheduler coordinates tasks, makes decisions, and dispatches work to the MCP services in response to events, user requests, or scheduled tasks. Use the HTTP endpoints for remote operation or run the services locally through their respective startup commands if you prefer a self-hosted workflow.

How to install

Prerequisites: you need Python 3.11 or newer and a compatible environment to run the MCP services. You will also use the uv tool to manage and run the local MCP servers.

Step-by-step installation and startup flow, assuming you are cloning the repository and running services locally:

Additional sections

Configuration details for each MCP service are shown in their respective environment files. Create per-service environment files and populate keys such as API keys, base URLs, and output directories. For example, the image generation service may require a base URL and an API key, while the video service may need LLM provider settings and media resource keys. The AI scheduler needs endpoints to communicate with the MCP services and its own server configuration to expose the API or enable an interactive chat mode.

Security and notes

Respect platform rules and rate limits when automating posting to Xiaohongshu. Use dedicated accounts for automation, monitor login status, and manage cookies securely. This stack is intended for learning and research use; handle authentication, secrets, and user data responsibly.

Examples and troubleshooting

Examples of common workflows include creating content with the content generator, generating corresponding images, and publishing via the browser automation service. If a service fails to start, verify environment variable values, ensure required external APIs are reachable, and confirm that the specified ports are not in use by other processes.

Available tools

ai_scheduler_api

Coordinate AI-driven decision making and dispatch tasks to MCP services via HTTP API.

content_generation

Generate Xiaohongshu notes, titles, and descriptions from topics.

image_generation

Create high-quality images from prompts for posts.

video_generation

Assemble scripted videos with TTS, subtitles, and media assets.

browser_automation

Publish content to Xiaohongshu and manage interactions via browser automation.

data_collection

Collect and analyze platform data for insights and optimization.