YouTube MCP

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

Interact with YouTube data via the official Data API v3

概览

AI 生成的概览

通过官方 Data API v3 让助手访问 YouTube 数据,可搜索视频、获取转录和元数据,并读取评论与频道信息。

可以做什么
下载视频的完整口述转录,可选择语言以及手动或自动生成的字幕,无需凭据。按关键词、日期范围、时长、画质和地区搜索视频、频道和播放列表,并按国家和分类列出热门视频。获取视频元数据与统计、频道资料、播放列表及其条目,以及频道动态和页面分区。读取视频的一级评论和回复,并列出可用的字幕轨。查询支持的语言和地区,列出频道的公开订阅或通过 OAuth 列出自己的订阅。列出自己频道的付费会员和会员等级,并可撤销已保存的 OAuth 令牌。
适用场景
适合让助手调研 YouTube 内容、依据转录总结或引用视频、按统计对比频道和视频,或查看评论与热门话题。OAuth 模式面向需要自己订阅和会员数据的创作者或频道所有者。
运行要求
通过 npx 运行 npm 包 @mrsknetwork/ytmcp 的本地 Node.js 进程。访客转录模式需要 yt-dlp,无需凭据。公开数据工具需要启用 YouTube Data API v3 的 Google API 密钥,以 GOOGLE_API_KEY 传入。私有订阅和会员数据需要 OAuth 2.0 Web 客户端,配置 GOOGLE_CLIENT_ID、GOOGLE_CLIENT_SECRET 以及回调地址
安装前请注意
OAuth 模式需要 GOOGLE_CLIENT_ID 和 GOOGLE_CLIENT_SECRET,服务器会把登录会话保存在本地,直到调用 revoke_oauth_token 才会删除。转录提取依赖 yt-dlp 从 YouTube 下载内容,可能与 YouTube 服务条款冲突。查询内容、视频 ID 和账号数据都会发送给 Google 的 YouTube Data API。

安装

在 SourceWeft 中

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

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

其他 MCP 客户端

参照 仓库 中的启动说明。

README

YouTube MCP

Connect AI assistants to YouTube: search, transcripts, metadata, and more.

[npm] [Downloads] [Socket Badge] [MIT] [MCP]


What can it do?

Once connected, your AI can:

  • Extract clean, word-for-word video transcripts. No credentials required.
  • Search YouTube by keyword, date range, duration, quality, and region.
  • Fetch trending videos for any country and category.
  • Retrieve video stats, metadata, comments, captions, and channel details.
  • Look up channels by @handle (e.g. @MrBeast).
  • Access your own subscriptions, members, and membership tiers via OAuth.

Getting Started

The server supports three access tiers. Pick the one that fits your use case.

Guest Mode (No Setup)

Works out of the box. The get_video_transcript tool uses yt-dlp to extract transcripts without any API credentials.

json
{  "mcpServers": {    "youtube-mcp": {      "command": "npx",      "args": ["-y", "@mrsknetwork/ytmcp@latest"]    }  }}

API Key (Recommended)

Unlocks all public data tools. Best for search, metadata, comments, trending videos, and transcripts.

1. Get a Google API Key

  1. Open the Google Cloud Console.
  2. Enable YouTube Data API v3 for your project.
  3. Go to Credentials and create an API Key.

2. Add to your MCP client config or .env file

Pass GOOGLE_API_KEY via env in your MCP client config, or place GOOGLE_API_KEY=YOUR_KEY inside a .env file in the project directory.

json
{  "mcpServers": {    "youtube-mcp": {      "command": "npx",      "args": ["-y", "@mrsknetwork/ytmcp@latest"],      "env": {        "GOOGLE_API_KEY": "YOUR_GOOGLE_API_KEY"      }    }  }}

OAuth 2.0

Required for private subscriptions, memberships, and account activity.

1. Create an OAuth 2.0 Client

  1. Open the Google Cloud Console.
  2. Enable YouTube Data API v3 for your project.
  3. Go to Credentials > Create Credentials > OAuth 2.0 Client ID.
  4. Set Application type to Web application.
  5. Add this exact Redirect URI: http://localhost:31415/oauth2callback.
  6. Go to OAuth Consent Screen > Test Users and add your Gmail address.

2. Add to your MCP client config

Credentials are passed securely via environment variables in the MCP config. They are never stored in files.

json
{  "mcpServers": {    "youtube-mcp": {      "command": "npx",      "args": ["-y", "@mrsknetwork/ytmcp@latest"],      "env": {        "GOOGLE_CLIENT_ID": "your-client-id.apps.googleusercontent.com",        "GOOGLE_CLIENT_SECRET": "your-client-secret"      }    }  }}

3. First-time login

On your first tool call, the AI will share a login link. Click it, authorize the app in your browser, then tell the AI you are done. Your session is saved. You will not need to log in again unless you revoke access.

4. Signing out

Ask your AI to call revoke_oauth_token to sign out and delete your stored credentials at any time.


Available Tools

ToolAuthDescription
get_video_transcriptNoneDownload a full spoken transcript using yt-dlp. Specify language_code (e.g. en, es) and whether to prefer manual or auto-generated captions. Returns source metadata with the text.
search_contentAPI KeySearch YouTube for videos, channels, or playlists. Filter by order, published_after, published_before, video_duration, video_definition, and region_code. Supports pagination.
get_video_metadataAPI KeyFetch title, description, tags, duration, and stats (views, likes, comments) for one or more videos by ID.
get_channel_metadataAPI KeyFetch channel profile, subscriber count, video count, and uploads playlist ID. Accepts a channel ID or @handle.
list_trending_videosAPI KeyFetch the most popular videos on YouTube for a given region_code and optional category_id. Supports pagination.
list_playlistsAPI KeyList playlists for a channel, or fetch specific playlists by ID. Returns title, description, and item count.
list_playlist_itemsAPI KeyList all videos inside a playlist in order. Returns title, position, and video ID for each entry.
list_video_commentsAPI KeyFetch top-level comment threads for a video or channel. Filter by keyword with search_terms. Supports pagination.
list_comment_repliesAPI KeyFetch replies to a specific comment thread by parent_comment_id. Supports pagination.
list_video_captionsAPI KeyList available caption tracks for a video, including language code and type (manual or auto-generated).
list_video_categoriesAPI KeyList YouTube video category names and IDs for a given region. Use the IDs with search_content or list_trending_videos.
list_channel_activitiesAPI KeyFetch a channel's recent activity feed, including uploads and playlist additions.
list_channel_sectionsAPI KeyList the shelf sections displayed on a channel's page, in order.
list_supported_languagesAPI KeyList all languages supported by YouTube, with language codes and localized names.
list_supported_regionsAPI KeyList all regions supported by YouTube, with region codes and names.
list_subscriptionsAPI Key / OAuthList public subscriptions for a channel by channel_id (API Key), or your own subscriptions with mine=true (OAuth).
list_channel_membersOAuthList current paying members of your channel. Requires an active memberships program.
list_membership_levelsOAuthList the membership tier names and levels configured for your channel.
revoke_oauth_tokenOAuthSign out and permanently delete your stored Google credentials from the server.

Building from Source

Instructions for running the server locally.
bash
git clone https://github.com/mrsknetwork/ytmcp.gitcd ytmcpnpm installnpm run buildcp .env.example .env # Set GOOGLE_API_KEY inside .envnode build/server/index.js

License

Licensed under the MIT License.

来源:README.md,提交 c4ca227

工具

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

版本历史

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

评分

已满足适用检查项的 50%

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

  • 近 30 天内可连通25 分

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

  • 已声明认证方式10 分

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

  • 已列出工具15 分

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

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