youtube-mcp
YouTube MCP Server
一个面向 YouTube 的 Model Context Protocol (MCP) 服务器实现,使 AI 语言模型能够通过标准化接口与 YouTube 内容进行交互。
网站: zubeidhendricks.github.io/youtube-mcp-server
可用工具
该服务器目前提供 10 个 MCP 工具。
工具 | 描述 | 必填参数 | 可选参数 |
| 获取 YouTube 视频的详细信息 |
|
|
| 在 YouTube 上搜索视频 |
|
|
| 获取 YouTube 视频的转录文本 |
|
|
| 获取 YouTube 频道的信息 |
| 无 |
| 获取多个 YouTube 频道的信息 |
|
|
| 按句柄、名称或查询条件搜索 YouTube 频道 |
|
|
| 根据视频提及查找创作者频道,并带有频道规模和活跃度过滤器 |
|
|
| 获取特定频道的视频 |
|
|
| 获取 YouTube 播放列表的信息 |
| 无 |
| 获取 YouTube 播放列表中的视频 |
|
|
工具参数
videos_getVideo
videoId(string):YouTube 视频 ID。parts(string[], 可选):要检索的特定视频资源部分。
videos_searchVideos
query(string):搜索查询。maxResults(number, 可选):要返回的最大结果数。order(string, 可选):结果排序方式,例如relevance或date。publishedAfter(string, 可选):仅包含在此 ISO 8601 日期之后发布的视频。publishedBefore(string, 可选):仅包含在此 ISO 8601 日期之前发布的视频。channelId(string, 可选):将结果限制到特定频道。uniqueChannels(boolean, 可选):每个唯一频道仅返回一个视频。channelMinSubscribers/channelMaxSubscribers(number, 可选):按视频所属频道的订阅者数量区间过滤匹配的视频。channelLastUploadAfter/channelLastUploadBefore(string, 可选):按视频所属频道的最新上传活跃度过滤匹配的视频。creatorOnly(boolean, 可选):将结果限制为通过启发式方法分类为创作者的频道。sortBy(string, 可选):支持relevance、subscribers_asc、subscribers_desc、indie_priority和recent_activity。
transcripts_getTranscript
videoId(string):YouTube 视频 ID。language(string, 可选):转录文本的语言代码。回退到YOUTUBE_TRANSCRIPT_LANG或en。
channels_getChannel
channelId(string):YouTube 频道 ID。
响应现在包括:
latestVideoPublishedAtnormalizedMetadata包括
country、defaultLanguage、joinedAt、customUrl、emailsFound、contactLinks以及创作者与品牌启发式字段
channels_getChannels
channelIds(string[]):YouTube 频道 ID 列表。includeLatestUpload(boolean, 可选):是否包含latestVideoPublishedAt。默认为true。
channels_searchChannels
query(string):频道搜索查询或句柄。maxResults(number, 可选):要返回的最大频道数。order(string, 可选):结果排序方式,例如relevance。channelType(string, 可选):将搜索限制为特定的频道类型。minSubscribers/maxSubscribers(number, 可选):按订阅者数量区间过滤频道。lastUploadAfter/lastUploadBefore(string, 可选):按最新上传活跃度过滤频道。creatorOnly(boolean, 可选):将结果限制为通过启发式方法分类为创作者的频道。sortBy(string, 可选):支持relevance、subscribers_asc、subscribers_desc、indie_priority和recent_activity。
channels_findCreators
query(string):主题、游戏或提及查询,用于从匹配的视频中发现频道。videoPublishedAfter/videoPublishedBefore(string, 可选):匹配视频的新近度过滤器。channelMinSubscribers/channelMaxSubscribers(number, 可选):返回频道的订阅者数量区间过滤器。channelLastUploadAfter/channelLastUploadBefore(string, 可选):返回频道的最新上传活跃度过滤器。creatorOnly(boolean, 可选):将结果限制为通过启发式方法分类为创作者的频道。sortBy(string, 可选):支持relevance、subscribers_asc、subscribers_desc、indie_priority和recent_activity。sampleVideosPerChannel(number, 可选):每个返回频道包含多少个匹配视频。
channels_listVideos
channelId(string):YouTube 频道 ID。maxResults(number, 可选):要返回的最大视频数。
playlists_getPlaylist
playlistId(string):YouTube 播放列表 ID。
playlists_getPlaylistItems
playlistId(string):YouTube 播放列表 ID。maxResults(number, 可选):要返回的最大播放列表项数。
Related MCP server: mcp-server-youtube
安装
Claude Desktop 快速设置
安装该包:
npm install -g zubeid-youtube-mcp-server将其添加到您的 Claude Desktop 配置中(在 macOS 上为
~/Library/Application Support/Claude/claude_desktop_config.json,在 Windows 上为%APPDATA%\Claude\claude_desktop_config.json):
{
"mcpServers": {
"zubeid-youtube-mcp-server": {
"command": "zubeid-youtube-mcp-server",
"env": {
"YOUTUBE_API_KEY": "your_primary_youtube_api_key",
"YOUTUBE_API_KEY2": "your_secondary_youtube_api_key",
"YOUTUBE_API_KEY3": "your_tertiary_youtube_api_key"
}
}
}
}备选方案:使用 NPX(无需安装)
将此添加到您的 Claude Desktop 配置中:
{
"mcpServers": {
"youtube": {
"command": "npx",
"args": ["-y", "zubeid-youtube-mcp-server"],
"env": {
"YOUTUBE_API_KEY": "your_primary_youtube_api_key",
"YOUTUBE_API_KEY2": "your_secondary_youtube_api_key",
"YOUTUBE_API_KEY3": "your_tertiary_youtube_api_key"
}
}
}
}通过 Smithery 安装
要通过 Smithery 为 Claude Desktop 自动安装 YouTube MCP Server:
npx -y @smithery/cli install @ZubeidHendricks/youtube --client claude配置
设置以下环境变量:
YOUTUBE_API_KEY:主要的 YouTube Data API 密钥YOUTUBE_API_KEY2:次要的备用 API 密钥YOUTUBE_API_KEY3:第三个备用 API 密钥YOUTUBE_TRANSCRIPT_LANG:转录文本的默认语言(可选,默认为 'en')
必须至少设置 YOUTUBE_API_KEY、YOUTUBE_API_KEY2 或 YOUTUBE_API_KEY3 中的一个。当某个密钥的配额耗尽导致请求失败时,服务器会使用下一个已配置的密钥重试同一请求。
与 VS Code 配合使用
如需一键安装,请点击下方任一安装按钮:
手动安装
如果您倾向于手动安装,请先查看本节顶部的安装按钮。否则,请按照以下步骤操作:
将以下 JSON 块添加到 VS Code 中的用户设置(JSON)文件中。您可以按 Ctrl + Shift + P 并输入 Preferences: Open User Settings (JSON) 来完成此操作。
{
"mcp": {
"inputs": [
{
"type": "promptString",
"id": "apiKey",
"description": "YouTube API Key",
"password": true
}
],
"servers": {
"youtube": {
"command": "npx",
"args": ["-y", "zubeid-youtube-mcp-server"],
"env": {
"YOUTUBE_API_KEY": "${input:apiKey}"
}
}
}
}
}或者,您也可以将其添加到工作区中名为 .vscode/mcp.json 的文件中:
{
"inputs": [
{
"type": "promptString",
"id": "apiKey",
"description": "YouTube API Key",
"password": true
}
],
"servers": {
"youtube": {
"command": "npx",
"args": ["-y", "zubeid-youtube-mcp-server"],
"env": {
"YOUTUBE_API_KEY": "${input:apiKey}"
}
}
}
}开发
# Install dependencies
npm install
# Build
npm run build
# Start the server (requires at least one configured YouTube API key)
npm start
# Development mode with auto-rebuild
npm run devDocker
包含的 Docker 镜像默认通过 HTTP 启动服务器。
默认传输:
http默认端点:
http://localhost:8088/mcp就绪端点:
http://localhost:8088/ready默认模式:无状态
Docker 构建会将 .env 复制到运行时镜像中,服务器会在启动时自动加载它。这意味着只要在 docker build 期间存在 .env,容器就可以在 docker run 时无需传入 API 凭据即可运行。
docker build -t youtube-mcp-server .
docker run --rm -p 8088:8088 youtube-mcp-server容器默认为:
MCP_TRANSPORT=http
MCP_HOST=0.0.0.0
MCP_PORT=8088
MCP_STATELESS=true贡献
有关向此仓库贡献的信息,请参阅 CONTRIBUTING.md。
许可证
本项目采用 MIT License 许可 - 详情请参阅 LICENSE 文件。
Available Tools
10 toolschannels_findCreatorsB
Find creator channels from video mentions with subscriber band and recent activity filters in one call
Inputs: query (required), order, sortBy, maxResults, +8 more.
channels_getChannelC
Get information about a YouTube channel
Inputs: channelId (required).
channels_getChannelsC
Get information about multiple YouTube channels
Inputs: channelIds (required), parts, includeLatestUpload.
channels_listVideosC
Get videos from a specific channel
Inputs: channelId (required), maxResults.
channels_searchChannelsC
Search for YouTube channels by handle, name, or query
Inputs: query (required), order, sortBy, maxResults, +6 more.
playlists_getPlaylistC
Get information about a YouTube playlist
Inputs: playlistId (required).
playlists_getPlaylistItemsB
Get videos in a YouTube playlist
Inputs: playlistId (required), maxResults.
transcripts_getTranscriptC
Get the transcript of a YouTube video
Inputs: videoId (required), language.
videos_getVideoB
Get detailed information about a YouTube video
Inputs: videoId (required), parts.
videos_searchVideosC
Search for videos on YouTube
Inputs: query (required), order, sortBy, channelId, +9 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 10 tools
Most tools have clearly distinct purposes: getVideo, searchVideos, getTranscript, getChannel, etc. However, channels_getChannels and channels_findCreators both retrieve multiple channels, which could cause confusion, though findCreators has specific filters. Overlap is limited and descriptions help differentiate.
All tool names follow a consistent pattern of resource_category + verb_noun (e.g., videos_getVideo, playlists_getPlaylistItems, channels_getChannel). The pattern is predictable and uniform across all tools.
With 10 tools, the set is well-scoped for YouTube interactions, covering core entities like videos, playlists, channels, and transcripts without excessive redundancy. Each tool appears to earn its place.
The surface covers key read operations for videos, playlists, channels, and transcripts. However, there is no tool for searching playlists or retrieving video comments, which could be considered gaps, but they are minor for most agent use cases.
Related MCP Connectors
Search YouTube videos, read transcripts and get public video information in your AI assistant.
YouTube transcripts, search, channel/playlist listings and upload tracking for AI agents.
Fetch YouTube transcripts, monitor channels and track keyword matches from your AI assistant.
YouTube search, whole channels, video stats, comments and full transcripts with timestamps.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that enables AI assistants to access YouTube data in real-time, with capabilities for searching videos, analyzing channels, retrieving video details, and extracting transcripts.13MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to search videos, read channels, browse playlists, fetch comments, and get transcripts from YouTube using the YouTube Data API v3 and InnerTube API for captions.2GPL 3.0
- FlicenseAqualityDmaintenanceEnables fetching YouTube video transcripts in various formats via the Model Context Protocol, allowing LLMs to access and process YouTube video transcripts securely.1-
- AlicenseAqualityDmaintenanceEnables AI tools to access YouTube content, including transcript extraction, video/channel info, and search.4MIT