YouTube MCP Server
Uses Express for server functionality, likely to handle OAuth authentication flows when accessing YouTube content.
Utilizes Google's authentication services (OAuth2) for accessing YouTube content, particularly for private videos, requiring setup through the Google Cloud Console.
Converts YouTube video content into various markdown formats using customizable templates for transcripts, detailed metadata with timestamps, and search results with context highlighting.
Provides tools for interacting with YouTube videos, including extracting video metadata, captions in multiple languages, and converting content to markdown with various templates. Supports search functionality within video captions and flexible authentication methods.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@YouTube MCP Serverget the transcript for https://www.youtube.com/watch?v=dQw4w9WgXcQ in French"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
YouTube MCP Server
A Model Context Protocol (MCP) server for interacting with YouTube videos. This server provides tools for extracting video metadata, captions, and converting them to markdown format with various templates.
Features
Video Metadata: Fetch comprehensive video information
Caption Extraction: Support for auto-generated and manual captions
Multiple Languages: Built-in support for English and French
Template System: Three built-in markdown templates:
Basic: Simple transcript format
Detailed: Full metadata with timestamps
Search: Results highlighting with context
Search Functionality: Search within video captions
Flexible Authentication: Supports both API key and OAuth2 authentication
Related MCP server: YouTube Video Summarizer MCP Server
Prerequisites
Node.js (v16 or higher)
npm or yarn
A YouTube Data API key and/or OAuth2 credentials
Installation
Clone the repository:
git clone [repository-url]
cd youtube-mcpInstall dependencies:
npm installBuild the project:
npm run buildConfiguration
Create a .env file in the root directory with your YouTube credentials:
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 Configuration
Add the server to your MCP settings file (usually at ~/.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": []
}
}
}Usage
The server provides the following tools:
1. Get Video Info
use_mcp_tool youtube get_video_info {
"url": "https://www.youtube.com/watch?v=VIDEO_ID"
}2. Get Captions
use_mcp_tool youtube get_captions {
"url": "https://www.youtube.com/watch?v=VIDEO_ID",
"language": "en" // Optional, defaults to "en"
}3. Convert to 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. List Templates
use_mcp_tool youtube list_templatesDependencies
{
"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 Setup
For OAuth2 authentication (required for private video access):
Create a project in the Google Cloud Console
Enable the YouTube Data API v3
Create OAuth2 credentials (Web application type)
Run the authentication script:
node src/get-api-key.jsFollow the browser prompts to authorize the application
Copy the refresh token to your configuration
Customizing Templates
You can add custom templates by modifying the DEFAULT_TEMPLATES array in src/index.ts. Templates follow this structure:
interface MarkdownTemplate {
name: string;
description: string;
format: {
header?: string;
chapter_format?: string;
caption_block: string;
timestamp_format?: string;
search_result_format?: string;
}
}License
MIT
Contributing
Fork the repository
Create your feature branch (
git checkout -b feature/amazing-feature)Commit your changes (
git commit -m 'Add some amazing feature')Push to the branch (
git push origin feature/amazing-feature)Open a Pull Request
Available Tools
1 toolget_transcriptC
YouTubeの字幕をURLまたは動画IDから取得します
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | YouTube動画のURLまたはID | |
| lang | Yes | 字幕の言語コード(例: 'ja', 'en') | en |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full burden for behavioral disclosure. It mentions retrieving transcripts but doesn't describe what happens if no transcript exists, rate limits, authentication requirements, error conditions, or the format/scope of returned data. This leaves significant behavioral gaps for a tool that interacts with external APIs.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence in Japanese that clearly communicates the core functionality without any wasted words. It's appropriately sized and front-loaded with the essential information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool with no annotations, no output schema, and interaction with an external service (YouTube), the description is insufficient. It doesn't explain what format the transcript returns, error handling, availability constraints, or any behavioral aspects needed for reliable use by an AI agent.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already fully documents both parameters (url and lang with their descriptions and default). The description adds no additional parameter semantics beyond what's in the schema, maintaining the baseline score for high schema coverage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('取得します' - get/retrieve) and resource ('YouTubeの字幕' - YouTube subtitles/transcripts) with the input source specified ('URLまたは動画IDから' - from URL or video ID). It's specific about what the tool does, though it doesn't need to distinguish from siblings since there are none.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives, prerequisites, or limitations. It simply states what the tool does without context about appropriate use cases or constraints.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
With only one tool, there is no possibility of ambiguity or overlap between tools. The single tool has a clear and distinct purpose focused on retrieving transcripts from YouTube.
A single tool inherently has perfect naming consistency as there are no other tools to compare it against. The tool name 'get_transcript' follows a clear verb_noun pattern.
One tool is too few for a server named 'YouTube MCP Server', which suggests a broader scope. A single transcript retrieval tool feels incomplete for typical YouTube operations like searching videos, listing playlists, or managing uploads.
The tool surface is severely incomplete for a YouTube server. It only covers transcript retrieval, with no tools for core YouTube functionalities such as video search, metadata retrieval, playlist management, or user interactions, leaving significant gaps.
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
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.
Extract YouTube transcripts, search what was said, and read on-screen frames with cited timestamps.
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.14560MIT
- 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
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