YouTube video streams with floating thumbnails and API data visualization
MCP Server • Production Ready • v0.3.6

YouTube MCP Server

Comprehensive YouTube data extraction with 26 tools. Extract transcripts, search comments, track engagement, and find implementation details from technical tutorials.

26
Tools
356
Tests Passing
0
Quota Cost*
90%
Quota Savings

*Transcript downloads via OAuth cost 0 quota units!

Quick Start

1. Installation

git clone https://github.com/username/youtube-mcp.git
cd youtube-mcp
pip install -e .

2. Google Cloud Setup

  1. Create project at Google Cloud Console
  2. Enable YouTube Data API v3
  3. Create OAuth 2.0 credentials (Desktop app type)
  4. Download client_secrets.json to ~/.youtube-mcp/

3. Authentication

# Add your Google account
youtube-mcp-auth add

# Verify it works
youtube-mcp-auth list
youtube-mcp-auth test <account-alias>

4. Claude Desktop Configuration

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "youtube": {
      "command": "/path/to/venv/bin/python",
      "args": ["-m", "youtube_mcp"],
      "env": {
        "YOUTUBE_MCP_CONFIG_DIR": "/Users/username/.youtube-mcp"
      }
    }
  }
}

5. First Commands in Your AI Assistant

  • • "Get the transcript for https://youtube.com/watch?v=dQw4w9WgXcQ"
  • • "What are the top comments on this video?"
  • • "Find all mentions of 'authentication' in the transcript"

Key Features

🔐

OAuth 2.0 Authentication

Automatic token refresh and multi-account support for unlimited quota scaling.

📝

Transcript Extraction

Zero quota cost via OAuth! Smart chunking for long videos, multiple formats supported.

💬

Comment Analysis

Extract comments with threads, search for issues, find solutions in replies.

📊

Analytics & Engagement

Track view velocity, engagement rates, viral indicators, comment timelines.

🔍

Advanced Search

Cross-account search, concept tracking, code block detection with language filters.

💾

Smart Caching

90% quota reduction with intelligent caching system. Fast repeated queries.

All 26 Tools Reference

📝 Transcript Tools (3)

get_video_transcript

Extract video transcripts with intelligent size handling. Long videos return lightweight index, short videos return full transcript.

Formats: JSON, SRT, VTT, TXT
Features: Chunking, time ranges, timestamp intervals, auto-translate
# Get transcript index for long video
get_video_transcript(video_id="abc123")

# Get specific time range
get_video_transcript(
    video_id="abc123",
    time_range=["00:10:00", "00:20:00"]
)

# Get chunked full transcript
get_video_transcript(
    video_id="abc123",
    chunk_size=100,
    chunk_index=0
)

check_transcript_availability

Check transcript availability before fetching. Lists available languages, manual vs auto-captions.

check_transcript_availability(video_id="abc123")
# Returns: {available: true, languages: ["en", "es"], has_auto_captions: true}

search_transcript

Search within transcripts with regex support and code block detection. Context enrichment for implementation details.

# Text search
search_transcript(
    video_id="abc123",
    search_query="authentication",
    context_lines=2
)

# Code search with language filter
search_transcript(
    video_id="abc123",
    search_type="code",
    code_language_filter="python"
)

# Enhanced with implementation context
search_transcript(
    video_id="abc123",
    search_query="API call",
    context_type="implementation"
)

🎥 Video Context Tools (2)

get_video_context

Get comprehensive video metadata. Lightweight by default (~2-3KB), optional transcript/comments.

# Metadata only
get_video_context(video_id="abc123")

# With transcript status
get_video_context(
    video_id="abc123",
    include_transcript_status=True
)

# Full context
get_video_context(
    video_id="abc123",
    include_transcript=True,
    include_comments=True
)

get_video_summary

Generate intelligent video summaries from transcript analysis with three detail levels.

get_video_summary(
    video_id="abc123",
    summary_length="standard"  # brief/standard/detailed
)

🔍 Search Tools (3)

search_videos

Search YouTube with advanced filters and sorting options.

search_videos(
    query="machine learning tutorial",
    duration="medium",
    caption="closedCaption",
    published_after="2024-01-01T00:00:00Z",
    order="viewCount"
)

search_all_accounts

Cross-account search with automatic deduplication. Powerful for quota balancing.

search_all_accounts(
    query="python async tutorial",
    max_results_per_account=25
)

search_concept_across_videos

Track concepts across multiple videos in a channel or playlist.

# Search across channel
search_concept_across_videos(
    concept="async/await",
    channel_id="UCxxx",
    max_videos=20
)

💬 Comment Tools (3)

get_video_comments

Extract video comments with thread support and search filtering.

search_video_comments

Search for specific comments within a video.

get_implementation_issues

Extract common errors and bugs from comments with solution extraction.

📊 Analytics Tools (2)

get_aggregated_stats

Calculate statistics across multiple videos with channel breakdown.

get_engagement_timeline

Analyze video engagement patterns, view velocity, viral indicators.

Additional Tools (13 more)

Channel & Playlist:

  • • get_channel_context
  • • get_channel_videos
  • • get_playlist_info
  • • get_playlist_videos
  • • search_playlists

Implementation Helpers:

  • • get_prerequisites
  • • extract_repository_links
  • • get_related_videos
  • • analyze_video_series

Batch & Export:

  • • batch_get_context
  • • batch_get_transcript
  • • export_comments_to_csv
  • • export_transcript_to_file

Common Use Cases

For Developers Learning from Tutorials

  1. 1. Check if video has transcript
  2. 2. Get prerequisites before watching
  3. 3. Find repository and dependencies
  4. 4. Search for specific implementation
  5. 5. Check for common errors

For Content Analysis

  1. 1. Get video overview and summary
  2. 2. Analyze engagement timeline
  3. 3. Find trending moments in comments
  4. 4. Track concept across video series

For Research & Documentation

  1. 1. Search across all accounts
  2. 2. Batch process multiple videos
  3. 3. Aggregate statistics
  4. 4. Export for analysis

For Code Discovery

  1. 1. Search for code in transcripts
  2. 2. Filter by programming language
  3. 3. Extract repository links
  4. 4. Find implementation issues in comments

Technical Details

Tech Stack

  • Language: Python 3.10+
  • API: YouTube Data API v3
  • Auth: OAuth 2.0 with auto-refresh
  • Caching: SQLite + connection pooling
  • Testing: pytest with AsyncMock
  • Code Quality: black, ruff, mypy

Project Stats

  • Version: v0.3.6
  • Total Tools: 26
  • Tests: 356 (100% passing)
  • Lines of Code: ~15,000+
  • Python Support: 3.10, 3.11, 3.12, 3.13
  • License: MIT

Performance

  • Cache Hit Rate: ~90% quota savings
  • Connection Pooling: 5 clients per account
  • Rate Limiting: 10 req/s per account
  • Response Time: <500ms (cached), <2s (uncached)

Known Limitations

  • • SRT/VTT export returns empty (OAuth API limitation)
  • • Large transcripts return index by default
  • • Daily quota: 10,000 units per account
  • • Use TXT/JSON for reliable exports

Business Impact

How this MCP server delivers measurable value for developers and AI-powered workflows

⏱️

Time Savings

80%+

Automated video research that would take hours manually. Extract transcripts, analyze comments, and find implementation details in minutes instead of hours of manual watching.

💰

Cost Efficiency

90%

Quota savings through OAuth transcript downloads (0 quota units). Multi-account support enables parallel processing without hitting daily limits.

Quality & Reliability

356

Passing tests ensure production reliability. Comprehensive error handling and well-documented API make integration straightforward and maintainable.

Real-World Use Cases

📚

Technical Research

Extract implementation details from coding tutorials. Search transcripts for specific functions, libraries, or patterns mentioned in videos.

📊

Content Analysis

Analyze engagement patterns, track comment sentiment, and understand what resonates with audiences across multiple channels.

🎯

Competitive Intelligence

Monitor competitor channels, track trending topics, and identify gaps in content coverage within your industry.

🤖

AI Training Data

Build knowledge bases from video content. Extract structured data for fine-tuning domain-specific AI models or RAG systems.

Related Projects

Get Started Today

Production-ready MCP server with comprehensive documentation and 100% test coverage.