YouTube MCP Server
YouTube MCP 服务器
用于与 YouTube 视频交互的模型上下文协议 (MCP) 服务器。该服务器提供用于提取视频元数据和字幕的工具,并使用各种模板将其转换为 Markdown 格式。
特征
视频元数据:获取全面的视频信息
字幕提取:支持自动生成和手动字幕
多种语言:内置英语和法语支持
模板系统:内置三个markdown模板:
基础:简单的成绩单格式
详细信息:带有时间戳的完整元数据
搜索:结果突出显示并显示上下文
搜索功能:在视频字幕内搜索
灵活的身份验证:支持 API 密钥和 OAuth2 身份验证
Related MCP server: YouTube Video Summarizer MCP Server
先决条件
Node.js(v16 或更高版本)
npm 或 yarn
YouTube 数据 API 密钥和/或 OAuth2 凭据
安装
克隆存储库:
git clone [repository-url]
cd youtube-mcp安装依赖项:
npm install构建项目:
npm run build配置
使用您的 YouTube 凭据在根目录中创建一个.env文件:
YOUTUBE_API_KEY=your_api_key
YOUTUBE_CLIENT_ID=your_client_id
YOUTUBE_CLIENT_SECRET=your_client_secret
YOUTUBE_REFRESH_TOKEN=your_refresh_token # Optional, for OAuth2MCP 配置
将服务器添加到您的 MCP 设置文件(通常位于~/.config/Code/User/globalStorage/rooveterinaryinc.roo-cline/settings/cline_mcp_settings.json ):
{
"mcpServers": {
"youtube": {
"command": "node",
"args": ["path/to/youtube-mcp/build/index.js"],
"env": {
"YOUTUBE_API_KEY": "your_api_key",
"YOUTUBE_CLIENT_ID": "your_client_id",
"YOUTUBE_CLIENT_SECRET": "your_client_secret"
},
"disabled": false,
"alwaysAllow": []
}
}
}用法
该服务器提供以下工具:
1. 获取视频信息
use_mcp_tool youtube get_video_info {
"url": "https://www.youtube.com/watch?v=VIDEO_ID"
}2. 获取字幕
use_mcp_tool youtube get_captions {
"url": "https://www.youtube.com/watch?v=VIDEO_ID",
"language": "en" // Optional, defaults to "en"
}3. 转换为 Markdown
use_mcp_tool youtube convert_to_markdown {
"url": "https://www.youtube.com/watch?v=VIDEO_ID",
"template_name": "detailed", // Optional, "basic", "detailed", or "search"
"language": "en", // Optional
"options": { // Optional
"include_chapters": true,
"search_term": "keyword" // Only for search template
}
}4. 列表模板
use_mcp_tool youtube list_templates依赖项
{
"dependencies": {
"@modelcontextprotocol/sdk": "latest",
"googleapis": "^146.0.0",
"google-auth-library": "^9.0.0",
"youtube-captions-scraper": "^2.0.0",
"express": "^4.18.2",
"open": "^9.1.0"
},
"devDependencies": {
"@types/node": "^20.0.0",
"typescript": "^5.0.0",
"tsx": "^4.0.0"
}
}OAuth2 设置
对于 OAuth2 身份验证(私人视频访问所需):
在Google Cloud Console中创建项目
启用 YouTube 数据 API v3
创建 OAuth2 凭据(Web 应用程序类型)
运行身份验证脚本:
node src/get-api-key.js按照浏览器提示授权应用程序
将刷新令牌复制到您的配置中
自定义模板
您可以通过修改src/index.ts中的DEFAULT_TEMPLATES数组来添加自定义模板。模板遵循以下结构:
interface MarkdownTemplate {
name: string;
description: string;
format: {
header?: string;
chapter_format?: string;
caption_block: string;
timestamp_format?: string;
search_result_format?: string;
}
}执照
麻省理工学院
贡献
分叉存储库
创建你的功能分支(
git checkout -b feature/amazing-feature)提交您的更改(
git commit -m 'Add some amazing feature')推送到分支(
git push origin feature/amazing-feature)打开拉取请求
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Tools
Related MCP Servers
- AlicenseBqualityCmaintenanceEnables extraction of transcripts, keyword-based video search with metadata retrieval, and channel information discovery from YouTube videos through natural language interaction.34MIT
- AlicenseBqualityFmaintenanceEnables AI assistants to analyze and summarize YouTube videos by extracting captions, subtitles, and comprehensive metadata including title, description, and duration in multiple languages.14160MIT
- AlicenseNot gradedqualityDmaintenanceExtracts captions, metadata, and descriptions from YouTube videos to enable AI assistants to summarize their content.11MIT
- AlicenseAqualityDmaintenanceEnables fetching, searching, and summarizing YouTube video transcripts with multi-language support.4MIT
Related MCP Connectors
Fetch transcripts, subtitles, chapters, metadata and frames from YouTube and 10+ video platforms
YouTube transcripts, subtitles, and video metadata as structured JSON via an Apify Actor.
YouTube transcripts, search, channels, playlists and bulk transcript jobs for AI agents. 14 tools.
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/nattyraz/youtube-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server