{
  "markdown": "# xiaohongshu-mcp-server\n\n<!-- mcp-name: io.github.shanyang-me/xiaohongshu-mcp -->\n\nA [Model Context Protocol (MCP)](https://modelcontextprotocol.io) server for [Xiaohongshu (Little Red Book)](https://www.xiaohongshu.com) - China's leading lifestyle social media platform.\n\nPublish image notes, search content, view note details, and manage your account - all through MCP tools that AI assistants can use directly.\n\n## How It Works\n\nUses **Playwright** to run a headless Chromium browser that:\n1. Loads your XHS session cookies\n2. Generates authentic API signatures via the XHS web app's built-in signing function\n3. Makes API calls through the browser's network context (bypasses anti-bot detection)\n4. Uploads images directly to XHS CDN\n\nNo browser automation of UI elements - all interactions go through XHS's internal API.\n\n## Tools\n\n| Tool | Description |\n|------|-------------|\n| `check_login_status` | Check if you're logged in |\n| `get_login_qrcode` | Generate QR code for login |\n| `check_qrcode_status` | Poll QR scan status & save session |\n| `reload_cookies` | Reload cookies from disk |\n| `publish_content` | Publish an image note with title, text, images, and tags |\n| `search_feeds` | Search XHS notes by keyword |\n| `get_feed_detail` | Get full details of a note |\n| `user_profile` | Get user profile information |\n\n## Installation\n\n```bash\npip install xiaohongshu-mcp-server\nplaywright install chromium\n```\n\nFor QR code image generation (optional):\n```bash\npip install \"xiaohongshu-mcp[qrcode]\"\n```\n\n## Quick Start\n\n### 1. Start the server\n\n**HTTP mode** (for Claude Code, Cursor, etc.):\n```bash\nxhs-mcp --transport http --port 18060\n```\n\n**stdio mode** (for Claude Desktop):\n```bash\nxhs-mcp --transport stdio\n```\n\n### 2. Login\n\nCall the `get_login_qrcode` tool, scan the QR code with the Xiaohongshu app, then call `check_qrcode_status` with the returned `qr_id` and `code`. Cookies are saved to `~/.xhs-mcp/cookies.json` and persist across restarts.\n\n### 3. Use\n\nAsk your AI assistant to publish a note, search for content, etc.\n\n## Configuration\n\n### Claude Desktop\n\nAdd to `~/Library/Application Support/Claude/claude_desktop_config.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"xhs-mcp\": {\n      \"command\": \"xhs-mcp\",\n      \"args\": [\"--transport\", \"stdio\"]\n    }\n  }\n}\n```\n\n### Claude Code\n\n```bash\nclaude mcp add xhs-mcp --transport http http://localhost:18060/mcp\n```\n\nThen start the server: `xhs-mcp`\n\n### As a LaunchAgent (macOS auto-start)\n\nCreate `~/Library/LaunchAgents/com.xhs-mcp.plist`:\n\n```xml\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n    <key>Label</key>\n    <string>com.xhs-mcp</string>\n    <key>ProgramArguments</key>\n    <array>\n        <string>/path/to/your/venv/bin/xhs-mcp</string>\n    </array>\n    <key>RunAtLoad</key>\n    <true/>\n    <key>KeepAlive</key>\n    <true/>\n    <key>StandardOutPath</key>\n    <string>/tmp/xhs-mcp.log</string>\n    <key>StandardErrorPath</key>\n    <string>/tmp/xhs-mcp.err</string>\n</dict>\n</plist>\n```\n\n```bash\nlaunchctl load ~/Library/LaunchAgents/com.xhs-mcp.plist\n```\n\n## Example: Publish a Note\n\n```python\n# Via MCP tool call\npublish_content(\n    title=\"Hello XHS!\",\n    content=\"My first post published via MCP.\",\n    images=[\"/path/to/photo.jpg\"],\n    tags=[\"MCP\", \"AI\"]\n)\n```\n\n## Requirements\n\n- Python 3.12+\n- Chromium (installed via `playwright install chromium`)\n- A Xiaohongshu account\n\n## License\n\nMIT\n",
  "bytes": 3507,
  "sha": "4d8df23f5e7b151d2ef1333b98c1dfa4152b6af49defbc57ecba150f2570171f",
  "repo_slug": "shanyang-me/xhs-mcp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_shanyang_me_xiaohongshu_mcp_937cc9b3/readme"
}