vturb-mcp

vturb-mcp

MCP server for the vTurb Analytics API that exposes 15 tools to query real-time and historical video analytics directly from Claude, with built-in rate limiting and smart player detection.

Category
访问服务器

README

vturb-mcp

MCP server for the vTurb Analytics API — exposes 15 tools to query real-time and historical video analytics directly from Claude.


Features

  • 15 analytics tools covering sessions, events, engagement, clicks, conversions, traffic origin and more
  • Built-in rate limiter — token bucket enforcing the Pro tier limit of 120 req/min (no 429 errors)
  • Smart player detectionfind_active_players auto-discovers which video is live today
  • Per-client .env files — clean credential management across multiple accounts

Requirements


Installation

1. Clone the repository

git clone https://github.com/hiperbold/vturb-mcp.git
cd vturb-mcp
npm install
npm run build

2. Create your .env file for each client

The MCP uses a per-client .env file so you can manage multiple vTurb accounts cleanly. Name the file after the client:

# Copy the example
cp .env.example .env.customer-name

# Edit and paste your token
# .env.customer-name
VTURB_API_TOKEN=your_token_here

The file format is simple — one variable per line:

VTURB_API_TOKEN=eyJ...

Security: Never commit .env.* files. They are already in .gitignore.

3. Register the MCP server in Claude Code

Open ~/.claude/mcp.json (create it if it doesn't exist) and add:

{
  "mcpServers": {
    "vturb-mcp": {
      "command": "node",
      "args": ["/absolute/path/to/vturb-mcp/dist/index.js"],
      "env": {
        "VTURB_ENV_FILE": "/absolute/path/to/vturb-mcp/.env.customer-name"
      }
    }
  }
}

Windows example:

{
  "mcpServers": {
    "vturb-mcp": {
      "command": "node",
      "args": ["F:\\local-mcps\\vturb-mcp\\dist\\index.js"],
      "env": {
        "VTURB_ENV_FILE": "F:\\local-mcps\\vturb-mcp\\.env.customer-name"
      }
    }
  }
}

4. Restart Claude Code

The MCP server starts automatically on the next session. You'll see it listed in your available tools.


Switching between clients

To switch accounts, just update VTURB_ENV_FILE in mcp.json to point to a different .env file and restart Claude:

"VTURB_ENV_FILE": "F:\\local-mcps\\vturb-mcp\\.env.other-customer"

Available Tools

Discovery & Monitoring

Tool Description
list_players Lists all players in the account with id, name, duration, and pitch_time. Supports optional filters by name and date range.
find_active_players Smart tool. Lists all players, checks which ones have activity today, and returns only the active ones with their metadata. Use this first to discover the correct player_id.
get_quota_usage Returns the current API quota status: queries used, remaining, and reset time. Use this to monitor consumption and avoid hitting the 120 req/min limit.
get_live_users Returns the number of users currently watching, broken down by domain. Configurable time window (1–720 minutes).

Session Analytics

Tool Description
get_session_stats Main analytics dashboard for a player: total views, plays, unique sessions/devices, engagement rate, clicks, conversions, and revenue in BRL/USD/EUR.
get_session_stats_by_day Same metrics as get_session_stats but broken down day by day. Ideal for historical trend analysis.

Events

Tool Description
get_events_total Returns totals for started, finished, and/or viewed events with unique session and device counts.
get_events_by_day Same event totals broken down by day for trend analysis.

Engagement & Retention

Tool Description
get_user_engagement Returns the video retention curve: how many users are still watching at each second. Also returns average_watched_time and engagement_rate.
get_user_engagement_by_day Returns the engagement rate per day over the selected period.

Clicks

Tool Description
get_clicks_timed Returns CTA click counts grouped by video second. Identifies the moment in the video that drives the most intent.
get_clicks_by_day CTA click totals broken down by day.

Conversions

Tool Description
get_conversions_by_day Conversion totals grouped by day, with unique session and device counts.

Traffic Origin

Tool Description
get_traffic_origin_stats Breaks down session metrics by traffic source. Supports utm_source, utm_medium, utm_campaign, utm_content, utm_term, src, sck.

Dashboard Summary

Tool Description
get_headlines_stats Returns a pre-computed summary (views, plays, engagement rate, clicks, and conversion rate) — the same numbers shown in the vTurb dashboard header.

Typical Workflow

1. find_active_players          → discover which player_id is in use today
2. get_session_stats            → get the main KPIs for a date range
3. get_user_engagement          → inspect the retention curve
4. get_clicks_timed             → find when viewers click the CTA
5. get_conversions_by_day       → track conversion trends
6. get_traffic_origin_stats     → compare traffic sources

Rate Limiting

The client uses a token bucket algorithm configured for the Pro tier:

  • Limit: 120 requests per minute
  • Refill rate: 2 tokens per second
  • Behavior: requests wait automatically if the bucket is empty — no errors thrown, no retries needed

Use get_quota_usage to check live consumption from vTurb's side.


Project Structure

vturb-mcp/
  src/
    env.ts          — loads .env.* file at startup (via VTURB_ENV_FILE)
    client.ts       — rate-limited HTTP client (token bucket, 120 req/min)
    index.ts        — MCP server, registers all 15 tools
    tools/          — one file per tool
      list-players.ts
      find-active-players.ts
      get-quota-usage.ts
      get-session-stats.ts
      get-session-stats-by-day.ts
      get-events-total.ts
      get-events-by-day.ts
      get-user-engagement.ts
      get-user-engagement-by-day.ts
      get-clicks-timed.ts
      get-clicks-by-day.ts
      get-conversions-by-day.ts
      get-live-users.ts
      get-headlines-stats.ts
      get-traffic-origin-stats.ts
  dist/             — compiled output (run npm run build)
  .env.example      — template for creating client-specific env files

API Reference


License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选