Youtube Organic Mcp

io.github.lanternrow由 GitHub 账号 lanternrow 发布v1.0.0更新于 Oct 24, 2026

YouTube organic analytics — channel stats, video performance, watch time & audience insights.

已验证STDIO仅桌面数据与分析商业与电商

概览

AI 生成的概览

一个本地 MCP 服务器,通过 YouTube Data 与 Analytics API 让助手以只读方式访问你自己频道的自然流量分析数据。

可以做什么
列出已配置的频道和默认账号,支持多账号,所有工具都可带可选的 account 参数。获取频道资料与累计数据,如订阅数、总观看次数、视频数和上传播放列表。分页浏览上传视频及每个视频的观看、点赞、评论和时长,并按视频 ID 批量获取详情。按日期范围获取频道分析:观看次数、观看时长、平均观看时长与百分比、订阅增减、点赞、评论和分享,可选按天拆分。按日期范围获取单个视频的同类指标。
适用场景
适合让助手查看自己频道的表现、比较不同视频,或追踪观看次数、观看时长和订阅变化的逐日趋势,无需手动导出报表。适用于频道所有者,以及已在用 Google OAuth 工具的代理机构。
运行要求
以 Node.js 本地进程运行(Node 18 及以上),从 npm 包启动。需要一个启用了 YouTube Data API v3 和 YouTube Analytics API 的 Google Cloud 项目、一个桌面应用类型的 OAuth 客户端,以及频道所有者的刷新令牌。凭据通过环境变量 YOUTUBE_CLIENT_ID、YOUTUBE_CLIENT_SECRET 和 YOUTUBE_REFRESH_TOKEN 提供,多频道时使用 YOUTUBE_ACCOUNTS。获取令牌的辅助脚本需要 Python 及 google-auth-oauthlib。
安装前请注意
服务器需要 Google OAuth 客户端密钥和长期有效的刷新令牌,可持久访问你的频道数据,应保存在配置中而不要外传。令牌辅助脚本会把凭据写入本地账号文件。虽然说明为只读访问,但刷新令牌本身是长期凭据,一旦泄露应予以撤销。数据会发送至 Google 的 API;该服务器仅限桌面环境,无法在网页环境运行。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Youtube Organic Mcp,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

youtube-organic-mcp

MCP server for YouTube organic analytics — channel stats, video performance, watch time, and audience engagement via the YouTube Data API v3 and YouTube Analytics API v2.

Built for Claude Code and any MCP-compatible AI tool. Gives your AI assistant direct, read-only access to your own channel's organic data — subscribers, views, watch time, per-video engagement, and day-by-day trends.

Part of The SEO Engine toolkit by Rex Jones — AI-powered SEO and social media tooling for agencies and businesses.

Why this exists

  • No good open-source YouTube organic MCP existed. Plenty of ad MCPs; organic channel analytics, nobody.
  • YouTube has the richest organic API of the major platforms. Watch time, average view duration, subscribers gained/lost, traffic sources — none of it gated behind a multi-week review.
  • Reuses your existing Google OAuth. If you already run the GA4 / GSC / Google Ads MCPs, the same OAuth client works here.

Tools

ToolDescription
list_accountsList configured channels and the default
get_channel_infoChannel profile + lifetime stats (subscribers, total views, video count, uploads playlist)
get_videosPaginated uploads with per-video views, likes, comments, duration
get_video_detailsDetails for specific video IDs (batch up to 50)
get_channel_analyticsChannel analytics over a date range: views, watch time, avg view duration/%, subs gained/lost, likes, comments, shares — optionally by day
get_video_analyticsThe same metrics for a single video over a date range

All tools accept an optional account parameter for multi-account setups.

Getting connected

Step 1: Enable the APIs

In Google Cloud Console (any project — you can reuse an existing one), enable YouTube Data API v3 and YouTube Analytics API.

Step 2: Get a refresh token

Create an OAuth client of type Desktop app and download its client_secret JSON. Then run the helper (needs pip install google-auth-oauthlib):

bash
python3 scripts/get_youtube_token.py /path/to/client_secret.json my-channel

Authorize with the Google account that owns the channel (pick the Brand Account if prompted). It prints the three YOUTUBE_* values to drop into your config and writes them to .youtube_account.json (gitignored).

Step 3: Configure

Add to your Claude Code MCP settings:

json
{  "mcpServers": {    "youtube-organic": {      "command": "node",      "args": ["/path/to/youtube-organic-mcp/dist/index.js"],      "env": {        "YOUTUBE_CLIENT_ID": "your_client_id.apps.googleusercontent.com",        "YOUTUBE_CLIENT_SECRET": "your_client_secret",        "YOUTUBE_REFRESH_TOKEN": "1//your_refresh_token"      }    }  }}

Or set YOUTUBE_ACCOUNTS to a JSON array for multiple channels (see .env.example).

Architecture

src/  index.ts          # MCP server entry point, tool registration  accounts.ts       # Multi-account resolution (client_id/secret/refresh_token)  client.ts         # OAuth token minting + Data/Analytics API HTTP client  types.ts          # TypeScript interfaces for API responses  tools/    channel.ts      # get_channel_info + uploads-playlist resolver    videos.ts       # get_videos, get_video_details    analytics.ts    # get_channel_analytics, get_video_analytics
  • Zero external HTTP dependencies — native fetch (Node 18+)
  • Auto-refreshing auth — access tokens minted from the refresh token, cached per process
  • Multi-account support — monitor multiple channels from one server

License

MIT

来源:README.md,提交 d3447fa

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v1.0.0最新Sep 16, 2026

评分

已满足适用检查项的 40%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

    请在仓库或注册中心条目中声明许可证。