### Install Go using Winget Source: https://github.com/xpzouying/xiaohongshu-mcp/blob/main/docs/windows_guide.md Use this command in the Windows command prompt to install Go. Winget automatically handles environment variable setup. ```bash winget install GoLang.Go ``` -------------------------------- ### Start MCP Service (Binary - With UI) Source: https://github.com/xpzouying/xiaohongshu-mcp/blob/main/README.md Start the MCP service using the pre-compiled binary with the browser interface enabled. ```bash # 非无头模式,有浏览器界面 ./xiaohongshu-mcp-darwin-arm64 -headless=false ``` -------------------------------- ### Install Node.js LTS using Winget Source: https://github.com/xpzouying/xiaohongshu-mcp/blob/main/docs/windows_guide.md Use this command in the Windows command prompt to install the Long-Term Support (LTS) version of Node.js. Winget handles environment variable setup. ```bash winget install OpenJS.NodeJS.LTS ``` -------------------------------- ### Start MCP Service (Source - With UI) Source: https://github.com/xpzouying/xiaohongshu-mcp/blob/main/README.md Start the MCP service from source with the browser interface enabled. ```bash # 非无头模式,有浏览器界面 go run . -headless=false ``` -------------------------------- ### Start MCP Service (Binary - Headless) Source: https://github.com/xpzouying/xiaohongshu-mcp/blob/main/README.md Start the MCP service using the pre-compiled binary in headless mode (no browser interface). ```bash # 默认:无头模式,没有浏览器界面 ./xiaohongshu-mcp-darwin-arm64 ``` -------------------------------- ### Start MCP Service (Source - Headless) Source: https://github.com/xpzouying/xiaohongshu-mcp/blob/main/README.md Start the MCP service from source in headless mode (no browser interface). ```bash # 默认:无头模式,没有浏览器界面 go run . ``` -------------------------------- ### Install Kimi-CC via Shell Script Source: https://github.com/xpzouying/xiaohongshu-mcp/blob/main/examples/claude-code/claude-code-kimi-k2.md Executes the installation script for the Kimi-CC integration. Ensure you have your API Key ready as the script will prompt for it during execution. ```bash bash -c "$(curl -fsSL https://raw.githubusercontent.com/LLM-Red-Team/kimi-cc/refs/heads/main/install.sh)" ``` -------------------------------- ### Start MCP Service with Proxy (Binary) Source: https://github.com/xpzouying/xiaohongshu-mcp/blob/main/README.md Start the MCP service using the pre-compiled binary, configuring a proxy via the XHS_PROXY environment variable. ```bash # 设置代理后启动 XHS_PROXY=http://user:pass@proxy:port ./xiaohongshu-mcp-darwin-arm64 ``` -------------------------------- ### Start MCP Service with Proxy (Source) Source: https://github.com/xpzouying/xiaohongshu-mcp/blob/main/README.md Start the MCP service from source, configuring a proxy via the XHS_PROXY environment variable. ```bash # 或使用源码 XHS_PROXY=http://proxy:port go run . ``` -------------------------------- ### Install and Load Launch Agent Source: https://github.com/xpzouying/xiaohongshu-mcp/blob/main/deploy/macos/readme.md Commands to link the configured plist file to the user's LaunchAgents directory and load the service into the system. ```bash ln -s {你编辑后的 plist} ~/Library/LaunchAgents/xhsmcp.plist launchctl load ~/Library/LaunchAgents/xhsmcp.plist ``` -------------------------------- ### Run Login and MCP Service (macOS) Source: https://github.com/xpzouying/xiaohongshu-mcp/blob/main/README.md Execute the login tool first, then start the MCP service. Ensure the files are executable. The first run downloads a headless browser. ```bash # 1. 首先运行登录工具 chmod +x xiaohongshu-login-darwin-arm64 ./xiaohongshu-login-darwin-arm64 # 2. 然后启动 MCP 服务 chmod +x xiaohongshu-mcp-darwin-arm64 ./xiaohongshu-mcp-darwin-arm64 ``` -------------------------------- ### VSCode Configuration Source: https://context7.com/xpzouying/xiaohongshu-mcp/llms.txt Configuration example for VSCode to connect to the MCP service. ```APIDOC ## VSCode Configuration ### Description Configuration example for VSCode to connect to the MCP service. ### File Create a `.vscode/mcp.json` file in your project root. ### Configuration Example ```json { "servers": { "xiaohongshu-mcp": { "url": "http://localhost:18060/mcp", "type": "http" } }, "inputs": [] } ``` ``` -------------------------------- ### Verify MCP with Inspector Source: https://github.com/xpzouying/xiaohongshu-mcp/blob/main/docs/windows_guide.md Use this npx command to verify the Model Context Protocol (MCP) functionality after starting the services. This command requires Node.js to be installed. ```bash npx @modelcontextprotocol/inspector ``` -------------------------------- ### Cursor Configuration Source: https://context7.com/xpzouying/xiaohongshu-mcp/llms.txt Configuration example for Cursor IDE to connect to the MCP service. ```APIDOC ## Cursor Configuration ### Description Configuration example for Cursor IDE to connect to the MCP service. ### File Create a `.cursor/mcp.json` file in your project root. ### Configuration Example ```json { "mcpServers": { "xiaohongshu-mcp": { "url": "http://localhost:18060/mcp", "description": "小红书内容发布服务 - MCP Streamable HTTP" } } } ``` ``` -------------------------------- ### Publish content with local image paths Source: https://github.com/xpzouying/xiaohongshu-mcp/blob/main/README_EN.md Example prompt for publishing a post using local file system paths for images. ```text Help me write a post about spring to publish on RedNote, using these local images: - /Users/username/Pictures/spring_flowers.jpg - /Users/username/Pictures/cherry_blossom.jpg Use xiaohongshu-mcp for publishing. ``` -------------------------------- ### Install and Configure MCPorter for OpenClaw Source: https://github.com/xpzouying/xiaohongshu-mcp/blob/main/README.md Install MCPorter globally, configure it to connect to a specific MCP server, and then list the configured server. This is a workaround for OpenClaw's lack of native MCP support. ```bash npm i -g mcporter npx mcporter config add xiaohongshu-mcp http://localhost:18060/mcp npx mcporter list xiaohongshu-mcp ``` -------------------------------- ### Start and Stop Service Source: https://github.com/xpzouying/xiaohongshu-mcp/blob/main/deploy/macos/readme.md Commands to manually start or stop the Xiaohongshu MCP service via launchctl. ```bash launchctl start xhsmcp ``` ```bash launchctl stop xhsmcp ``` -------------------------------- ### Start MCP Service Source: https://github.com/xpzouying/xiaohongshu-mcp/blob/main/docs/windows_guide.md Run this command in the extracted directory to start the main xiaohongshu-mcp service after the login process is complete. ```bash ./xiaohongshu-mcp-windows-amd64.exe ``` -------------------------------- ### Publish video content Source: https://github.com/xpzouying/xiaohongshu-mcp/blob/main/README_EN.md Example prompt for publishing a video post using a local video file path. ```text Help me write a video post about cooking tutorials to publish on RedNote, using this local video file: - /Users/username/Videos/cooking_tutorial.mp4 Use xiaohongshu-mcp's video publishing feature. ``` -------------------------------- ### Publish content with HTTP image links Source: https://github.com/xpzouying/xiaohongshu-mcp/blob/main/README_EN.md Example prompt for publishing a post using an external image URL. ```text Help me write a post to publish on RedNote, with image: https://cn.bing.com/th?id=OHR.MaoriRock_EN-US6499689741_UHD.jpg&w=3840 The image is: "Maori rock carving at Ngātoroirangi Mine Bay, Lake Taupo, New Zealand (© Joppi/Getty Images)" Use xiaohongshu-mcp for publishing. ``` -------------------------------- ### Post Comment Response Source: https://context7.com/xpzouying/xiaohongshu-mcp/llms.txt Example response for successfully posting a comment. ```json { "success": true, "data": { "feed_id": "64f1a2b3c4d5e6f7a8b9c0d1", "success": true, "message": "评论发表成功" }, "message": "评论发表成功" } ``` -------------------------------- ### Start the MCP Service Source: https://context7.com/xpzouying/xiaohongshu-mcp/llms.txt Commands to run the Xiaohongshu MCP server using precompiled binaries, source code, or Docker. ```bash # 方式一:使用预编译二进制文件 # macOS Apple Silicon ./xiaohongshu-mcp-darwin-arm64 # 非无头模式(显示浏览器界面,便于调试) ./xiaohongshu-mcp-darwin-arm64 -headless=false # 指定端口 ./xiaohongshu-mcp-darwin-arm64 -port=:18060 # 方式二:源码编译运行 go run . # 方式三:Docker 部署 docker pull xpzouying/xiaohongshu-mcp docker compose up -d ``` -------------------------------- ### Run xiaohongshu-login executable Source: https://github.com/xpzouying/xiaohongshu-mcp/blob/main/docs/windows_guide.md Execute this command in the extracted directory to start the login process for xiaohongshu-mcp. This may trigger Windows Defender warnings. ```bash ./xiaohongshu-login-windows-amd64.exe ``` -------------------------------- ### Docker Compose Operations Source: https://github.com/xpzouying/xiaohongshu-mcp/blob/main/README.md Download the docker-compose.yml file and use Docker Compose to manage the service. Commands include starting, viewing logs, and stopping. ```bash # 下载 docker-compose.yml wget https://raw.githubusercontent.com/xpzouying/xiaohongshu-mcp/main/docker/docker-compose.yml # 或者如果已经克隆了项目,进入 docker 目录 cd docker # 启动服务 docker compose up -d # 查看日志 docker compose logs -f # 停止服务 docker compose stop ``` -------------------------------- ### Get Current User Info Response Source: https://context7.com/xpzouying/xiaohongshu-mcp/llms.txt Example response structure for the 'Get Current User Info' API call. ```json { "success": true, "data": { "data": { "userBasicInfo": { "nickname": "我的昵称", "desc": "我的简介", "redId": "my_xiaohongshu_id" }, "interactions": [ {"type": "follows", "name": "关注", "count": "100"}, {"type": "fans", "name": "粉丝", "count": "500"} ], "feeds": [] } }, "message": "获取我的主页成功" } ``` -------------------------------- ### Step-by-step publishing (Image/Text mode) Source: https://github.com/xpzouying/xiaohongshu-mcp/blob/main/skills/post-to-xhs/references/publish-workflow.md Manual step-by-step execution for image-based posts, supporting both headed and headless modes. ```bash # 1. 启动 Chrome(可选 --headless) python chrome_launcher.py python chrome_launcher.py --headless # 2. 检查登录(退出码 0=已登录, 1=未登录) python cdp_publish.py check-login python cdp_publish.py --headless check-login # 3. 填写表单 python cdp_publish.py fill --title "标题" --content-file body.txt --images img1.jpg python cdp_publish.py --headless fill --title "标题" --content-file body.txt --images img1.jpg # 4. 用户确认后点击发布 python cdp_publish.py click-publish # 或一步完成填写+发布 python cdp_publish.py --headless publish --title "标题" --content-file body.txt --images img1.jpg ``` -------------------------------- ### Search Feeds Response Structure Source: https://github.com/xpzouying/xiaohongshu-mcp/blob/main/docs/API.md Example JSON response for the 'Search Feeds' API. The structure is similar to the 'Get Feeds List' response. ```json { "success": true, "data": { "feeds": [ { "xsecToken": "security_token_value", "id": "feed_id_1", "modelType": "note", "noteCard": { "type": "normal", "displayTitle": "相关笔记标题", "user": { "userId": "user_id_1", "nickname": "用户昵称", "avatar": "https://example.com/avatar.jpg" }, "interactInfo": { "liked": false, "likedCount": "80", "collected": false, "collectedCount": "40", "commentCount": "35", "sharedCount": "15" }, "cover": { "width": 1080, "height": 1440, "url": "https://example.com/cover.jpg", "urlDefault": "https://example.com/cover_default.jpg" }, "video": null }, "index": 0 } ], "count": 5 }, "message": "搜索Feeds成功" } ``` -------------------------------- ### Feeds List Response Structure Source: https://github.com/xpzouying/xiaohongshu-mcp/blob/main/docs/API.md Example JSON response for the 'Get Feeds List' API. Includes feed details and interaction counts. ```json { "success": true, "data": { "feeds": [ { "xsecToken": "security_token_value", "id": "feed_id_1", "modelType": "note", "noteCard": { "type": "normal", "displayTitle": "笔记标题", "user": { "userId": "user_id_1", "nickname": "用户昵称", "nickName": "用户昵称", "avatar": "https://example.com/avatar.jpg" }, "interactInfo": { "liked": false, "likedCount": "100", "collected": false, "collectedCount": "50", "commentCount": "30", "sharedCount": "10" }, "cover": { "width": 1080, "height": 1440, "url": "https://example.com/cover.jpg", "urlDefault": "https://example.com/cover_default.jpg", "urlPre": "https://example.com/cover_pre.jpg", "fileId": "file_id", "infoList": [ { "imageScene": "WB_DFT", "url": "https://example.com/image.jpg" } ] }, "video": { "capa": { "duration": 60 } } }, "index": 0 } ], "count": 10 }, "message": "获取Feeds列表成功" } ``` -------------------------------- ### Run Login Tool (Source) Source: https://github.com/xpzouying/xiaohongshu-mcp/blob/main/README.md Compile and run the login tool from source using Go. ```bash go run cmd/login/main.go ``` -------------------------------- ### Run Login Tool (Binary) Source: https://github.com/xpzouying/xiaohongshu-mcp/blob/main/README.md Execute the login tool binary for the corresponding platform to save login status. ```bash # 运行对应平台的登录工具 ./xiaohongshu-login-darwin-arm64 ``` -------------------------------- ### Search Feeds API (GET) Source: https://github.com/xpzouying/xiaohongshu-mcp/blob/main/docs/API.md Searches for feeds using a keyword via GET request. Suitable for simple keyword searches. ```http GET /api/v1/feeds/search?keyword=搜索关键词 ``` -------------------------------- ### 构建 Docker 镜像 Source: https://github.com/xpzouying/xiaohongshu-mcp/blob/main/docker/README.md 在包含 Dockerfile 的目录下手动构建镜像。 ```bash docker build -t xpzouying/xiaohongshu-mcp . ``` -------------------------------- ### CLI 发布流程 (有窗口模式) Source: https://github.com/xpzouying/xiaohongshu-mcp/blob/main/skills/post-to-xhs/references/publish-workflow.md 使用 Python 脚本通过有窗口模式自动化发布小红书内容,适用于调试或首次登录。 ```bash python publish_pipeline.py --title "标题" --content "正文" --image-urls URL1 URL2 ``` -------------------------------- ### CLI 发布流程 (无头模式) Source: https://github.com/xpzouying/xiaohongshu-mcp/blob/main/skills/post-to-xhs/references/publish-workflow.md 使用 Python 脚本通过无头模式自动化发布小红书内容,支持通过 URL 或本地文件指定图片。 ```bash python publish_pipeline.py --headless --title "标题" --content "正文" --image-urls URL1 URL2 ``` ```bash python publish_pipeline.py --headless --title-file title.txt --content-file body.txt --image-urls URL1 ``` ```bash python publish_pipeline.py --headless --title "标题" --content "正文" --images img1.jpg img2.jpg ``` -------------------------------- ### Get Current Logged-in User Information Source: https://github.com/xpzouying/xiaohongshu-mcp/blob/main/docs/API.md Retrieve the profile information of the currently logged-in user. This endpoint does not require a user_id or xsec_token. The response structure is identical to the 'Get User Profile Information' endpoint. ```http GET /api/v1/user/me ``` ```json { "success": true, "data": { "data": { "userBasicInfo": { "nickname": "当前用户昵称", "desc": "个人描述", "redId": "xiaohongshu_id", "gender": 1, "ipLocation": "浙江", "images": "https://example.com/my_avatar.jpg", "imageb": "https://example.com/my_background.jpg" }, "interactions": [ { "type": "follows", "name": "关注", "count": "100" }, { "type": "fans", "name": "粉丝", "count": "500" }, { "type": "interaction", "name": "获赞与收藏", "count": "2000" } ], "feeds": [ { "xsecToken": "security_token_value", "id": "feed_id_1", "modelType": "note", "noteCard": { "displayTitle": "我的笔记标题", "interactInfo": { "likedCount": "50", "collectedCount": "30" } }, "index": 0 } ] } }, "message": "获取我的主页成功" } ``` -------------------------------- ### GET /api/v1/feeds/list Source: https://context7.com/xpzouying/xiaohongshu-mcp/llms.txt Retrieves a list of feeds. ```APIDOC ## GET /api/v1/feeds/list ### Description Retrieves a list of feeds from the platform. ### Method GET ### Endpoint /api/v1/feeds/list ### Response #### Success Response (200) - **success** (boolean) - Status of the request - **data** (object) - Contains feeds list and count - **message** (string) - Status message ``` -------------------------------- ### 拉取 Docker 镜像 Source: https://github.com/xpzouying/xiaohongshu-mcp/blob/main/docker/README.md 从 Docker Hub 或阿里云镜像源获取预构建的镜像。 ```bash # 拉取最新镜像 docker pull xpzouying/xiaohongshu-mcp ``` ```bash # 拉取最新镜像 docker pull crpi-hocnvtkomt7w9v8t.cn-beijing.personal.cr.aliyuncs.com/xpzouying/xiaohongshu-mcp ``` -------------------------------- ### GET /api/v1/feeds/list Source: https://github.com/xpzouying/xiaohongshu-mcp/blob/main/docs/API.md Retrieves a list of user feeds. ```APIDOC ## GET /api/v1/feeds/list ### Description Retrieves the current user's Feeds list. ### Method GET ### Endpoint /api/v1/feeds/list ### Response #### Success Response (200) - **success** (boolean) - Status of the request - **data** (object) - Contains the list of feeds and count - **message** (string) - Status message #### Response Example { "success": true, "data": { "feeds": [ { "xsecToken": "security_token_value", "id": "feed_id_1", "modelType": "note", "noteCard": { "type": "normal", "displayTitle": "笔记标题", "user": { "userId": "user_id_1", "nickname": "用户昵称", "avatar": "https://example.com/avatar.jpg" }, "interactInfo": { "liked": false, "likedCount": "100", "collected": false, "collectedCount": "50", "commentCount": "30", "sharedCount": "10" } } } ], "count": 10 }, "message": "获取Feeds列表成功" } ``` -------------------------------- ### Get Home Feed Source: https://context7.com/xpzouying/xiaohongshu-mcp/llms.txt Retrieve the Xiaohongshu home recommendation feed. ```bash # HTTP API curl -X GET http://localhost:18060/api/v1/feeds/list ``` -------------------------------- ### 执行长文模式发布流程 Source: https://github.com/xpzouying/xiaohongshu-mcp/blob/main/skills/post-to-xhs/SKILL.md 长文模式下的内容填写、模板选择及发布步骤。 ```bash python "C:\Users\admin\AI\.claude\skills\post-to-xhs\scripts\cdp_publish.py" long-article --title-file title.txt --content-file content.txt ``` ```bash python "C:\Users\admin\AI\.claude\skills\post-to-xhs\scripts\cdp_publish.py" select-template --name "用户选择的模板名" ``` ```bash python "C:\Users\admin\AI\.claude\skills\post-to-xhs\scripts\cdp_publish.py" click-next-step --content-file content.txt ``` ```bash python "C:\Users\admin\AI\.claude\skills\post-to-xhs\scripts\cdp_publish.py" click-publish ``` -------------------------------- ### GET /api/v1/user/me Source: https://github.com/xpzouying/xiaohongshu-mcp/blob/main/docs/API.md Retrieves the profile information for the currently logged-in user. ```APIDOC ## GET /api/v1/user/me ### Description Retrieves the profile information for the currently logged-in user. No parameters required. ### Method GET ### Endpoint /api/v1/user/me ### Response #### Success Response (200) - **success** (boolean) - Status of the request - **data** (object) - Current user profile data #### Response Example { "success": true, "data": { "data": { "userBasicInfo": { "nickname": "当前用户昵称", "desc": "个人描述", "redId": "xiaohongshu_id", "gender": 1 } } }, "message": "获取我的主页成功" } ``` -------------------------------- ### Reply Comment Response Source: https://context7.com/xpzouying/xiaohongshu-mcp/llms.txt Example response for successfully replying to a comment. ```json { "success": true, "data": { "feed_id": "64f1a2b3c4d5e6f7a8b9c0d1", "target_comment_id": "comment_id_to_reply", "success": true, "message": "回复评论成功" }, "message": "回复评论成功" } ``` -------------------------------- ### 执行图文模式发布 Source: https://github.com/xpzouying/xiaohongshu-mcp/blob/main/skills/post-to-xhs/SKILL.md 使用 publish_pipeline.py 执行图文发布,支持无头模式与有窗口模式。 ```bash python "C:\Users\admin\AI\.claude\skills\post-to-xhs\scripts\publish_pipeline.py" --headless --title-file title.txt --content-file content.txt --image-urls "URL1" "URL2" ``` ```bash python "C:\Users\admin\AI\.claude\skills\post-to-xhs\scripts\publish_pipeline.py" --title-file title.txt --content-file content.txt --image-urls "URL1" "URL2" ``` -------------------------------- ### Configure MCP Server (Cursor Project) Source: https://github.com/xpzouying/xiaohongshu-mcp/blob/main/README.md Configure an MCP server for a specific project by creating a `.cursor/mcp.json` file in the project root. This method is recommended for project-specific settings. ```json { "mcpServers": { "xiaohongshu-mcp": { "url": "http://localhost:18060/mcp", "description": "小红书内容发布服务 - MCP Streamable HTTP" } } } ``` -------------------------------- ### 启动 Docker Compose 服务 Source: https://github.com/xpzouying/xiaohongshu-mcp/blob/main/examples/n8n/README.md 在包含 docker-compose.yml 文件的目录下运行此命令以启动 n8n 服务。 ```bash docker-compose up -d ``` -------------------------------- ### GET /api/v1/login/status Source: https://context7.com/xpzouying/xiaohongshu-mcp/llms.txt Checks the current user's login status on Xiaohongshu. ```APIDOC ## GET /api/v1/login/status ### Description Checks the current user's Xiaohongshu login status and returns the username if logged in. ### Method GET ### Endpoint /api/v1/login/status ### Response #### Success Response (200) - **success** (boolean) - Indicates if the request was successful - **data** (object) - Contains login details - **message** (string) - Status message #### Response Example { "success": true, "data": { "is_logged_in": true, "username": "用户名" }, "message": "检查登录状态成功" } ``` -------------------------------- ### Step-by-step publishing (Long-article mode) Source: https://github.com/xpzouying/xiaohongshu-mcp/blob/main/skills/post-to-xhs/references/publish-workflow.md Sequential commands for publishing long-form articles, including template selection and formatting. ```bash # 1. 启动 Chrome python chrome_launcher.py # 2. 检查登录 python cdp_publish.py check-login # 3. 填写长文 + 一键排版(输出包含 TEMPLATES JSON) python cdp_publish.py long-article --title-file title.txt --content-file content.txt # 4. 选择模板 python cdp_publish.py select-template --name "模板名称" # 5. 下一步 + 填写发布页正文描述 python cdp_publish.py click-next-step --content-file content.txt # 6. 用户确认后点击发布 python cdp_publish.py click-publish ``` -------------------------------- ### Docker 直接部署 n8n Source: https://github.com/xpzouying/xiaohongshu-mcp/blob/main/examples/n8n/README.md 使用 `docker run` 命令直接部署 n8n,配置端口映射、数据卷挂载和环境变量。 ```bash docker run -it --name n8nChinese \ -p 5678:5678 \ -v "/path/to/editor-ui-dist:/usr/local/lib/node_modules/n8n/node_modules/n8n-editor-ui/dist" \ -v "${HOME}/.n8n:/home/node/.n8n" \ -e N8N_DEFAULT_LOCALE=zh-CN \ -e N8N_SECURE_COOKIE=false \ n8nio/n8n ``` -------------------------------- ### GET /api/v1/login/qrcode Source: https://context7.com/xpzouying/xiaohongshu-mcp/llms.txt Retrieves a QR code for user authentication via the Xiaohongshu App. ```APIDOC ## GET /api/v1/login/qrcode ### Description Fetches a Base64 encoded QR code image for scanning with the Xiaohongshu App to log in. ### Method GET ### Endpoint /api/v1/login/qrcode ### Response #### Success Response (200) - **data** (object) - Contains timeout, login status, and base64 image string #### Response Example { "success": true, "data": { "timeout": "300", "is_logged_in": false, "img": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..." }, "message": "获取登录二维码成功" } ``` -------------------------------- ### Publish Video Content Source: https://context7.com/xpzouying/xiaohongshu-mcp/llms.txt Publish video notes using local file paths. ```bash # HTTP API curl -X POST http://localhost:18060/api/v1/publish_video \ -H "Content-Type: application/json" \ -d '{ "title": "周末露营vlog", "content": "记录一下周末和朋友们去露营的美好时光~", "video": "/Users/username/Videos/camping.mp4", "tags": ["露营", "户外", "vlog"], "visibility": "公开可见" }' # 响应示例 { "success": true, "data": { "title": "周末露营vlog", "content": "记录一下周末和朋友们去露营的美好时光~", "video": "/Users/username/Videos/camping.mp4", "status": "发布完成", "post_id": "64f1a2b3c4d5e6f7a8b9c0d1" }, "message": "视频发布成功" } # MCP 工具调用 { "jsonrpc": "2.0", "method": "tools/call", "params": { "name": "publish_with_video", "arguments": { "title": "周末露营vlog", "content": "记录一下周末和朋友们去露营的美好时光~", "video": "/Users/username/Videos/camping.mp4", "tags": ["露营", "户外", "vlog"] } }, "id": 5 } ``` -------------------------------- ### Get User Profile API Source: https://context7.com/xpzouying/xiaohongshu-mcp/llms.txt Fetches user profile information using a POST request. ```bash # HTTP API curl -X POST http://localhost:18060/api/v1/user/profile \ -H "Content-Type: application/json" \ -d '{ "user_id": "64f1a2b3c4d5e6f7a8b9c0d1", "xsec_token": "security_token_here" }' ``` -------------------------------- ### Get Login QR Code Source: https://context7.com/xpzouying/xiaohongshu-mcp/llms.txt Fetch a Base64 encoded QR code for app-based login. ```bash # HTTP API curl -X GET http://localhost:18060/api/v1/login/qrcode # 响应示例 { "success": true, "data": { "timeout": "300", "is_logged_in": false, "img": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..." }, "message": "获取登录二维码成功" } # MCP 工具调用 { "jsonrpc": "2.0", "method": "tools/call", "params": { "name": "get_login_qrcode", "arguments": {} }, "id": 2 } ``` -------------------------------- ### List MCP Servers (CLI) Source: https://github.com/xpzouying/xiaohongshu-mcp/blob/main/README.md Use this command to verify that an MCP server has been successfully added and is running. ```bash claude mcp list ``` -------------------------------- ### 账号管理操作 Source: https://github.com/xpzouying/xiaohongshu-mcp/blob/main/skills/post-to-xhs/SKILL.md 用于列出、添加、登录、切换及设置默认账号的命令。 ```bash python "C:\Users\admin\AI\.claude\skills\post-to-xhs\scripts\cdp_publish.py" list-accounts ``` ```bash python "C:\Users\admin\AI\.claude\skills\post-to-xhs\scripts\cdp_publish.py" add-account myaccount --alias "我的账号" ``` ```bash # 默认账号 python "C:\Users\admin\AI\.claude\skills\post-to-xhs\scripts\cdp_publish.py" login # 指定账号 python "C:\Users\admin\AI\.claude\skills\post-to-xhs\scripts\cdp_publish.py" --account myaccount login ``` ```bash python "C:\Users\admin\AI\.claude\skills\post-to-xhs\scripts\cdp_publish.py" switch-account python "C:\Users\admin\AI\.claude\skills\post-to-xhs\scripts\cdp_publish.py" --account otheraccount switch-account ``` ```bash python "C:\Users\admin\AI\.claude\skills\post-to-xhs\scripts\cdp_publish.py" set-default-account myaccount ``` -------------------------------- ### Cline Usage Examples Source: https://github.com/xpzouying/xiaohongshu-mcp/blob/main/README_EN.md Natural language prompts for interacting with the RedNote MCP service in Cline. ```text Help me check RedNote login status ``` ```text Help me publish a spring-themed image-text post to RedNote, using this image: /path/to/spring.jpg ``` ```text Search for content about "food" on RedNote ``` -------------------------------- ### Get User Profile Source: https://context7.com/xpzouying/xiaohongshu-mcp/llms.txt Retrieves the profile information for a specified user, including basic info, interactions, and feeds. ```APIDOC ## GET /api/v1/user/profile ### Description Retrieves the profile information for a specified user, including basic info, interactions, and feeds. ### Method GET ### Endpoint /api/v1/user/profile ### Parameters #### Query Parameters - **user_id** (string) - Required - The ID of the user whose profile to retrieve. - **xsec_token** (string) - Required - Security token for the request. ### Response #### Success Response (200) - **success** (boolean) - Indicates if the request was successful. - **data** (object) - Contains the user profile data. - **data** (object) - **userBasicInfo** (object) - **nickname** (string) - User's nickname. - **desc** (string) - User's profile description. - **redId** (string) - User's Xiaohongshu ID. - **gender** (integer) - User's gender (e.g., 1 for male, 2 for female). - **ipLocation** (string) - User's IP location. - **images** (string) - URL to the user's avatar. - **interactions** (array) - List of user interactions. - **type** (string) - Type of interaction (e.g., 'follows', 'fans'). - **name** (string) - Name of the interaction (e.g., '关注', '粉丝'). - **count** (string) - Number of interactions. - **feeds** (array) - List of user's feeds. - **xsecToken** (string) - Security token for the feed. - **id** (string) - ID of the feed. - **noteCard** (object) - **displayTitle** (string) - Display title of the note card. - **message** (string) - A message indicating the result of the request. ### Response Example ```json { "success": true, "data": { "data": { "userBasicInfo": { "nickname": "用户昵称", "desc": "个人简介", "redId": "xiaohongshu_id", "gender": 1, "ipLocation": "浙江", "images": "https://example.com/avatar.jpg" }, "interactions": [ {"type": "follows", "name": "关注", "count": "1000"}, {"type": "fans", "name": "粉丝", "count": "5000"}, {"type": "interaction", "name": "获赞与收藏", "count": "10000"} ], "feeds": [ { "xsecToken": "token", "id": "feed_id", "noteCard": { "displayTitle": "笔记标题" } } ] } }, "message": "获取用户主页成功" } ``` ``` -------------------------------- ### Get Feeds List API Source: https://github.com/xpzouying/xiaohongshu-mcp/blob/main/docs/API.md Retrieves a list of user feeds. Use this endpoint to fetch content for display. ```http GET /api/v1/feeds/list ``` -------------------------------- ### 管理 Docker Compose 容器 Source: https://github.com/xpzouying/xiaohongshu-mcp/blob/main/docker/README.md 启动、停止及查看容器状态的常用命令。 ```bash # 注意:在 docker-compose.yml 文件的同一个目录,或者手动指定 docker-compose.yml。 # --- 启动 docker 容器 --- # 启动 docker-compose docker compose up -d # 查看日志 docker logs -f xpzouying/xiaohongshu-mcp # 或者 docker compose logs -f ``` ```bash # 停止 docker-compose docker compose stop # 查看实时日志 docker logs -f xpzouying/xiaohongshu-mcp # 进入容器 docker exec -it xiaohongshu-mcp bash # 手动更新容器 docker compose pull && docker compose up -d ``` -------------------------------- ### List MCP Servers (Open Code CLI) Source: https://github.com/xpzouying/xiaohongshu-mcp/blob/main/README.md After adding an MCP server using `opencode mcp add`, use this command to list all configured MCP servers and their connection status. ```bash opencode mcp list ``` -------------------------------- ### 图文发布附加参数 Source: https://github.com/xpzouying/xiaohongshu-mcp/blob/main/skills/post-to-xhs/SKILL.md 指定账号或使用本地图片路径的发布参数示例。 ```bash # 发布到指定账号 python ... --account myaccount ... # 使用本地图片 python ... --images "C:\path\to\image.jpg" ``` -------------------------------- ### Get Current User Info Source: https://context7.com/xpzouying/xiaohongshu-mcp/llms.txt Retrieves the personal information of the currently logged-in user without requiring a user ID. ```APIDOC ## GET /api/v1/user/me ### Description Retrieves the personal information of the currently logged-in user. No `user_id` parameter is needed. ### Method GET ### Endpoint /api/v1/user/me ### Response #### Success Response (200) - **success** (boolean) - Indicates if the request was successful. - **data** (object) - Contains the user's profile data. - **data** (object) - **userBasicInfo** (object) - **nickname** (string) - User's nickname. - **desc** (string) - User's profile description. - **redId** (string) - User's Xiaohongshu ID. - **interactions** (array) - List of user interactions. - **type** (string) - Type of interaction (e.g., 'follows', 'fans'). - **name** (string) - Name of the interaction (e.g., '关注', '粉丝'). - **count** (string) - Number of interactions. - **feeds** (array) - List of user's feeds (empty in this example). - **message** (string) - A message indicating the result of the request. ### Response Example ```json { "success": true, "data": { "data": { "userBasicInfo": { "nickname": "我的昵称", "desc": "我的简介", "redId": "my_xiaohongshu_id" }, "interactions": [ {"type": "follows", "name": "关注", "count": "100"}, {"type": "fans", "name": "粉丝", "count": "500"} ], "feeds": [] } }, "message": "获取我的主页成功" } ``` ``` -------------------------------- ### Search Feeds API Source: https://github.com/xpzouying/xiaohongshu-mcp/blob/main/docs/API.md Search for feeds using keywords via GET or POST methods, with support for advanced filtering. ```APIDOC ## GET /api/v1/feeds/search ### Description Search Feeds by keyword using a GET request. ### Method GET ### Endpoint /api/v1/feeds/search ### Parameters #### Query Parameters - **keyword** (string) - Required - The search term ## POST /api/v1/feeds/search ### Description Search Feeds by keyword with advanced filtering using a POST request. ### Method POST ### Endpoint /api/v1/feeds/search ### Request Body - **keyword** (string) - Required - The search term - **filters** (object) - Optional - Advanced filtering options (sort_by, note_type, publish_time, search_scope, location) ### Request Example { "keyword": "搜索关键词", "filters": { "sort_by": "综合", "note_type": "不限", "publish_time": "不限", "search_scope": "不限", "location": "不限" } } ```