XHS-Downloader
小红书(XiaoHongShu、RedNote)链接提取/作品采集工具:提取账号发布、收藏、点赞、专辑作品链接;提取搜索结果作品、用户链接;采集小红书作品信息;提取小红书作品下载地址;下载小红书作品文件
claude mcp add --transport stdio joeanamier-xhs-downloader python main.py mcp \ --env PORT="5556" \ --env XHS_DOWNLOADER_VOLUME="path/to/volume (optional, if mounting inside container)"
How to use
XHS-Downloader is an MCP-enabled toolset for automating interaction with the XHS-Downloader project. The MCP mode exposes programmatic access to the server's capabilities, including API-like endpoints and workflow automation via the MCP interface. You can start the MCP server in Python mode and then use the MCP runtime to invoke the available endpoints or scripts that coordinate downloading content, extracting links, and managing metadata. Typical usage involves starting the MCP server, then issuing MCP calls to request details, trigger downloads, or chain actions through the MCP invocation layer. The server supports API-like requests such as /xhs/detail in its HTTP API when run in server mode; through MCP you can orchestrate those actions as part of larger automation pipelines. The documentation bundle also notes optional features like clipboard monitoring, cookie management, and various download modes (CLI, API, and MCP).
How to install
Prerequisites:
- Python 3.12+ installed on your system
- Optional: a virtual environment tool (venv) is recommended but not required
-
Clone the repository: git clone https://github.com/JoeanAmier/XHS-Downloader.git cd XHS-Downloader
-
Set up a Python environment and install dependencies: python -m venv venv
Windows
.\venv\Scripts\activate.ps1
macOS/Linux
source venv/bin/activate pip install -r requirements.txt
-
Run in MCP mode (server mode for MCP): python main.py mcp
-
(Optional) Run in API/standalone server mode to test endpoints before MCP integration: python main.py api
Notes:
- The project provides multiple run modes: source execution, Docker, and MCP. The steps above focus on enabling MCP-based orchestration.
- If you plan to run via Docker or other packaging, follow the Docker run instructions in the README to obtain a containerized MCP setup, then point MCP at the containerized service.
Additional notes
Tips and notes:
- Cookie handling: The project supports browser cookie extraction for higher-quality content; however, some browser cookie retrieval features may become unreliable due to third-party module updates. If cookies are not configured, expect lower-quality downloads.
- Port and volume: The MCP server typically runs on port 5556. If you’re running in a container or behind a reverse proxy, ensure the port is exposed and mapped correctly. For persistent storage, mount a volume to /app/Volume inside containers as described in the Docker section.
- MCP endpoints: In MCP mode you can script interactions with the server's capabilities, including details extraction, link collection, and download orchestration. The API endpoints described in the API mode (e.g., /xhs/detail) are available when running in API mode; MCP can orchestrate similar actions through the MCP interface.
- Environment variables: You may want to set variables such as PORT, volume paths, and any API keys or cookies required by your deployment. Placeholder values are provided in the mcp_config example and should be replaced with real values in your environment.
- Platform considerations: Docker runs may not support clipboard-reading features; if you rely on those, prefer the Program/Source run or API mode rather than Docker in MCP scenarios.
Related MCP Servers
nginx-ui
Yet another WebUI for Nginx
ollama -bridge
Extend the Ollama API with dynamic AI tool integration from multiple MCP (Model Context Protocol) servers. Fully compatible, transparent, and developer-friendly, ideal for building powerful local LLM applications, AI agents, and custom chatbots
knowledge-graph-system
Kappa Graph — κ(G). A semantic knowledge graph where knowledge has weight. Extracts concepts, measures grounding strength, preserves disagreement, traces everything to source.
mcp-screenshot
An MCP server that provides AI assistants with screenshot capabilities — both web page capture via Puppeteer and cross-platform system screenshots using native OS tools.
create -kit
Scaffold a production-ready Model Context Protocol (MCP) server in seconds.
mcp
🌐 MCP Server for Semantic Search of Macro Data for Quant Research AI Agents