youtube-studio-mcp
Provides tools for analyzing YouTube channels and videos, including channel overview, video details, top-performing videos, video listings, and comment retrieval for sentiment analysis.
Provides access to YouTube Studio analytics, enabling retrieval of channel metrics such as views, watch time, subscriber changes, likes, impressions, CTR, traffic sources, and audience demographics over custom date ranges.
Click on "Deploy 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., "@youtube-studio-mcp Show me my top performing videos from the last 28 days."
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.
YouTube Studio & Channel Analytics MCP Server
A Production-Grade Model Context Protocol (MCP) Server for YouTube Studio & Channel Intelligence
Empower AI assistants (Claude, Cursor, Antigravity, etc.) to analyze your YouTube channel, track video metrics, deep-dive into YouTube Studio analytics, discover audience traffic sources, and analyze community sentiment β configured entirely through .env.
π Features & MCP Tool Suite
YouTube Studio MCP provides 8 specialized tools:
Tool | Category | Description |
| Channel Stats | Returns channel title, handle, subscriber count, total lifetime views, video count, topic categories, and description. |
| Studio Analytics | Queries core Studio metrics ( |
| Demographics & Traffic | Detailed breakdowns by dimension: |
| Video Intelligence | Ranks your top videos by views, watch time minutes, or subscribers gained in any date range. |
| Video Deep-Dive | Deep-dive analytics on a single specific video (daily trajectory, watch time, audience retention, traffic sources). |
| Content Inventory | Lists uploaded videos with current views, likes, comments, duration, and privacy status. |
| Video Metadata | Returns full metadata, tags, description, category, and statistics for specified video IDs. |
| Community & Sentiment | Retrieves top comment threads and replies across your channel or on a specific video for sentiment analysis and feedback. |
Related MCP server: youtube-organic-mcp
βοΈ Environment Configuration (.env)
All credentials and settings are read directly from .env:
# Google OAuth 2.0 Credentials (from Google Cloud Console)
YOUTUBE_CLIENT_ID=your_client_id.apps.googleusercontent.com
YOUTUBE_CLIENT_SECRET=your_client_secret
# OAuth Refresh Token (written automatically by run_auth.py)
YOUTUBE_REFRESH_TOKEN=π οΈ Step-by-Step Setup Guide
1. Clone & Install Dependencies with uv
git clone https://github.com/Dhananjayrbiraris/youtube-mcp.git
cd youtube-mcp
uv venv
uv pip install -e .2. Set Up Google Cloud Project (One-Time)
Open Google Cloud Console.
Create a new project (e.g.
YouTube-Studio-MCP).In APIs & Services > Library, enable:
YouTube Data API v3
YouTube Analytics API
In OAuth consent screen:
User Type: External -> fill app name & your email.
Under Test users, add your Google email address.
In Credentials:
Click Create Credentials > OAuth client ID.
Application Type: Desktop App.
Copy the Client ID and Client Secret.
Paste them into
.env:YOUTUBE_CLIENT_ID=123456789-xxxx.apps.googleusercontent.com YOUTUBE_CLIENT_SECRET=GOCSPX-xxxx
3. Run 1-Click Authenticator
uv run run_auth.pyThis launches your browser for a 1-click Google OAuth login. It automatically writes the YOUTUBE_REFRESH_TOKEN directly into your .env file.
4. Connect to your AI Client
Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"youtube-studio": {
"command": "uv",
"args": [
"--directory",
"/absolute/path/to/youtube-mcp",
"run",
"youtube-studio-mcp"
]
}
}
}π‘ Example AI Prompts
"Give me an overview of my YouTube channel's performance over the last 28 days."
"Where is most of my traffic coming from (search, suggested videos, or browse features)?"
"Which of my videos generated the most subscribers this month?"
"Summarize common themes and questions from the comments on my latest video."
"Show me my audience breakdown by age group and country."
π§ͺ Testing
Run the test suite:
pytestπ License
This project is licensed under the MIT License.
Available Tools
8 toolsget_analytics_by_dimensionA
Fetches channel analytics broken down by a specific dimension.
Args: dimension: The dimension to analyze. Supported values: - 'trafficSource' (YouTube search, suggested videos, browse features, external, etc.) - 'deviceType' (mobile phone, computer, TV, tablet) - 'country' (top geographic viewer locations) - 'ageGroup' (demographics: 18-24, 25-34, 35-44, etc.) - 'gender' (viewer gender percentage) - 'operatingSystem' (Android, Windows, iOS, etc.) - 'day' or 'month' time_period: Preset time period ('7d', '28d', '90d', '365d', 'last_month'). Defaults to '28d'. start_date: Optional explicit start date (YYYY-MM-DD). end_date: Optional explicit end date (YYYY-MM-DD). max_results: Maximum number of rows to return (default: 20).
Returns: A ranked list of metrics for each dimension value.
Inputs: dimension (required), end_date, start_date, max_results, +1 more. Returns: result
get_channel_analyticsA
Queries core YouTube Studio channel analytics for a specified timeframe.
Args: time_period: Preset time period ('7d', '28d', '90d', '365d', 'last_month'). Defaults to '28d'. start_date: Explicit start date in YYYY-MM-DD format (overrides time_period if both start & end are provided). end_date: Explicit end date in YYYY-MM-DD format. dimensions: Dimension to group by, e.g. 'day' (default) or None for a single aggregate row.
Returns: Summary metrics (total views, watch time hours, avg view duration, subscribers gained/lost, net growth, likes, shares, comments, impressions, CTR) and daily time-series data points.
Inputs: end_date, dimensions, start_date, time_period. Returns: result
get_channel_overviewA
Fetches high-level metadata and lifetime statistics for your YouTube channel.
Returns channel title, handle, subscriber count, total lifetime views, video count, creation date, topic categories, and channel description.
Inputs: no named parameters. Returns: result
get_top_performing_videosA
Identifies and ranks your top-performing videos within a time period.
Args: time_period: Preset time period ('7d', '28d', '90d', '365d', 'last_month'). Defaults to '28d'. start_date: Optional explicit start date (YYYY-MM-DD). end_date: Optional explicit end date (YYYY-MM-DD). order_by: Metric to rank by: 'views', 'estimatedMinutesWatched', 'subscribersGained', or 'likes'. max_results: Number of top videos to return (default: 10).
Returns: Ranked list of videos with title, duration, period views, watch time, subscribers gained, and lifetime views.
Inputs: end_date, order_by, start_date, max_results, +1 more. Returns: result
get_video_analyticsA
Performs deep-dive analytics on a single specific video.
Args: video_id: The 11-character YouTube video ID (e.g. 'dQw4w9WgXcQ'). time_period: Preset time period ('7d', '28d', '90d', '365d', 'last_month'). Defaults to '28d'. start_date: Optional explicit start date (YYYY-MM-DD). end_date: Optional explicit end date (YYYY-MM-DD).
Returns: Video metadata, daily trajectory, total period views & watch time, and traffic source breakdown for this specific video.
Inputs: video_id (required), end_date, start_date, time_period. Returns: result
get_video_commentsA
Fetches comment threads and audience discussions for a video or the whole channel.
Args: video_id: Optional specific YouTube video ID. If omitted, retrieves recent comments across the channel. max_results: Number of comment threads to fetch (max 100). order: Sort order: 'relevance' (top comments) or 'time' (newest first).
Returns: List of comments with author, comment text, likes, timestamp, and sample replies.
Inputs: order, video_id, max_results. Returns: result
get_video_detailsA
Fetches full metadata, description, tags, and statistics for specified video IDs.
Args: video_ids: Comma-separated list of YouTube video IDs (e.g. 'vid1,vid2').
Returns: Complete video details including title, description, tags, topic categories, view/like/comment counts, duration, and content settings.
Inputs: video_ids (required). Returns: result
list_channel_videosA
Lists your channel's uploaded videos in reverse chronological order.
Args: max_results: Number of videos to retrieve (max 50 per page). page_token: Optional page token for pagination.
Returns: List of videos with video ID, title, publish date, duration, views, likes, comments, and privacy status.
Inputs: page_token, max_results. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
TDQS
Scored across 8 tools
There are several analytics tools with overlapping parameters and outputs: get_channel_analytics can group by day, which overlaps with get_analytics_by_dimension, and get_top_performing_videos overlaps with list_channel_videos in returning video statistics. However, each tool's detailed description clarifies the intended focus (summary vs dimension vs ranked list), so agents can generally disambiguate.
All tools use snake_case and nearly all start with get_, with list_channel_videos as the only list_ exception. The pattern is easily predictable, though get_top_performing_videos and get_analytics_by_dimension are phrase-style names rather than clean verb_noun resource names.
Eight tools is a well-scoped size for a YouTube Studio analytics server; each tool covers a distinct reporting need without redundancy or bloat. This is within the ideal range and doesn't overwhelm an agent.
The toolset provides solid read-only coverage of channel analytics, video metadata/performance, and comments, supporting common creator reporting workflows. Notable gaps exist for video-level dimension breakdowns beyond traffic source and any management actions, but given the analytics-focused descriptions, these are minor.
Maintenance
Related MCP Connectors
Your YouTube channelsβ private analytics for AI assistants: revenue, views, retention. Read-only.
YouTube for AI agents: transcripts, comments, video stats, channel monitor, Shorts captions.
Search YouTube videos, read transcripts and get public video information in your AI assistant.
Fetch YouTube transcripts, monitor channels and track keyword matches from your AI assistant.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceProvides AI assistants with comprehensive YouTube analytics and channel management capabilities, including channel performance, video analytics, audience insights, and content strategy tools.26 npm1-
- AlicenseAqualityCmaintenanceEnables AI assistants to access YouTube organic analytics, including channel stats, video performance, watch time, and audience engagement, via the YouTube Data API v3 and Analytics API v2.630 npmMIT
- FlicenseAqualityDmaintenanceEnables AI assistants to analyze YouTube channels, videos, transcripts, and content strategy through structured tool calls.1726 npm-
- AlicenseBqualityCmaintenanceProvides comprehensive access to YouTube Data, Analytics, and Reporting APIs, enabling AI assistants to manage videos, analyze performance, handle comments, and extract transcripts.40MIT