# DataFlow Xiaohongshu MCP — Agent Setup Guide

> Hosted, read-only Xiaohongshu (RedNote) MCP server via Streamable HTTP.
> Zero XHS account, zero cookies, zero local Playwright installation required.

## Endpoint & Auth

- **Hosted MCP URL**: `https://dataflowserver.org/mcp`
- **Transport**: Streamable HTTP (stateless)
- **Discovery**: `initialize` and `tools/list` work without authentication
- **Tool call auth**:
  - `Authorization: Bearer YOUR_DATAFLOW_TOKEN` (recommended)
  - or `X-API-Key: YOUR_DATAFLOW_TOKEN`
- **Register & Top-up**: `https://dataflowserver.org/register/` · `https://dataflowserver.org/login/`
- **Server Card**: `https://dataflowserver.org/.well-known/mcp/server-card.json`

## Configure Automatically

### Cursor / Trae / Windsurf / Cline (`mcp.json`)

```json
{
  "mcpServers": {
    "xiaohongshu": {
      "url": "https://dataflowserver.org/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_DATAFLOW_TOKEN"
      }
    }
  }
}
```

### Claude Code CLI

```bash
claude mcp add --transport http xiaohongshu https://dataflowserver.org/mcp \
  --header "Authorization: Bearer YOUR_DATAFLOW_TOKEN"
```

### Security Rules for Agents

- Never ask the user for Xiaohongshu account credentials, cookies, or SMS codes.
- Write `YOUR_DATAFLOW_TOKEN` as a placeholder first and let the user replace it locally unless the user explicitly provides their DataFlow Token.
- Never commit or echo real tokens in repositories, logs, or public outputs.

## Available Tools (Read-Only XHS V2)

1 CNY = 1,000 DataFlow Tokens (Alipay self-service top-up):

| Tool | Description | Cost |
|---|---|---:|
| `xhs_v2_search_notes` | Search notes with sort/type/time filters | 60 Token (~¥0.06) |
| `xhs_v2_get_note` | Get normalized note details | 45 Token (~¥0.045) |
| `xhs_v2_get_full_note` | Get full raw note details | 60 Token (~¥0.06) |
| `xhs_v2_get_comments` | Get top-level comments (latest/hottest) | 45 Token (~¥0.045) |
| `xhs_v2_get_subcomments` | Get replies under a comment | 45 Token (~¥0.045) |
| `xhs_v2_get_user` | Get normalized creator profile | 45 Token (~¥0.045) |
| `xhs_v2_get_full_user` | Get full creator profile | 60 Token (~¥0.06) |
| `xhs_v2_list_user_notes` | List notes published by a creator | 60 Token (~¥0.06) |

## Guides & Docs

- Without-login comparison: `https://dataflowserver.org/guides/xiaohongshu-mcp-without-login/`
- Client setup & prompt examples: `https://dataflowserver.org/guides/cursor-claude-xiaohongshu-mcp/`
- OpenAPI spec: `https://dataflowserver.org/api/docs/openapi.json`
- Open-source self-hostable repo: `https://github.com/submato/apiserver-xhs-mcp`
