🔌

YouTube MCP

Media420

Search, transcribe, and analyze YouTube videos and channels.

Claude DesktopCursor

Overview

Search, transcribe, and analyze YouTube videos and channels.

Setup

Run with npx:

npx -y @modelcontextprotocol/server-youtube

Configuration

YOUTUBE_API_KEY environment variable

Documentation

YouTube MCP

Overview

YouTube MCP is a Model Context Protocol server that provides access to YouTube's extensive video library. It enables AI agents to search for videos, retrieve video metadata, transcribe audio, and analyze video content.

With over 2 billion logged-in monthly users and 500 hours of video uploaded every minute, YouTube is the world's largest video platform. The MCP integration brings this vast content library directly into AI agent workflows, enabling research, learning, content analysis, and more.

Features

  • Video Search: Find videos by keywords, topics, and filters
  • Video Metadata: Retrieve title, description, duration, views, likes, channel info
  • Transcription: Get auto-generated or manual captions for videos
  • Channel Information: Access channel details, subscriber count, video lists
  • Playlist Support: Browse and analyze playlists
  • Comment Analysis: Retrieve and analyze video comments
  • Filter Options: Search by date, duration, type, and more

Installation

npx -y @modelcontextprotocol/server-youtube

Configuration

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "youtube": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-youtube"],
      "env": {
        "YOUTUBE_API_KEY": "YOUR_YOUTUBE_API_KEY"
      }
    }
  }
}

Getting a YouTube API Key

  1. Go to Google Cloud Console
  2. Create a new project or select an existing one
  3. Enable the YouTube Data API v3
  4. Create credentials (API key)
  5. Add the API key to your MCP configuration

Available Tools

ToolDescription
search_videosSearch for videos by query
get_video_detailsGet detailed video information
get_transcriptGet video transcript/captions
get_channel_detailsGet channel information
get_channel_videosList videos from a channel
get_playlist_itemsGet videos from a playlist
search_channelsSearch for channels

Usage Examples

Search for Videos

results = search_videos(
    query="Introduction to Machine Learning",
    max_results=10,
    order="relevance",
    video_duration="medium",  # short, medium, long
)
for video in results:
    print(f"{video.title} - {video.channel_title}")
    print(f"  Duration: {video.duration}")
    print(f"  Views: {video.view_count}")

Get Video Transcript

video_id = "dQw4w9WgXcQ"
transcript = get_transcript(video_id=video_id)

# Process transcript
for line in transcript:
    print(f"[{line.start:.1f}s] {line.text}")

# Summarize video content
summary = analyze_transcript(transcript)

Get Channel Information

channel = get_channel_details(channel_id="UC_x5XG1OV2P6uZZ5FSM9Ttw")
print(f"Channel: {channel.title}")
print(f"Subscribers: {channel.subscriber_count}")
print(f"Total Videos: {channel.video_count}")

# Get recent videos
videos = get_channel_videos(channel_id=channel.id, max_results=5)

Research Workflow

# Find videos on a topic
videos = search_videos(
    query="deep learning transformers explained",
    max_results=20,
    order="viewCount",
    published_after="2025-01-01",
)

# Get transcripts for top videos
for video in videos[:5]:
    transcript = get_transcript(video_id=video.id)
    summary = summarize(transcript)
    print(f"\n=== {video.title} ===")
    print(summary)

Pros

  • Massive Content Library: Access to billions of videos
  • Transcription Available: Auto-generated captions for most videos
  • Rich Metadata: Views, likes, duration, channel info
  • Search Filters: Date, duration, type, and more
  • Channel Analysis: Track channels and their content

Cons

  • API Key Required: Need YouTube Data API credentials
  • Quota Limits: YouTube API has daily quota limits
  • Not All Videos Transcribed: Some videos lack captions
  • Rate Limiting: API calls are rate-limited

When to Use

Use YouTube MCP when:

  • You need to research topics using video content
  • You want to analyze video transcripts for insights
  • You're building educational or research tools
  • You need to find tutorial videos on specific topics

Avoid YouTube MCP when:

  • You need guaranteed high-volume access (quota limits)
  • You need transcripts for all videos (some lack captions)
  • You're on a tight budget (API quota costs)

Resources