# xiaohongshu-mcp

> MCP server that drives a logged-in Xiaohongshu session — publish, search, comment and read engagement data from an AI assistant

- Category: Agents & Automation / Workflow Automation
- Language: Go
- Licence: Apache-2.0
- Repository: https://github.com/xpzouying/xiaohongshu-mcp
- Canonical page: https://ai-tldr.dev/tools/xiaohongshu-mcp/

## In short

xiaohongshu-mcp exposes Xiaohongshu (小红书 / RED) to an AI assistant as an MCP server. It sits in the Workflow Automation category of the Agents & Automation tools and is open-source, written in Go and licensed Apache-2.0. To get started: download the binaries and log in.

## Overview

xiaohongshu-mcp exposes Xiaohongshu (小红书 / RED) to an AI assistant as an MCP server. It drives a headless browser against a logged-in account, so anything the site lets a signed-in user do becomes a tool an agent can call: publishing image-and-text or video posts, searching by keyword, pulling the home recommendation feed, reading a post's full detail including likes, favourites, shares and comment threads, commenting and replying, liking, and favouriting.

The project is written in Go and ships as prebuilt binaries for macOS Apple Silicon, Windows x64 and Linux x64, alongside a Docker image on Docker Hub and a docker-compose file. It comes in two pieces: a login helper that opens a browser so you can authenticate once, and the MCP service itself. The first run downloads a headless browser of roughly 150 MB; after that it starts offline.

Publishing takes a title, a body and media. Images can be HTTP(S) URLs or absolute local paths — the project recommends local paths for speed and stability — while video publishing accepts local files only. Reading a post's details or acting on it requires both the post id and its xsec_token, which you obtain from the feed or search results, and every action requires a logged-in session. The maintainer notes that one Xiaohongshu account cannot be signed in on multiple web clients at once: logging in elsewhere will kick the MCP session out.

## What it does

- MCP tools plus an HTTP API for login, publishing, search, feed, post detail, comments, likes and favourites
- Publishes image-and-text posts (local paths or HTTP image URLs) and video posts from local files, with titles, bodies and tags
- Fetches full post detail — content, author, like/favourite/share/comment counts and nested comment threads
- Reads a user profile: bio, follower and following counts, total likes and the user's public notes
- Idempotent like/favourite tools that detect the current state instead of toggling blindly
- Ships as prebuilt binaries for macOS/Windows/Linux, a Docker Hub image and a docker-compose deployment

## Getting started

Run the login tool once to authenticate, then start the MCP service. Docker is the least fiddly route; prebuilt binaries cover macOS Apple Silicon, Windows x64 and Linux x64 (macOS Intel and Linux ARM64 are not built).

1. Download the binaries and log in

   Grab the MCP service and the login helper for your platform from GitHub Releases, then run the login tool first. The first launch downloads a headless browser of about 150 MB.

```bash
# 1. Run the login tool
chmod +x xiaohongshu-login-darwin-arm64
./xiaohongshu-login-darwin-arm64

# 2. Start the MCP service
chmod +x xiaohongshu-mcp-darwin-arm64
./xiaohongshu-mcp-darwin-arm64
```

2. Or run it with Docker

   The published image bundles the browser and Chinese fonts, mounts ./data for cookies and runtime state and ./images for published pictures.

```bash
docker pull xpzouying/xiaohongshu-mcp

wget https://raw.githubusercontent.com/xpzouying/xiaohongshu-mcp/main/docker/docker-compose.yml
docker compose up -d
docker compose logs -f
```

3. Build from source

   Building needs a Go toolchain. If you are on a slow connection to proxy.golang.org, set a mirror first.

```bash
go env -w GOPROXY=https://goproxy.cn,direct
```

4. Know the platform's limits before you automate

   Titles are capped at 20 characters and bodies at 1000. Post detail, comment, like and favourite tools all need the post id AND its xsec_token, both of which come from the feed or search results. Keep the account signed out of other web clients while the MCP service is running, or the session is dropped. The project is published for learning purposes and forbids any unlawful use.

## When to use it

- Letting a coding agent or assistant draft and publish Xiaohongshu image or video posts from a local folder
- Pulling search results, the recommendation feed or a specific post's comment thread into an agent's context
- Automating routine engagement — replying to comments on your own notes, liking or favouriting — behind an agent's approval step
- Reading a creator profile's public notes and follower statistics as structured data instead of scraping the page by hand
