xpzouying/xiaohongshu-mcp

AI Engineering

MCP server that lets AI assistants publish, search, comment on, and read Xiaohongshu content through a local browser session.

16,742
2,458
Go
Apache-2.0
1 year old

What It Does

This project is a Model Context Protocol (MCP) server for Xiaohongshu (RedNote). It exposes Xiaohongshu operations as MCP tools so clients such as Claude Code CLI, Cursor, VSCode, Gemini CLI, Cline, and MCP Inspector can drive them through natural language. The available tools cover login status, publishing image/text posts and videos, searching and browsing feeds, reading post details and comments, posting and replying to comments, liking, favoriting, and retrieving user profiles. See the full MCP tool list.

A local browser session carries the Xiaohongshu login state. After a one-time manual login, the server reuses the saved cookies, so subsequent MCP calls can operate on the account without a new login each time.

Quick Start

  1. Download the binary for your platform from GitHub Releases or build from source. The prebuilt packages cover macOS Apple Silicon, Windows x64, and Linux x64; macOS Intel and Linux ARM64 are not listed.
  2. Run the login helper first:
chmod +x xiaohongshu-login-darwin-arm64
./xiaohongshu-login-darwin-arm64
  1. Start the MCP service:
chmod +x xiaohongshu-mcp-darwin-arm64
./xiaohongshu-mcp-darwin-arm64

On the first run the server downloads a headless browser (about 150 MB), so keep the network available. The service listens at http://localhost:18060/mcp; use -headless=false if you need to see the browser window.

  1. Register the service with an MCP client. For Claude Code CLI:
claude mcp add --transport http xiaohongshu-mcp http://localhost:18060/mcp
claude mcp list
  1. Verify with MCP Inspector:
npx @modelcontextprotocol/inspector

Connect to http://localhost:18060/mcp and click List Tools; a correctly configured server should show 13 tools.

Docker is an alternative: docker compose -f docker/docker-compose.yml up -d starts the default headless image, while docker/docker-compose.yml plus the novnc compose file provides a GUI view at port 6080. Both expose the same MCP address.

Operational Constraints

  • Xiaohongshu requires a login; several tools additionally need feed_id and xsec_token values that you obtain from feed or search results.
  • The same Xiaohongshu account cannot stay logged in on multiple web clients. Logging in elsewhere will kick the MCP session out; the mobile app is safe for checking account state.
  • Publishing images accepts HTTP/HTTPS links or absolute local paths, with local paths recommended. Video publishing only accepts a local absolute file path, not a URL; the README suggests keeping videos under 1 GB, and processing takes time.
  • The README notes title length (20 characters) and body length (1,000 characters) limits, and warns against prohibited words or content that violates Xiaohongshu rules.
  • The optional AUTH_TOKEN environment variable or -token flag turns on bearer-token authentication; command-line tokens may be visible in process listings, so prefer the environment variable in shared environments. Proxy access is available through XHS_PROXY with HTTP, HTTPS, or SOCKS5 support.
  • The GUI Docker deployment has no separate password and should be restricted to local or SSH-forwarded access, not exposed publicly.
  • The project is Apache-2.0 licensed.

HotRepo's Take

The repository appeared on the Go daily list on 2026-11-02, ranked 16th with 37 stars gained that day, and showed 16,742 stars and 2,458 forks at that snapshot. The standing reflects a sizeable community around an automation-heavy project; it is also a project where the account and platform rules matter more than the code volume, so users should read the login and publishing constraints before connecting a real account.

Written by AI from the project's README, updated . The project's own docs are the source of truth.