xpzouying/xiaohongshu-mcp
MCP for xiaohongshu.com
xiaohongshu‑mcp
What it is – A self‑hosted service that exposes the Xiaohongshu (小红书) social‑media platform as a Model Context Protocol (MCP) server. By running the server, an AI assistant (Claude Code, Cursor, VS Code, Open Code, Cline, etc.) can call Xiaohongshu functions such as login, posting, searching, liking, commenting, and fetching user or feed details.
Key capabilities
- Login management – QR‑code login, cookie handling, status check, cookie reset.
- Content publishing – Post image‑text notes (title, body, images) or video notes (title, body, local video). Supports tags, scheduling, visibility options, and product linking.
- Feed operations – Retrieve the home recommendation list, search by keyword with filters, get full post details (including comments and interaction stats), like/unlike, favorite/unfavorite.
- Social interactions – Post comments, reply to specific comments, fetch a user’s profile and their notes.
- MCP integration – All functions are exposed as standard MCP tools (
check_login_status,publish_content,search_feeds, …) that any MCP‑compatible client can call.
How to get it running
- Pre‑built binaries – Download the appropriate executable for macOS Apple Silicon, Windows x64, or Linux x64 from the Releases page. Run the
xiaohongshu-login-*binary once to log in, then startxiaohongshu-mcp-*. - Docker – Pull the image
xpzouying/xiaohongshu-mcpand launch it with the provideddocker-compose.yml. The container automatically installs a headless Chromium browser, mounts./datafor cookies and./imagesfor uploaded media, and exposes port 18060. - Build from source – Requires Go 1.20+. Set a
GOPROXY(e.g.,https://goproxy.cn) and rungo build ./....
Typical usage flow
# 1. Log in (once per session)
./xiaohongshu-login-darwin-arm64 # or the Windows/Linux binary
# 2. Start the MCP server (default headless mode)
./xiaohongshu-mcp-darwin-arm64
# → listens on http://localhost:18060/mcp
# 3. Verify with the MCP inspector
npx @modelcontextprotocol/inspector
# → connect to the above URL and list available tools
Connecting an AI client – Add the server URL (http://localhost:18060/mcp) to the client’s MCP configuration. Examples are provided for:
- Claude Code CLI (
claude mcp add …) - Open Code CLI (interactive
opencode mcp add) - Cursor (
.cursor/mcp.json) - VS Code (
.vscode/mcp.json) - Google Gemini CLI, Cline, and any generic HTTP‑MCP client.
Security & optional auth
- By default the server is open on localhost. For production use set
AUTH_TOKEN(or the-tokenflag) and have clients sendAuthorization: Bearer <token>. - Proxy support via
XHS_PROXY(HTTP/HTTPS/SOCKS5) for environments that need outbound routing.
Community & support
- 29 contributors (All‑Contributors badge).
- Docker pull stats, star‑history chart, and a dedicated donations page (all proceeds go to charity).
- Extensive troubleshooting guide (Issue #56) and a separate browser‑extension version (
xpzouying/x-mcp) for non‑technical users.
Who might use this
- Developers building AI agents that need to read or publish Xiaohongshu content.
- Content creators who want to automate posting, commenting, or data collection via prompts.
- Researchers experimenting with social‑media‑driven LLM workflows.
All details above are taken directly from the repository’s README; no additional features are inferred.
Related
- Project
- Project
- Project
- Project
- Project