Skip to main content
Glama

YouTube MCP Server

Production-grade Model Context Protocol (MCP) server for YouTube intelligence. Extract, analyze, and automate insights from YouTube channels and videos using the official YouTube Data API v3.

Built for AI agents, automation pipelines, and content intelligence workflows.


What This Does

This MCP server exposes 16 specialized tools for YouTube analytics and automation:

  • Channel Intelligence — subscriber counts, video lists, upload patterns, topic analysis

  • Video Analytics — detailed metadata, engagement metrics, performance comparison

  • Content Optimization — SEO scoring, tag analysis, thumbnail evaluation

  • Audience Insights — comment extraction, keyword analysis, sentiment signals

  • Trend Discovery — trending video tracking, competitive benchmarking

Built with zero scraping — uses only official YouTube Data API v3 endpoints for reliability and quota efficiency.


Related MCP server: AI Agent MCP Server

Prerequisites

YouTube Data API Key

You must have a YouTube Data API v3 key to use this server.

Get your API key:

  1. Go to Google Cloud Console

  2. Create a new project (or select existing)

  3. Enable YouTube Data API v3:

    • Navigate to APIs & Services → Library

    • Search for "YouTube Data API v3"

    • Click Enable

  4. Create credentials:

    • Go to APIs & Services → Credentials

    • Click Create Credentials → API Key

    • Copy your API key

Quota: Free tier provides 10,000 units/day (sufficient for ~100-500 tool calls depending on complexity).


Installation

Step 1: Clone the repository

git clone https://github.com/Yashkashte5/Youtube-MCP.git
cd Youtube-MCP

Step 2: Install dependencies

pip install -r requirements.txt

Dependencies installed:

  • mcp — MCP protocol server framework

  • requests — YouTube Data API v3 HTTP client

  • youtube-transcript-api — transcript fetching (no OAuth)

  • Pillow — thumbnail image analysis

  • nltk — natural language processing for comment keywords

  • python-dotenv — environment variable management

Step 3: Configure API key

Create a .env file in the project root:

YOUTUBE_API_KEY=YOUR_API_KEY_HERE

Important: Never commit .env to git. It's already in .gitignore.


Running the Server

Standalone (for testing)

python server.py

With Claude Desktop

Add to your claude_desktop_config.json:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "youtube-mcp": {
      "command": "python",
      "args": ["/absolute/path/to/Youtube-MCP/server.py"]
    }
  }
}

Replace /absolute/path/to/Youtube-MCP/ with your actual project path.

Then: Fully quit and relaunch Claude Desktop.


Tools Reference (16 Total)

Channel Analysis

get_channel_overview

Subscriber count, total views, video count, creation date

Demo

get_channel_videos

Recent video list with views, likes, comments, duration

Demo

get_channel_topics

YouTube's topic categories (Gaming, Music, Tech, etc.)

Demo

compare_channels

Side-by-side channel comparison (max 5 channels)

Demo

get_upload_schedule

Posting frequency by day/hour, consistency score

Demo


Video Intelligence

get_video_details

Full metadata: title, description, tags, stats

Demo

get_video_comments

Top comments sorted by relevance with like counts

Demo

get_video_transcript

Auto-generated or manual transcripts for NLP

Demo

compare_videos

Performance comparison across multiple videos

Demo

get_top_videos

Channel's best performers by views/likes/engagement

Demo


SEO & Optimization

analyze_thumbnail

Thumbnail URL, resolution, file size metadata

Demo

get_video_seo_score

0-100 score: title, description, tags, thumbnail quality

Demo

get_tag_analysis

Tag frequency and correlation with video performance

Demo

Popular videos by region/category (Music, Gaming, Movies)

Demo


Advanced Analytics

get_engagement_stats

Like rate, comment rate, engagement rate per video

Demo

get_comment_keywords

Most frequent words in comments (stopwords filtered)

Demo


Architecture

┌─────────────────────────────────────────────────────┐
│  AI Agent / Claude Desktop / MCP Client             │
└──────────────────────┬──────────────────────────────┘
                       │ MCP Protocol
┌──────────────────────▼──────────────────────────────┐
│  server.py                                          │
│  ├─ Tool registration & MCP handlers                │
│  └─ JSON schema definitions                         │
└──────────────────────┬──────────────────────────────┘
                       │ Function calls
┌──────────────────────▼──────────────────────────────┐
│  main.py                                            │
│  ├─ 16 tool implementations                         │
│  ├─ YouTube Data API v3 integration                 │
│  ├─ Transcript API                                  │
│  └─ Data normalization & error handling             │
└──────────────────────┬──────────────────────────────┘
                       │ HTTPS
┌──────────────────────▼──────────────────────────────┐
│  YouTube Data API v3                                │
│  ├─ channels.list                                   │
│  ├─ videos.list                                     │
│  ├─ playlistItems.list                              │
│  ├─ commentThreads.list                             │
│  └─ Public data only                                │
└─────────────────────────────────────────────────────┘

Design principles:

  • MCP = Data layer — deterministic, normalized JSON outputs

  • AI = Reasoning layer — interprets data, generates insights

  • No scraping — official API only for reliability

  • Quota efficient — uses playlistItems.list instead of expensive search.list


Project Structure

Youtube-MCP/
├── server.py              # MCP server, tool registration, schema definitions
├── main.py                # Tool implementations, YouTube API integration
├── requirements.txt       
├── .env                   # API key 
├── .gitignore
├── Demos/                 
└── README.md

Example Use Cases

AI Agents

  • Automated YouTube research assistants

  • Content strategy recommendation systems

  • Competitive intelligence bots

Analytics Pipelines

  • Channel performance dashboards

  • Engagement trend tracking

  • Audience sentiment analysis

Content Optimization

  • SEO audit automation

  • Tag optimization recommendations

  • Upload schedule optimization

Research

  • YouTube ecosystem analysis

  • Creator behavior patterns

  • Viral content dynamics


Contributing

Contributions welcome. Focus areas:

  • Tool reliability — edge case handling, error messages

  • Performance — quota optimization, caching strategies

  • New tools — playlist analytics, growth metrics, predictions

  • Documentation — usage examples, best practices

To contribute:

  1. Fork the repository

  2. Create a feature branch (git checkout -b feature/new-tool)

  3. Commit changes (git commit -m 'Add new tool: X')

  4. Push to branch (git push origin feature/new-tool)

  5. Open a Pull Request


License

MIT License — see LICENSE file for details.


Author

Yash Kashte

GitHub: @Yashkashte5
Project: Youtube-MCP

Available Tools

16 tools
analyze_thumbnailA

Returns basic image metadata for a video's thumbnail: URL, resolution (WIDTHxHEIGHT), and file size in bytes. In v1 this is metadata only — no vision model analysis.

Inputs: video_id (required).

compare_channelsA

Side-by-side overview comparison for multiple channels (max 5). Returns subscriber count, total views, and video count for each, plus declares winners in each category. Good for competitor analysis.

Inputs: channel_urls (required).

compare_videosA

Side-by-side stats comparison for a list of video IDs (max 10). Returns per-video stats and declares winners by views, likes, comments, and engagement rate. Great for understanding why one video outperformed another.

Inputs: video_ids (required).

get_channel_overviewA

Returns a flat overview of a public YouTube channel. Includes subscriber count, total views, total videos, and creation date. Accepts a channel URL in @handle or /channel/UCxxxx format.

Inputs: channel_url (required).

get_channel_topicsA

Returns the topic categories YouTube has associated with a channel. Returns human-readable topic names extracted from Wikipedia category URLs. Raw Freebase topic IDs are excluded as they have been deprecated since 2017 and are not human-readable.

Inputs: channel_url (required).

get_channel_videosA

Returns a list of recent public videos from a channel, with per-video stats: views, likes, comments, duration. Use this as your primary dataset tool for channel analysis. Uses the uploads playlist internally — no quota-expensive search.list.

Inputs: channel_url (required), limit.

get_comment_keywordsA

Extracts the most frequent meaningful words from a video's comments. Deterministic word frequency analysis — no LLM or sentiment model. Useful for understanding what topics and themes resonate with your audience.

Inputs: video_id (required), limit, top_n.

get_engagement_statsA

Computes per-video engagement metrics across a channel's recent videos. Returns average views, likes, comments, like rate %, comment rate %, overall engagement rate %, and the top engaging video. Great for benchmarking your channel's audience engagement health.

Inputs: channel_url (required), limit.

get_tag_analysisA

Aggregates tags across a channel's videos and correlates them with view performance. Returns top tags by frequency and by average views. Useful for finding which tags drive the most traffic.

Inputs: channel_url (required), limit.

get_top_videosA

Returns a channel's top performing videos sorted by a chosen metric. Scans up to 200 recent videos and returns the top N. metric options: views | likes | comments | engagement_rate

Inputs: channel_url (required), metric, limit.

get_upload_scheduleA

Analyzes a channel's upload patterns. Returns posting frequency by day-of-week and hour-of-day, average days between uploads, consistency score, and best posting day/time. Useful for optimizing your own upload schedule.

Inputs: channel_url (required), limit.

get_video_commentsB

Returns top-level comments for a video, sorted by relevance. Includes author, comment text, like count, and publish date. Useful for audience sentiment and feedback analysis.

Inputs: video_id (required), limit.

get_video_detailsA

Returns full metadata for a single video, including tags. Use this to deep-dive into one video after identifying it via get_channel_videos.

Inputs: video_id (required).

get_video_seo_scoreA

Checks a video's metadata against YouTube SEO best practices. Scores title length, description length/quality, tag count, and thumbnail presence. Returns an overall score (0–100) and per-dimension breakdown.

Inputs: video_id (required).

get_video_transcriptB

Fetches the full transcript (auto-generated or manual) of a video. Returns concatenated transcript text, word count, and segment count. Useful for content analysis, summarization, and keyword extraction.

Inputs: video_id (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 16 tools

    Disambiguation4/5

    Most tools have distinct purposes, such as get_channel_overview for channel metadata and get_video_transcript for transcripts, but some overlap exists. For example, get_channel_videos and get_top_videos both retrieve video lists, though they differ in sorting and scope, which could cause minor confusion for an agent.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern, starting with verbs like 'get', 'analyze', or 'compare', followed by descriptive nouns. This uniformity makes the set predictable and easy to navigate, with no deviations in style or convention.

    Tool Count4/5

    With 16 tools, the count is slightly high but reasonable for the YouTube analytics domain, covering diverse aspects like channel analysis, video stats, and SEO. It avoids being overwhelming, though a few tools could potentially be consolidated for tighter scoping.

    Completeness5/5

    The tool set comprehensively covers YouTube analysis, including channel overviews, video details, engagement metrics, comments, transcripts, and SEO. There are no obvious gaps; it supports full workflows from data retrieval to competitive analysis and optimization.

    Maintenance

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    Appeared in Searches