Enables comprehensive extraction and analysis of YouTube data including video metadata, channel statistics, playlist details, comments, transcripts, search functionality, trending videos, and engagement metrics analysis using yt-dlp.
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 Server Enhancedget video info for https://youtube.com/watch?v=dQw4w9WgXcQ"
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 Enhanced π
A comprehensive Micro-Conversational Processor (MCP) server for extracting and analyzing YouTube data using yt-dlp.
π Features
Core Extraction
Video Information: Metadata, statistics, engagement metrics
Channel Information: Stats, subscriber count, view count, verification status
Playlist Details: Video lists, durations, total views
Comments: Threaded comments with replies and engagement
Transcripts: Auto-generated and manual subtitles
Advanced Capabilities
YouTube Search: Search for videos, channels, and playlists
Trending Videos: Get trending content by region
Batch Processing: Extract from multiple URLs concurrently
Intelligent Caching: Configurable TTL-based caching
Automatic Retries: Exponential backoff for failed requests
Health Monitoring: Real-time extractor status and configuration
π οΈ Installation
Prerequisites
Python 3.10+
uv (required)
yt-dlp(automatically installed via uv)
β οΈ Important: This project requires
Setup
βοΈ Configuration
Environment Variables (.env file)
Create a .env file in the project root to configure the server:
Example .env configuration:
MCP Client Configuration
Claude Desktop (macOS)
Add to your ~/Library/Application Support/Claude/claude_desktop_config.json:
Other MCP Clients
For other MCP clients, configure the server command as:
Default Values
Rate Limit: None (uses YouTube's default)
Max Retries: 5 (increased from 3 for better reliability)
Retry Delay: 2.0 seconds (with exponential backoff)
Timeout: 600 seconds (10 minutes)
Cache TTL: 3600 seconds (1 hour)
Cache: Enabled by default
π― Available MCP Tools
Data Extraction
Tool | Description | Example |
| Extract comprehensive video metadata |
|
| Extract channel information and stats (supports multiple URL formats) |
|
| Extract playlist details and video list |
|
| Extract video comments and replies |
|
| Extract video transcripts/subtitles |
|
Search & Discovery
Tool | Description | Example |
| Search for videos, channels, or playlists |
|
| Get trending videos by region |
|
Analysis & Insights
Tool | Description | Example |
| Analyze engagement metrics with benchmarks |
|
| Search for text within video transcripts |
|
Batch Operations
Tool | Description | Example |
| Process multiple URLs concurrently |
|
System Management
Tool | Description | Example |
| Monitor extractor health and status |
|
| View current configuration |
|
| Clear all cached data |
|
MCP Prompts
Prompt | Description | Example |
| Comprehensive video analysis with optional comments/transcript |
|
| Compare engagement metrics across multiple videos |
|
π Data Models
VideoInfo
ChannelInfo
PlaylistInfo
π Usage Examples
Basic Video Analysis
Channel and Playlist Analysis
Search and Discovery
Advanced Analysis
Batch Processing
β‘ Performance Features
Caching
In-Memory Cache: Configurable TTL-based caching
Cache Keys: Unique keys for each request type and parameters
Cache Management: View stats, clear cache, configure TTL
Retry Logic
Automatic Retries: Configurable retry attempts
Exponential Backoff: Increasing delay between retries
Error Handling: Graceful degradation on failures
Batch Processing
Concurrent Extraction: Process multiple URLs simultaneously using asyncio
Async Operations: Non-blocking I/O for better performance
Result Aggregation: Combined results with success/failure counts
π₯ Health Monitoring
Health Status
Configuration View
π¨ Error Handling
Retry Strategy
Automatic Retries: Up to 5 attempts by default (configurable)
Exponential Backoff: 2s, 4s, 8s delays
Rate Limiting: 500KB/s limit with 2-second sleep intervals
Graceful Degradation: Return partial results when possible
Error Types
YouTubeExtractorError: Extraction-specific errors
InvalidURLError: Invalid YouTube URL format
RuntimeError: General execution errors
Troubleshooting
Rate Limiting Issues
If you encounter rate limiting:
Increase sleep intervals in
.env:YOUTUBE_RETRY_DELAY=3.0Lower rate limit:
YOUTUBE_RATE_LIMIT=300KReduce concurrent requests
yt-dlp Not Working
Ensure uv is installed:
uv --versionVerify yt-dlp installation:
uv run yt-dlp --versionThe server automatically uses
uv run yt-dlpif direct access fails
MCP Connection Issues
Restart your MCP client after code changes
Check logs for specific error messages
Verify environment variables are loaded correctly
π§ Development
Running the Server
β οΈ Always use
Testing
π Use Cases
Content Analysis
Video Performance: Analyze view counts, engagement metrics
Channel Growth: Track subscriber and view count trends
Content Discovery: Find trending and popular content
Research & Analytics
Market Research: Analyze competitor channels and content
Trend Analysis: Identify trending topics and content types
Audience Insights: Understand viewer preferences and behavior
Content Management
Playlist Organization: Manage and analyze video collections
Comment Moderation: Extract and analyze user feedback
Transcript Analysis: Process and search video content
π€ Contributing
Fork the repository
Create a feature branch
Make your changes
Add tests for new functionality
Submit a pull request
π License
This project is licensed under the MIT License - see the LICENSE file for details.
π Acknowledgments
yt-dlp: The core YouTube extraction engine
FastMCP: The MCP server framework
Pydantic: Data validation and serialization
π Support
Issues: GitHub Issues
Discussions: GitHub Discussions
Email: info@labeveryday.com
πΊοΈ Roadmap
Batch processing for multiple videos
Caching layer for improved performance
Advanced analytics (engagement analysis, benchmarks)
Rate limiting and quota management
Export functionality (JSON, CSV, etc.)
WebSocket support for real-time updates
Integration examples with popular MCP clients
Made with β€οΈ by Du'An Lightfoot
Empowering developers to extract meaningful insights from YouTube content through the Model Context Protocol.