Provides comprehensive, read-only access to YouTube data, including tools for searching videos and channels, extracting transcripts and metadata, and analyzing playlist or channel content.
Allows for the specialized discovery and listing of YouTube Shorts from specific channels.
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., "@YtMCPsummarize the transcript for the latest video on the 'SpaceX' channel"
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.
YtMCP - YouTube Model Context Protocol Server
YtMCP is a production-grade Model Context Protocol (MCP) server providing comprehensive, read-only access to YouTube data through 16 specialized tools. Designed for both local development (STDIO) and cloud deployment (HTTPS on Render), it combines multiple battle-tested libraries to deliver robust YouTube intelligence for LLM applications.
π Table of Contents
β¨ Features
π Category A: Core Discovery (5 Tools)
search_videos- Basic keyword search with customizable limitssearch_filtered- Advanced search with filters (upload date, duration, sort)get_trending_videos- Fetch current trending videosfind_channels- Search for channels by name or topicfind_playlists- Discover playlists by keyword
π₯ Category B: Video Intelligence (5 Tools)
get_transcript- Extract time-synced transcripts/subtitles (CRITICAL for content analysis)get_video_metadata- Comprehensive video data (views, tags, description, likes, duration)get_video_chapters- Extract video chapters/key momentsget_thumbnail- High-resolution thumbnail URLs (all qualities)get_comments- Fetch top comments (rate-limited for safety)
π Category C: Channel & Playlist Forensics (5 Tools)
get_channel_videos- List channel videos with sorting (newest, oldest, popular)get_channel_shorts- List YouTube Shorts from a channelget_channel_streams- List live streams (past and present)get_playlist_items- Flatten playlist contentsget_channel_about- Channel description and statistics
π οΈ Category D: Utilities (1 Tool)
get_audio_stream_url- Get direct audio stream URLs
π Quick Start
Local Development (STDIO)
Prerequisites:
Python 3.13+
UV package manager (recommended) or pip
Installation:
Run the server:
The server will start in STDIO mode, ready to accept MCP client connections.
Production Deployment (Render)
One-Click Deploy:
Manual Deployment:
Fork this repository
Create a new Web Service on Render:
Go to Render Dashboard
Click "New +" β "Web Service"
Connect your GitHub repository
Configure the service:
Name: ytmcp Environment: Python 3 Build Command: pip install -e . Start Command: ytmcp --transport streamable-http --host 0.0.0.0 --port $PORTSet environment variables (optional):
FASTMCP_LOG_LEVEL=INFODeploy - Render will automatically deploy your MCP server with HTTPS
Your server will be available at: https://ytmcp-<random>.onrender.com
ποΈ Architecture
π§ Design Principles
Rate Limiting First - Global 0.75s delay prevents IP bans
Library Specialization:
scrapetubeβ Fast channel/playlist listingyoutube-search-pythonβ Search & filteringyt-dlpβ Comprehensive metadata extractionyoutube-transcript-apiβ Transcript fetching
LLM-Optimized Output - All responses in Markdown
Dual-Mode Operation - STDIO for local, HTTPS for production
Health Monitoring -
/healthendpoint for load balancers
βοΈ Configuration
MCP Clients
Gemini CLI (.gemini/mcp_config.json)
Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json)
Cursor (.cursor/mcp.json)
VS Code Continue (~/.continue/config.json)
Environment Variables
Variable | Default | Description |
|
| Logging level ( |
|
| Host to bind (HTTP transports) |
|
| Port to bind (HTTP transports) |
| - | Render auto-assigns this (production) |
π API Reference
Example Tool Calls
Search for Videos
Returns: Markdown-formatted list with titles, channels, views, URLs
Get Video Transcript
Returns: Time-synced transcript with [MM:SS] timestamps
Analyze Channel
Returns: Sorted video list with metadata
Extract Metadata
Returns: Comprehensive metadata (views, likes, description, tags, etc.)
π οΈ Development
Setup Development Environment
Running Different Transports
Code Structure
Each tool follows this pattern:
π’ Deployment Guide
Render (Recommended)
Advantages:
Free tier with 750 hours/month
Auto-SSL (HTTPS)
Auto-restart on crashes
GitHub integration for auto-deploy
Steps:
Push code to GitHub
Connect Render to your repo
Use
render.yamlconfiguration (included)Deploy
Health Check: https://your-app.onrender.com/health
MCP Endpoint: https://your-app.onrender.com/mcp
Heroku
Railway
Connect GitHub repo
Add environment variables
Deploy with Procfile
Docker (Self-Hosted)
π Security & Compliance
Read-Only: No write operations to YouTube
No API Keys: Uses scraping libraries (check YouTube ToS for commercial use)
Privacy: No user authentication or tracking
Rate Limiting: Prevents abuse and IP bans
Transport Security: HTTPS in production, SSH for STDIO
β οΈ YouTube Terms of Service: This server uses scraping libraries that bypass official YouTube API quotas. Review YouTube's ToS before deploying for commercial purposes.
π Troubleshooting
Server Won't Start
Check Python version:
Reinstall dependencies:
Rate Limiting Too Aggressive
Adjust in src/ytmcp/middleware/rate_limiter.py:
Render Deployment Fails
Check build logs:
Ensure Python 3.13 is available
Verify
runtime.txtspecifiespython-3.13
Common fix:
MCP Client Can't Connect
Local (STDIO):
Ensure server is running:
uv run ytmcpCheck client config paths are absolute
Restart MCP client
Production (HTTPS):
Verify server health:
curl https://your-app.onrender.com/healthCheck MCP endpoint:
https://your-app.onrender.com/mcpEnsure HTTPS (not HTTP)
π€ Contributing
Contributions welcome! Please:
Review
/researchfor library capabilitiesFollow existing tool patterns
Maintain rate limiting
Format outputs in Markdown
Update documentation
Development Workflow:
π License
MIT License - See LICENSE file
π Acknowledgments
Built with these excellent libraries:
yt-dlp - Video metadata extraction
scrapetube - Channel scraping
youtube-search-python - Search
youtube-transcript-api - Transcripts
MCP Python SDK - Protocol foundation
π Support
Issues: GitHub Issues
Discussions: GitHub Discussions
Documentation: See
/researchfor design decisions
Built with β€οΈ for the LLM ecosystem