The YouTube MCP Server enables comprehensive interaction with YouTube data through advanced querying, analysis, and transcription tools.
Search and Filter Videos: Advanced search with filters like query, channel, region, duration, publish date, and quality.
Retrieve Video Details: Get comprehensive information including statistics and metadata for specific videos.
Channel Analysis: Evaluate channel statistics and analyze performance trends.
Compare Videos: Compare statistical information across multiple videos.
Trending Content: Discover trending videos by region and category.
Comments Access: Retrieve comments for specific videos.
Transcript Tools: Access video captions with language selection, time-based filtering, searching within transcripts, multi-video extraction, and smart segmentation.
Content Analysis: Extract key moments, generate video summaries with customizable length, and obtain segment-by-segment breakdown of video content.
Error Handling: Robust handling of issues to ensure reliability.
Allows querying YouTube data, including searching for videos, retrieving video and channel information, and fetching video comments through the YouTube Data API.
YouTube MCP Server
A Model Context Protocol (MCP) server for interacting with YouTube data. This server provides resources and tools to query YouTube videos, channels, comments, and transcripts through a stdio interface.
Features
Search for YouTube videos with advanced filtering options
Get detailed information about specific videos and channels
Compare statistics across multiple videos
Discover trending videos by region and category
Analyze channel performance and video statistics
Retrieve video comments and transcripts/captions
Generate video analysis and transcript summaries
Related MCP server: YouTube Translate MCP
Prerequisites
Node.js (v16+)
YouTube Data API key
Installation
Installing via Smithery
To install YouTube MCP Server for Claude Desktop automatically via Smithery:
Installing Manually
Clone this repository:
git clone https://github.com/coyaSONG/youtube-mcp-server.git cd youtube-mcp-serverInstall dependencies:
npm installCreate a
.envfile in the root directory:YOUTUBE_API_KEY=your_youtube_api_key_here PORT=3000
Usage
Building and Running
Build the project:
npm run buildRun the server (HTTP transport):
npm startThe server will listen on port 3000 (or PORT environment variable) and accept MCP requests at
/mcpendpoint.Run in development mode:
npm run devClean build artifacts:
npm run clean
HTTP Transport Migration
Migration Status: ✅ Complete - Successfully migrated from STDIO to Streamable HTTP transport
This server has been updated to use the modern Streamable HTTP transport as required by Smithery hosting platform. The migration includes:
Modern Protocol: Uses Streamable HTTP transport (protocol version 2025-03-26)
Express.js Framework: Built on Express.js for robust HTTP handling
Session Management: Supports stateful operations with proper session tracking
MCP Endpoint: All requests handled at
/mcpendpointBackwards Compatibility: Maintains full compatibility with all existing tools and resources
Enhanced Performance: Improved scalability and better error handling
Testing the Migration
Local Testing:
Smithery Integration:
The server is fully compatible with Smithery's new hosting requirements
All existing Claude Desktop integrations will continue to work seamlessly
No changes required for end users
Docker Deployment
The project includes a Dockerfile for containerized deployment:
Important: The container now exposes port 3000 for HTTP-based MCP communication instead of STDIO.
API Reference
Resources
youtube://video/{videoId}- Get detailed information about a specific videoyoutube://channel/{channelId}- Get information about a specific channelyoutube://transcript/{videoId}- Get transcript for a specific videoOptional query parameter:
?language=LANGUAGE_CODE(e.g.,en,ko,ja)
Tools
Basic Tools
search-videos- Search for YouTube videos with advanced filtering optionsget-video-comments- Get comments for a specific videoget-video-transcript- Get transcript for a specific video with optional languageenhanced-transcript- Advanced transcript extraction with filtering, search, and multi-video capabilitiesget-key-moments- Extract key moments with timestamps from a video transcript for easier navigationget-segmented-transcript- Divide a video transcript into segments for easier analysis
Statistical Tools
get-video-stats- Get statistical information for a specific videoget-channel-stats- Get subscriber count, view count, and other channel statisticscompare-videos- Compare statistics across multiple videos
Discovery Tools
get-trending-videos- Retrieve trending videos by region and categoryget-video-categories- Get available video categories for a specific region
Analysis Tools
analyze-channel-videos- Analyze performance trends of videos from a specific channel
Prompts
video-analysis- Generate an analysis of a YouTube videotranscript-summary- Generate a summary of a video based on its transcript with customizable length and keywords extractionsegment-by-segment-analysis- Provide detailed breakdown of content by analyzing each segment of the video
Examples
Accessing a Video Transcript
Getting a Transcript in a Specific Language
Using the Statistical Tools
Using the Transcript Summary Prompt
Using the Enhanced Transcript Tool
Using the Enhanced Transcript Analysis Features
Error Handling
The server handles various error conditions, including:
Invalid API key
Video or channel not found
Transcript not available
Network issues
License
MIT