Comprehensive read-only access to YouTube data for LLM applications
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
- Quick Start
- Tool Categories
- Architecture
- Configuration
- API Reference
- Development
- Deployment Guide
- Security & Compliance
- Troubleshooting
- Contributing
- License
⨠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:
# Clone the repository
git clone https://github.com/utkarshchaudhary009/ytmcp.git
cd ytmcp
# Install with UV (recommended)
uv sync
# OR install with pip
pip install -e .
Run the server:
# Using UV
uv run ytmcp
# OR using pip
ytmcp
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
ytmcp/
āāā src/
ā āāā ytmcp/
ā āāā __init__.py
ā āāā server.py # Main FastMCP server with health check
ā āāā middleware/
ā ā āāā __init__.py
ā ā āāā rate_limiter.py # Global rate limiting (0.75s delay)
ā āāā tools/
ā āāā __init__.py
ā āāā search.py # Category A: Search tools
ā āāā video.py # Category B: Video intelligence
ā āāā channel.py # Category C: Channel forensics
ā āāā utils.py # Category D: Utilities
āāā examples/ # MCP client configurations
āāā research/ # Library research & feasibility docs
āāā render.yaml # Render deployment config
āāā Procfile
Tools (7)
search_videosBasic keyword search with customizable limitssearch_filteredAdvanced search with filters like upload date, duration, and sort orderget_transcriptExtract time-synced transcripts and subtitles for content analysisget_video_metadataComprehensive video data including views, tags, description, and likesget_video_chaptersExtract video chapters and key momentsget_channel_videosList channel videos with sorting options (newest, oldest, popular)get_audio_stream_urlGet direct audio stream URLsEnvironment Variables
FASTMCP_LOG_LEVELLogging level for the server (e.g., INFO, DEBUG)Configuration
{"mcpServers": {"ytmcp": {"command": "uv", "args": ["--directory", "/path/to/ytmcp", "run", "ytmcp"]}}}