YouTube MCP

内容与创意

by mrsknetwork

Interact with public YouTube data via the official Data API v3

什么是 YouTube MCP

Interact with public YouTube data via the official Data API v3

README

<div align="center">

YouTube MCP

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

npm Downloads Socket Badge MIT MCP

</div>

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

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

OAuth 2.0

<details> <summary><b>Required for private subscriptions, memberships, and account activity.</b></summary> <br/>

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.

</details>

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

<details> <summary><b>Instructions for running the server locally.</b></summary> <br/>
bash
git clone https://github.com/mrsknetwork/ytmcp.git
cd ytmcp
npm install
npm run build
node build/server/index.js "YOUR_API_KEY"
</details>

License

Licensed under the MIT License.

常见问题

YouTube MCP 是什么?

Interact with public YouTube data via the official Data API v3

相关 Skills

文档共著

by anthropics

Universal
热门

围绕文档、提案、技术规格、决策记录等写作任务,按上下文收集、结构迭代、读者测试三步协作共创,减少信息遗漏,写出更清晰、经得起他人阅读的内容。

写文档、方案或技术规格时容易思路散、信息漏,它用结构化共著流程帮你高效传递上下文、反复打磨内容,还能从读者视角做验证。

内容与创意
未扫描149.6k

内部沟通

by anthropics

Universal
热门

按公司常用模板和语气快速起草内部沟通内容,覆盖 3P 更新、状态报告、领导汇报、项目进展、事故复盘、FAQ 与 newsletter,适合需要统一格式的团队沟通场景。

按公司偏好的模板快速产出状态汇报、领导更新和 FAQ,既省去反复改稿,也让内部沟通更统一、更专业。

内容与创意
未扫描149.6k

平面设计

by anthropics

Universal
热门

先生成视觉哲学,再落地成原创海报、艺术画面或其他静态设计,输出 .png/.pdf,强调构图、色彩与空间表达,适合需要高完成度视觉成品的场景。

做海报、插画或静态视觉稿时,用它能快速产出兼顾美感与版式的PNG/PDF成品,原创设计更省心,也更适合规避版权风险。

内容与创意
未扫描149.6k

相关 MCP Server

免费的加密新闻聚合 MCP,汇集 Bitcoin、Ethereum、DeFi、Solana 与 altcoins 资讯源。

内容与创意
236

by ProfessionalWiki

让 Large Language Model 客户端无缝连接任意 MediaWiki 站点,可创建、更新、搜索页面,并通过 OAuth 2.0 安全管理内容。

内容与创意16 个工具
97

用于Adobe Photoshop自动化的MCP server,让AI assistants直接控制Photoshop。

内容与创意
97

评论