xiaohongshu-mcp

Publish to Xiaohongshu (RedNote) from your own account, plus search, read, comment, like and notifications.

By zy (individual) Go Local · Streamable HTTP CommunicationMedia

61 popularity score ★ 17k

Connect your client

Local (once it is running)

Add in one click

Opens the app, which asks before it adds the server.

Or add it by command or config

Claude CodeTerminal
claude mcp add --transport http xiaohongshu http://localhost:18060/mcp
Cursor~/.cursor/mcp.json
{
  "mcpServers": {
    "xiaohongshu": {
      "url": "http://localhost:18060/mcp"
    }
  }
}
VS Code.vscode/mcp.json
{
  "servers": {
    "xiaohongshu": {
      "type": "http",
      "url": "http://localhost:18060/mcp"
    }
  }
}
Codex~/.codex/config.toml
[mcp_servers.xiaohongshu]
url = "http://localhost:18060/mcp"
Gemini CLITerminal
gemini mcp add --scope user --transport http xiaohongshu http://localhost:18060/mcp

Settings 4

AUTH_TOKEN secret Optional: Bearer token that clients must send as Authorization: Bearer <token>. Off when unset. A non-empty -token flag takes precedence.
XHS_PROXY Optional: HTTP, HTTPS or SOCKS5 proxy for the browser.
COOKIES_PATH Optional: Where the session cookies file lives. Defaults to cookies.json in the working directory, or /tmp/cookies.json if that old file exists.
XHS_FP_SEED Optional: Fixed positive integer seed for the browser fingerprint. Unset, a seed is kept in the session file.

What it does

This server runs a browser that is logged in to Xiaohongshu (RedNote, xiaohongshu.com) as you, and it gives your assistant tools that act through that browser. It can publish image posts and single-video posts, with tags, a scheduled time, visibility and product links. It also reads the home feed, searches notes with filters, opens a note with its engagement counts and comments, and reads any user's profile or your own. It can post comments and replies, like or favorite notes, and work through your notifications by reading them, replying to comments and liking them.

The README documents 13 tools. The code at the current release registers 18 of them (mcp_server.go). The extra five are get_my_profile, get_unread_count, list_notifications, reply_notification and like_notification. Note that list_notifications clears the unread marks for the section it reads.

You log in once, either with the separate login program or by scanning the QR code that get_login_qrcode returns. The session is kept in a cookies.json file. After that the server listens over HTTP at http://localhost:18060/mcp and you add that address to your client. There are three ways to run it: the release binaries, a build from Go source, or Docker Compose. The Compose setup now comes as a headless image (latest tag) or a GUI image (novnc tags) that shows the browser desktop through noVNC on port 6080, which helps when you need to watch a login or step in by hand. The README is written in Chinese.

What it needs

RuntimeA prebuilt binaryGoDocker
Runs onmacOS, Windows, Linux
XiaohongshuFreeYour own account. The README suggests finishing real-name verification first. Product links need an account with the product feature enabled.
Also
  • Headless browser, about 150 MB, downloaded on first run

Pick one way to run it. You can use a release binary (macOS Apple Silicon, Windows x64 or Linux x64), build it with Go, or run `docker compose -f docker/docker-compose.yml up -d` (or `docker/novnc/compose.yml` for the GUI image) from a clone of the repository. Log in first with the xiaohongshu-login program, `go run cmd/login/main.go`, or the get_login_qrcode tool. Then start the server and point your client at http://localhost:18060/mcp. The flags are -headless (default true), -port (default :18060) and -token.

Limits

  • Platform Release binaries exist for macOS Apple Silicon, Windows x64 and Linux x64 only. The README says macOS Intel and Linux ARM64 are not supported.
  • Not covered Xiaohongshu allows one web login per account, so logging in on another web browser signs this server out. The mobile app is unaffected.
  • Not covered Text-only posts are not supported. An image post needs at least one image, and a video post takes one local video file.
  • Size cap Titles are limited to 20 Chinese characters or English words. Scheduled posts must fall between 1 hour and 14 days ahead.
  • Rate limit The README puts the practical posting limit at about 50 posts per account per day.
  • Limit get_feed_detail returns the first 10 top-level comments by default. With load_all_comments it loads up to limit (default 20).
  • Limit Most tools need a feed_id and xsec_token, which come from list_feeds, search_feeds or notifications.
  • Limit The project says it is for learning use only. Automating the site may break Xiaohongshu's terms, and cookies expire, so you will need to log in again.

Who it suits

A fit for someone who runs a Xiaohongshu account and wants an assistant to draft and publish notes, keep up with comments and notifications, and research what is posted on the platform. It needs a machine that can keep the server running with a browser and a logged-in session, and it posts under your name, so it is a poor fit for read-only research with no account. The same maker offers x-mcp, a Chrome extension that drives the browser you already use. The README recommends it for people who do not want to deal with Docker or other setup.

Tools 18

8 only read, 9 change things, 1 can delete or overwrite. A ? marks an optional parameter.

check_login_status
Report whether the saved Xiaohongshu session is logged in.
get_login_qrcode
Return a login QR code as a Base64 image, with its expiry time.
delete_cookies deletes
Remove the saved cookies file so you have to log in again.
publish_content changes
Publish an image note from image URLs or local paths, with optional tags, schedule, visibility and products.title: stringcontent: stringimages: arraytags?: arrayschedule_at?: stringis_original?: booleanvisibility?: stringproducts?: array
publish_with_video changes
Publish a video note from one local video file, with optional tags, schedule, visibility and products.title: stringcontent: stringvideo: stringtags?: arrayschedule_at?: stringvisibility?: stringproducts?: array
list_feeds
Read the recommended notes on the home feed.
search_feeds
Search notes by keyword, filtered by sort order, note type, publish time, scope and location.keyword: stringfilters?: object
get_feed_detail
Read a note with its media, author, engagement counts and comments.feed_id: stringxsec_token: stringload_all_comments?: booleanlimit?: integerclick_more_replies?: booleanreply_limit?: integerscroll_speed?: string
user_profile
Read a user's profile, follower counts and their notes, favorites or likes tab.user_id: stringxsec_token: stringtab?: string
post_comment_to_feed changes
Add a comment to a note.feed_id: stringxsec_token: stringcontent: string
reply_comment_in_feed changes
Reply to a given comment under a note, found by comment or user ID.feed_id: stringxsec_token: stringcomment_id?: stringuser_id?: stringcontent: string
like_feed changes
Like a note, or remove the like with unlike.feed_id: stringxsec_token: stringunlike?: boolean
favorite_feed changes
Save a note to favorites, or remove it with unfavorite.feed_id: stringxsec_token: stringunfavorite?: boolean
get_my_profile
Read your own profile with your notes, favorites or likes.tab?: string
get_unread_count
Count unread notifications in each of the three sections without clearing them.
list_notifications changes
List notifications in one section, which also clears that section's unread marks.tab?: stringlimit?: integer
reply_notification changes
Reply to a comment from the mentions section by its comment ID.comment_id: stringcontent: string
like_notification changes
Like or unlike a comment from the mentions section.comment_id: stringunlike?: boolean

Similar servers