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 文件。
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
YouTube transcripts, search, channel/playlist listings and upload tracking for AI agents. No signup.
YouTube transcripts, search, channels, playlists and bulk transcript jobs for AI agents. 14 tools.
YouTube video search with transcript extraction as first-class output.
Personal YouTube AI knowledge base powered by RAG. Query your subscribed YouTube channels.
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.12MIT
- AlicenseNot gradedqualityCmaintenanceEnables 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.427MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/AfsheenMahmood/youtube-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server