最後更新
MCP 伺服器
讓 Claude、Cursor、VS Code 與其他 MCP 用戶端讀取 toktokdata.live 的排行榜、創作者與 LIVE 場次。伺服器在你的電腦上執行,使用你的金鑰呼叫 API,並提供唯讀工具。
需求
- Node.js 20 或更新版本。用戶端會以
npx -y @toktokdata.live/mcp啟動伺服器,並透過 stdio 與其通訊;我們不會替你代管任何服務。 - 放在
TOKTOKDATA_API_KEY中的 API 金鑰,並具備你要使用之工具的權限範圍(請參閱身分驗證)。請為每個 AI 代理建立獨立的金鑰,以便追蹤其用量並單獨撤銷。
設定用戶端
將伺服器加入你的用戶端,並把 ttk_live_... 換成你的金鑰。之後重新啟動用戶端;工具會以 toktokdata 名稱出現。
{ "mcpServers": { "toktokdata": { "command": "npx", "args": ["-y", "@toktokdata.live/mcp"], "env": { "TOKTOKDATA_API_KEY": "ttk_live_..." } } }}| 用戶端 | 設定檔位置 |
|---|---|
| Claude Desktop | ~/Library/Application Support/Claude/claude_desktop_config.json · %APPDATA%\Claude\claude_desktop_config.json |
| Claude Code | claude mcp add |
| Cursor | .cursor/mcp.json · ~/.cursor/mcp.json |
| VS Code | .vscode/mcp.json |
| Windsurf | ~/.codeium/windsurf/mcp_config.json |
別讓金鑰進入 git
.cursor/mcp.json 與 .vscode/mcp.json 位於你的專案內。建議使用使用者層級的設定,或上方 VS Code 的 inputs 提示,避免金鑰被提交。在 Windows 上,部分用戶端需要透過 cmd 啟動 npx:
json
"command": "cmd","args": ["/c", "npx", "-y", "@toktokdata.live/mcp"]工具
每個工具會呼叫 API 的一個讀取端點並回傳其 JSON。AI 代理會依你的問題挑選工具;若金鑰缺少某個工具的權限範圍,該工具會回傳 403。
| 群組 | 工具 | 權限範圍 |
|---|---|---|
| 排行榜 | rankings_official rankings_regions rankings_history rankings_day_bars | rank:read |
| 創作者 | creators_search creators_get creators_analysis creators_changes creators_followers creators_following creators_insights | creator:read |
| 創作者的頂級送禮者 | creators_gifters | gifter:read |
| 創作者影片 | creators_videos | content:read |
| 直播公會 | agencies_list agencies_get | creator:read |
| 洞察 | insights_best_time insights_presence | creator:read |
| 影片 | videos_get videos_comments | content:read |
| 趨勢 | trends_list | trend:read |
| 禮物 | gifts_list | live:read |
| 送禮者 | gifters_list | gifter:read |
| LIVE 場次 | live_sessions live_session live_session_timeline live_sessions_compare live_performance live_comments | live:read |
| 帳號 | account_usage account_entitlements | keys:manage |
唯讀
伺服器不提供提醒規則、匯出、直播狀態更新或 API 金鑰相關的工具,因此 AI 代理無法變更你的工作區。這些操作請使用 API 或 SDK。
點數與限制
每次工具呼叫都是使用你的金鑰發出的 API 請求。它消耗的點數與計入的速率限制,都和你自己呼叫該端點時相同,並會顯示在設定 → 使用量中。AI 代理可能會呼叫多個工具來回答一個問題;account_usage 可讓它得知工作區已花費多少點數。
提示範例
- 目前越南每小時 LIVE 榜單前 10 名的創作者是誰?
- 比較 room.one 最近三場直播,告訴我哪一場賺到最多鑽石。
- 在印尼什麼時候開播最好?當地有哪些正在上升的趨勢?
對於第一個問題,AI 代理會以 hourly 榜單、地區 VN 與上限 10 呼叫 rankings_official。
疑難排解
| 症狀 | 解決方法 |
|---|---|
每個工具都回覆尚未設定 TOKTOKDATA_API_KEY | 請在用戶端設定的 env 區塊中設定 TOKTOKDATA_API_KEY,然後重新啟動用戶端。 |
spawn npx ENOENT 或伺服器始終沒有啟動 | 請安裝 Node.js 20 或更新版本。在 Windows 上,如果用戶端仍找不到 npx,請依下方方式透過 cmd 啟動。 |
401 unauthorized | 金鑰輸入錯誤、已撤銷或已過期。請建立新金鑰並更新設定。 |
403 insufficient_scope 或 module_not_entitled | 金鑰缺少該工具的權限範圍,或方案未包含其模組。請為金鑰加入權限範圍,或升級方案。 |
402 credit_cap_exceeded | 工作區已用完本期點數。請儲值,或等待每月點數額度發放。 |
429 速率限制錯誤 | AI 代理呼叫工具的速度超過了金鑰的速率限制。請要求它一次少呼叫幾個工具,或等待 Retry-After 指定的時間。 |
這個頁面對你有幫助嗎?