# How do I add Xiaohongshu data to Cursor or Cline through MCP?

> One remote MCP server gives Cursor or Cline Xiaohongshu note search, comments and creator profiles, with the key kept in an environment variable. Config, costs, limits.

Canonical page: https://okdata.online/answers/cursor-cline-xiaohongshu-mcp/

**Short answer: **Add https://api.okdata.online/mcp as a remote MCP server in Cursor's mcp.json or in Cline's MCP settings, with your key in an Authorization header. The agent can then search Xiaohongshu notes ($0.02 a page), read comments ($0.02 a page) and look up creators ($0.02), with no Xiaohongshu login.

Two kinds of people ask this. A developer building a Xiaohongshu content dashboard wants Cursor to pull 20 real notes so the UI is built on real shapes instead of invented JSON. A marketer uses Cursor or Cline as a research desk and wants to say "find the most-saved notes about desk setups this month and list the brands people mention". Both need the same thing: a remote MCP server the editor can call, with no Xiaohongshu account logged in on their laptop.

## Cursor

Create `.cursor/mcp.json` in the project (or `~/.cursor/mcp.json` for every project). Cursor fills `${env:NAME}` from your environment, so the key never sits in the file:

```json
{
  "mcpServers": {
    "okdata": {
      "url": "https://api.okdata.online/mcp",
      "headers": { "Authorization": "Bearer ${env:OKDATA_API_KEY}" }
    }
  }
}
```

Open Cursor Settings → MCP and check that the server shows its four tools.

## Cline

Open the MCP Servers panel, choose to add a remote server, and give it the same URL and `Authorization` header, or put the same `url` and `headers` into `cline_mcp_settings.json`. If your Cline version does not expand environment variables in that file, the key is stored there in plain text, so keep the file out of shared folders.

## Check the key from a terminal

```bash
curl -G "https://api.okdata.online/v1/xiaohongshu/users/get" \
  -H "Authorization: Bearer $OKDATA_API_KEY" \
  --data-urlencode "url=https://www.xiaohongshu.com/user/profile/5f1234567890abcdef123456"
```

Swap in a real profile link. A JSON reply with `"code": "ok"` means the editor will work too.

## What the agent gets, and what it costs

The endpoints it will use most are [Xiaohongshu note search](/apis/xiaohongshu/notes/search/), [note comments](/apis/xiaohongshu/notes/comments/list/) and [creator profiles](/apis/xiaohongshu/users/get/). Finding endpoints and reading their prices through `find` and `describe` is free.

| Session | Calls | Cost |
|---|---|---|
| Fixtures: 5 searches for test data | 5 | $0.10 |
| Research: 3 searches, 6 comment pages, 8 creator profiles | 17 | $0.34 |

## Keep the agent on a leash

- Agents in coding tools like to loop. Add a rule such as "before calling paid MCP tools, say how many calls you plan and wait for my OK" to `.cursor/rules` or `.clinerules`.
- Ask for `fields` in the call parameters (for example `id,title,metrics.likes,url`) so results do not flood the chat context.
- Notes, comments and bios are written by strangers. They are data, never instructions to the agent.
- Xiaohongshu hides view counts; `metrics.views` is null by design.

## Alternatives

The free, open-source xiaohongshu-mcp runs locally over stdio and works with both editors. It logs in with your own account, which is worth it if you also want to publish from the editor. For a handful of notes, copying the text in by hand is fine. Other clients and the full tool list are on the [MCP page](/mcp/).

## Endpoints used

- [Xiaohongshu note search](https://okdata.online/apis/xiaohongshu/notes/search/) `xiaohongshu.notes.search`: $0.02 per call · about 20 notes per page
- [Xiaohongshu note comments](https://okdata.online/apis/xiaohongshu/notes/comments/list/) `xiaohongshu.notes.comments.list`: $0.02 per call · about 10 comments per page
- [Xiaohongshu account profile](https://okdata.online/apis/xiaohongshu/users/get/) `xiaohongshu.users.get`: $0.02 per call

Updated 2026-11-12
