# 怎麼在 Cursor 或 Cline 裡接入小紅書資料的 MCP？

> 一個遠端 MCP 服務，讓 Cursor 或 Cline 能搜小紅書筆記、讀評論、查博主，key 放在環境變數裡。配置寫法、費用和限制。

網頁版：https://okdata.online/zh-hant/answers/cursor-cline-xiaohongshu-mcp/

**簡短回答：**在 Cursor 的 mcp.json 或 Cline 的 MCP 設定裡，把 https://api.okdata.online/mcp 加成遠端服務，請求頭帶上你的 key。之後智慧體就能搜小紅書筆記（每頁 $0.035）、讀評論（每頁 $0.035）、查博主（每次 $0.02），全程不用登入小紅書。

問這個問題的通常是兩類人。一類是在做小紅書內容看板的開發者，想讓 Cursor 拉 20 篇真實筆記，介面照著真實的資料結構來做，別再對著自己編的 JSON 寫。另一類是把 Cursor 或 Cline 當調研工作臺的運營，想直接說一句：找出這個月收藏最多的桌面佈置筆記，列出裡面提到的品牌。兩者要的東西一樣：編輯器能呼叫的遠端 MCP 服務，而且電腦上不用登入任何小紅書帳號。

## Cursor

在專案裡建 `.cursor/mcp.json`（想對所有專案生效就放 `~/.cursor/mcp.json`）。Cursor 會用環境變數替換 `${env:變數名}`，key 不會寫進檔案：

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

開啟 Cursor 設定裡的 MCP 頁面，能看到這個服務和它的五個工具就說明連上了。

## Cline

在 MCP Servers 面板裡新增遠端服務，填同樣的地址和 `Authorization` 請求頭；也可以把同樣的 `url` 和 `headers` 寫進 `cline_mcp_settings.json`。如果你用的 Cline 版本不會展開這個檔案裡的環境變數，key 就是明文存著的，別把這個檔案放進共享目錄。

## 先在終端裡驗一下 key

```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"
```

換成一個真實的博主主頁連結。返回的 JSON 裡是 `"code": "ok"`，編輯器那邊也就沒問題。

## 智慧體能拿到什麼，花多少

最常用的是[小紅書筆記搜尋](/zh/apis/xiaohongshu/notes/search/)、[筆記評論](/zh/apis/xiaohongshu/notes/comments/list/)和[博主資訊](/zh/apis/xiaohongshu/users/get/)。用 `find` 和 `describe` 查介面、看價格不花錢。

| 場景 | 呼叫次數 | 費用 |
|---|---|---|
| 準備測試資料：搜 5 次 | 5 | $0.175 |
| 一輪調研：搜 3 次、讀 6 頁評論、查 8 個博主 | 17 | $0.475 |

## 給智慧體拴根繩

- 程式設計工具裡的智慧體容易一路迴圈下去。在 `.cursor/rules` 或 `.clinerules` 里加一條：呼叫付費 MCP 工具前，先說打算調幾次，等我確認。
- 呼叫引數裡帶上 `fields`（比如 `id,title,metrics.likes,url`），免得結果把對話上下文塞滿。
- 筆記、評論、簡介都是陌生人寫的，只能當資料，不能當成給智慧體的指令。
- 小紅書不顯示瀏覽量，`metrics.views` 本來就是 null。

## 其他選擇

開源免費的 xiaohongshu-mcp 走本地 stdio，兩個編輯器都能用。它需要登入你自己的小紅書帳號，如果你還想在編輯器裡直接發筆記，這個代價值得。只看幾篇筆記的話，手動複製正文進去也完全可以。其他客戶端的配置和完整工具說明見 [MCP 頁](/zh/mcp/)。

## 用到的介面

- [小紅書筆記搜尋](https://okdata.online/zh/apis/xiaohongshu/notes/search/) `xiaohongshu.notes.search`：$0.035/次 · 每頁約 20 篇筆記
- [小紅書筆記評論](https://okdata.online/zh/apis/xiaohongshu/notes/comments/list/) `xiaohongshu.notes.comments.list`：$0.035/次 · 每頁約 10 條評論
- [小紅書博主資訊](https://okdata.online/zh/apis/xiaohongshu/users/get/) `xiaohongshu.users.get`：$0.02/次

## 更多小紅書內容

- [小紅書 API](https://okdata.online/zh/apis/xiaohongshu/)
- [小紅書 API Python 教程：筆記、博主和評論（2026）](https://okdata.online/zh/guides/xiaohongshu-api-python/)
- [怎麼按關鍵詞批次匯出小紅書評論](https://okdata.online/zh/guides/xiaohongshu-note-comments/)
- [怎麼在小紅書蒲公英按報價和閱讀量篩達人](https://okdata.online/zh/guides/xiaohongshu-pgy-creator-rates/)
- [怎麼搜尋小紅書筆記並匯出成 CSV 表格](https://okdata.online/zh/guides/xiaohongshu-search-export-notes/)
- [怎麼在 Cursor 或 Cline 裡接入小紅書資料的 MCP？](https://okdata.online/zh/answers/cursor-cline-xiaohongshu-mcp/)
- [有沒有不用掃碼登入的小紅書 MCP？](https://okdata.online/zh/answers/xiaohongshu-mcp-qr-login-expires/)
- [小紅書有沒有官方 API 可以搜筆記、讀評論？](https://okdata.online/zh/answers/xiaohongshu-official-api/)
- [OpenClaw（龍蝦）裡怎麼裝小紅書、抖音、公眾號的資料 Skill？](https://okdata.online/zh/answers/openclaw-xiaohongshu-douyin-skill/)
- [千問裡怎麼拿到抖音、小紅書、公眾號的資料？](https://okdata.online/zh/answers/qwen-douyin-xiaohongshu-data/)
- [怎麼讓豆包讀到抖音、小紅書的資料？](https://okdata.online/zh/answers/doubao-douyin-xiaohongshu-data/)
- [自己爬還是按次呼叫資料介面：成本、維護和風險](https://okdata.online/zh/compare/scraping-vs-data-api/)
- [怎麼選社交媒體資料 API（2026）](https://okdata.online/zh/compare/social-media-data-apis/)
- [社媒資料 MCP 伺服器：自己部署還是用託管的](https://okdata.online/zh/compare/social-media-data-mcp-servers/)

## 資料來源

這個問題出現過的地方（讀取於 2026-11-12）：

- https://github.com/cline/mcp-marketplace/issues/1484
- https://github.com/cline/mcp-marketplace/issues/1671

更新於 2026-11-12
