home / mcp / xiaohongshu mcp server

xiaohongshu MCP Server

Provides MCP-based publishing actions to Xiaohongshu, including login checks and content posting with images and tags.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "1uokun-xiaohongshu-mcp-js": {
      "url": "http://localhost:3000/mcp"
    }
  }
}

You can deploy and interact with the xiaohongshu MCP server to publish content to Xiaohongshu programmatically. The MCP server coordinates actions like checking login status, publishing posts, and testing connections from an MCP client, so you can automate workflows and build AI-assisted publishing pipelines.

How to use

Use an MCP client to connect to the xiaohongshu MCP server and trigger predefined tools. The client can operate over HTTP or local STDIO streams. Common actions include verifying login status, publishing content with images and tags, and running an inspector to test connectivity. You will typically register the MCP server in your client, then call the available tools by name with the required inputs.

How to install

# Prerequisites
- Node.js v18+ (or the version you prefer for the project)
- npm

# 1) Install dependencies for the MCP server project
npm i

# 2) Start the MCP server locally (express app exposes MCP at /mcp)
npm start

# 3) (Optional) Start MCP Inspector for testing connections
npx @modelcontextprotocol/inspector

Additional sections

MCP connection options: you can connect via HTTP or STDIO. Use HTTP when your MCP client communicates over a network and STDIO when running a local, in-process flow. The HTTP method exposes the MCP endpoint at a URL, while STDIO spawns the server as a child process and communicates through standard input/output.

MCP inspector: to test and debug MCP connections, run the inspector and point your browser to the MCP endpoint (for example, http://localhost:3000/mcp). This helps validate that the MCP server is reachable and responding to commands.

Note on transports: three transport types exist (STDIO, SSE deprecated, and Streamable HTTP). STDIO uses a direct process stdin/stdout channel, while Streamable HTTP communicates via HTTP post requests for a streaming protocol. Your MCP client can choose the transport that best fits your environment.

Available tools

check_login_status

Check Xiaohongshu login status by launching a headful browser session and waiting for the login element to appear; returns a confirmation of login state.

publish_content

Publish content to Xiaohongshu with a title, content body, images, and optional tags; requires prior login and returns a success message with the published details.