Last updated
MCP server
Give Claude, Cursor, VS Code and other MCP clients read access to toktokdata.live rankings, creators and LIVE sessions. The server runs on your machine, talks to the API with your key and exposes read-only tools.
Requirements
- Node.js 20 or newer. The client starts the server with
npx -y @toktokdata.live/mcpand talks to it over stdio; it runs on your machine, not on our servers. - An API key in
TOKTOKDATA_API_KEY, with the scopes of the tools you want (see Authentication). Create a separate key for each agent so you can follow its usage and revoke it on its own.
Configure your client
Add the server to your client and replace ttk_live_... with your key. Restart the client afterwards; the tools appear under the name toktokdata.
{ "mcpServers": { "toktokdata": { "command": "npx", "args": ["-y", "@toktokdata.live/mcp"], "env": { "TOKTOKDATA_API_KEY": "ttk_live_..." } } }}| Client | Where the config goes |
|---|---|
| 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 |
.cursor/mcp.json and .vscode/mcp.json live inside your project. Prefer the user-level config, or the VS Code inputs prompt above, so the key is never committed.On Windows, some clients need npx started through cmd:
"command": "cmd","args": ["/c", "npx", "-y", "@toktokdata.live/mcp"]Tools
Each tool calls one read endpoint of the API and returns its JSON. The agent picks the tools from your question; a tool whose scope the key lacks answers with a 403.
| Group | Tools | Scope |
|---|---|---|
| Rankings | rankings_official rankings_regions rankings_history rankings_day_bars | rank:read |
| Creators | creators_search creators_get creators_analysis creators_changes creators_followers creators_following creators_insights | creator:read |
| Creator top gifters | creators_gifters | gifter:read |
| Creator videos | creators_videos | content:read |
| Agencies | agencies_list agencies_get | creator:read |
| Insights | insights_best_time insights_presence | creator:read |
| Videos | videos_get videos_comments | content:read |
| Trends | trends_list | trend:read |
| Gifts | gifts_list | live:read |
| Gifters | gifters_list | gifter:read |
| LIVE sessions | live_sessions live_session live_session_timeline live_sessions_compare live_performance live_comments | live:read |
| Account | account_usage account_entitlements | keys:manage |
Credits and limits
A tool call is an API request made with your key. It spends the same credits and counts against the same rate limits as calling the endpoint yourself, and it shows up under Settings → Usage. An agent may call several tools to answer one question; account_usage tells it how much the workspace has spent.
Example prompts
- Who are the top 10 hourly LIVE creators in Vietnam right now?
- Compare the last three LIVE sessions of room.one and tell me which one earned the most diamonds.
- What is the best time to go LIVE in Indonesia, and which trends are rising there?
For the first one the agent calls rankings_official with the hourly board, region VN and a limit of 10.
Troubleshooting
| Symptom | Fix |
|---|---|
Every tool answers that TOKTOKDATA_API_KEY is not set | Set TOKTOKDATA_API_KEY in the env block of the client’s config and restart the client. |
spawn npx ENOENT or the server never starts | Install Node.js 20 or newer. On Windows, if the client still cannot find npx, start it through cmd as shown below. |
401 unauthorized | The key is mistyped, revoked or expired. Create a new one and update the config. |
403 insufficient_scope or module_not_entitled | The key lacks the scope of that tool, or the plan does not include its module. Add the scope to the key or upgrade the plan. |
402 credit_cap_exceeded | The workspace spent its credits for the period. Top up or wait for the monthly allotment. |
429 rate limit errors | The agent called tools faster than the key’s rate limit. Ask for fewer calls at once, or wait for the time in Retry-After. |