xiaohongshu -python
xiaohongshu-mcp-python是一个基于现代Python技术栈开发的小红书内容自动化发布工具,通过Model Context Protocol (MCP)协议为AI客户端提供强大的小红书操作能力。 项目核心功能包括小红书账户登录管理、图文内容发布、视频内容发布、内容搜索与获取、帖子详情查看以及评论互动等。支持多种图片格式(JPG、PNG、GIF)和视频格式(MP4、MOV、AVI),既可处理本地文件路径,也支持HTTP/HTTPS链接,为用户提供灵活的内容发布方案。 该工具特别适合内容创作者、营销人员和开发者使用,能够显著提升小红书内容发布的效率和自动化程度。通过标准化的MCP接口,用户可以轻松地将小红书操作能力集成到各种AI工作流中,实现智能化的内容管理和发布。
claude mcp add --transport stdio luyike221-xiaohongshu-mcp-python uvx xhs-image-mcp \ --env MCP_HOST="127.0.0.1" \ --env MCP_PORT="8003" \ --env WANT2I_API_KEY="your_api_key" \ --env WANT2I_BASE_URL="https://dashscope.aliyuncs.com/compatible-mode/v1"
How to use
This MCP server suite provides a complete AI-powered social media operating platform focused on Xiaohongshu (Little Red Book). It is composed of six MCP services: a content generation engine, an image generator, a video generator, a browser automation component for platform operations, a data collector for analytics, and the AI scheduler that coordinates tasks and strategies. Each service exposes an MCP API and can be run independently via uvx. Start by launching the image and content services to generate assets and drafts, then use the browser automation MCP to publish and manage posts on Xiaohongshu. The AI scheduler ties everything together, driving autonomous decision making, scheduling, and interaction between services to automate your workflow.
How to install
Prerequisites:
- Python 3.11 or higher
- uvx package manager installed on your system
- Git to clone repositories
Step-by-step installation:
-
Clone the repository (or ensure you have the project structure): git clone https://github.com/luyike221/xiaohongshu-mcp-python.git cd xiaohongshu-mcp-python
-
Install UV package manager (example commands from README):
macOS/Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
Windows
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
-
Install individual MCP services dependencies (as per README):
Image generation MCP
cd xhs-image-mcp uv sync
Video generation MCP
cd ../xhs-video-mcp uv sync
Content generation MCP
cd ../xhs-content-generator-mcp uv sync
Browser automation MCP
cd ../xhs-browser-automation-mcp uv sync uv run playwright install chromium
Data collector MCP
cd ../xhs-data-collector-mcp uv sync
AI scheduler
cd ../ai_social_scheduler uv sync
-
Configure each service by creating .env files as described in the README for environment-specific settings.
-
Start services (examples):
Image generation
cd xhs-image-mcp uv run python -m image_video_mcp.main
Service will be available at http://127.0.0.1:8003
Video generation
cd ../xhs-video-mcp ./start.sh # or uv run xhs-video-mcp
Default: http://localhost:8005
Content generation
cd ../xhs-content-generator-mcp uv run python -m xhs_content_generator_mcp.main
Browser automation
cd ../xhs-browser-automation-mcp uv run python -m main
Data collector
cd ../xhs-data-collector-mcp uv run python -m data_collector_mcp.main
AI scheduler
cd ../ai_social_scheduler uv run python -m scheduler.main
Additional notes
Tips and common issues:
- Ensure the correct Python version (3.11+) is used and that uvx is installed before running uv commands.
- Some MCPs require API keys (e.g., image generation keys, OpenAI) to be set in .env files; never commit these keys to version control.
- For the video MCP, GPU acceleration requires compatible hardware and drivers; set VIDEO_GPU_ACCELERATION to false if not available.
- When starting multiple MCP services, verify that port mappings do not conflict (adjust MCP_PORT as needed).
- The ai_social_scheduler relies on multiple other MCP services; start dependencies first, then the scheduler.
- If a service fails to start, check the corresponding .env for required variables and ensure network access to external APIs.
- The npm_package field is not applicable for this Python-based MCP suite; use the Python uvx commands to manage services.
Related MCP Servers
mcp-vegalite
MCP server from isaacwasserman/mcp-vegalite-server
github-chat
A Model Context Protocol (MCP) for analyzing and querying GitHub repositories using the GitHub Chat API.
nautex
MCP server for guiding Coding Agents via end-to-end requirements to implementation plan pipeline
pagerduty
PagerDuty's official local MCP (Model Context Protocol) server which provides tools to interact with your PagerDuty account directly from your MCP-enabled client.
futu-stock
mcp server for futuniuniu stock
mcp -boilerplate
Boilerplate using one of the 'better' ways to build MCP Servers. Written using FastMCP