Back to MCP directory
publicPublicdnsLocal runtime

xhs_mcp_server

用于发布小红书的MCP插件。

article

README

Project description

install

  1. python packages
pip install -r requirements.txt
  1. install chromedriver find out your chrome version like "134.0.6998.166". download it
npx @puppeteer/browsers install chromedriver@134.0.6998.166

copy the chromedriver to your path or add it in your path

  1. install xhs_mcp_server
pip install xhs-mcp-server

login

run the following command in your terminal.

env phone=YOUR_PHONE_NUMBER python -m xhs_mcp_server.__login__

it will show:

无效的cookies,已清理
请输入验证码: 

and you need to input the verification code in the terminal and press enter.

check it

env phone=YOUR_PHONE_NUMBER python -m xhs_mcp_server.__login__

it will show:

使用cookies登录成功

inspector

start the inspector by following command in terminal:

npx @modelcontextprotocol/inspector -e phone=YOUR_PHONE_NUMBER python -m xhs_mcp_server

you can use a local image, type in its path in the inspector

["PATHTOYOURIMAGE.jpg"]

it will show an error, but it is ok, the post will be sent. Error Request timed out

start the server

start the server by following command:

env phone=YOUR_PHONE_NUMBER python -m xhs_mcp_server
help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client