Skip to main content
Glama
YouTube Upload & Studio MCP Server

YouTube Upload & Studio MCP Server

by harsh-096

YouTube Upload & Studio MCP Server (youtube-upload-mcp)

A security-hardened Model Context Protocol (MCP) server for uploading videos to YouTube and managing your channel, playlists, comments, analytics, SEO, transcripts, and bulk reports.

Security & Safety Features

Built from the ground up with guardrails for AI-assisted channel management:

  • MCP Tool Safety Annotations (ToolAnnotations): Every tool declares readOnlyHint, destructiveHint, and idempotentHint so MCP clients prompt before write/delete operations.

  • Explicit Confirmation for Irreversible Deletions: youtube_delete_video, youtube_delete_playlist, youtube_remove_from_playlist, and youtube_delete_comment require confirm=True (default False returns a dry-run warning).

  • Private-by-Default Publishing: youtube_upload_video and youtube_create_playlist default to privacy_status="private".

  • SSRF & Token-Leak Protection: youtube_reporting_download strictly enforces https://*.googleapis.com URLs (including across HTTP redirects) so OAuth Bearer tokens cannot be sent to untrusted hosts.

  • Scoped OAuth Profiles: Choose YOUTUBE_MCP_SCOPE_PROFILE:

    • full (default): all 43 tools

    • upload_only: read channel + upload videos only (no delete/comment/revenue scopes)

    • read_only: read-only channel and analytics

  • Optional Media Directory Allowlist: Set YOUTUBE_MCP_ALLOWED_MEDIA_DIR to restrict video and thumbnail uploads to a specific folder.

  • Persistent Daily Quota Tracking: Tracks the 10,000-unit daily YouTube Data API v3 quota in ~/.youtube-mcp/quota.json (resetting at midnight Pacific Time) so server restarts do not lose quota state.

  • Input Validation: Sanitizes YouTube IDs before Analytics filter queries and enforces YouTube's 2 MB limit on custom thumbnails.


Related MCP server: youtube-mcp

Prerequisites

  • Python 3.11+

  • A Google Cloud project with:

    • YouTube Data API v3

    • YouTube Analytics API

    • YouTube Reporting API

  • OAuth 2.0 Desktop App credentials (client_secret.json)

Google Cloud Setup

  1. Open Google Cloud Console and create or select a project.

  2. Enable YouTube Data API v3, YouTube Analytics API, and YouTube Reporting API in APIs & Services > Library.

  3. Configure APIs & Services > OAuth consent screen (External) and add your YouTube channel owner Google account as a Test User.

  4. Go to APIs & Services > Credentials > Create Credentials > OAuth client ID > Desktop app.

  5. Download the JSON file and save it as ~/.youtube-mcp/client_secret.json (or set YOUTUBE_MCP_CLIENT_SECRET).


Installation

git clone <your-repo-url>
cd youtube-upload-mcp
python -m venv .venv

Activate the virtual environment and install:

# Windows (PowerShell)
.\.venv\Scripts\Activate.ps1
pip install -e ".[dev]"

# macOS / Linux
source .venv/bin/activate
pip install -e ".[dev]"

MCP Client Configuration

Example configuration for Claude Desktop, Claude Code, Cursor, Antigravity, or any MCP client:

Windows:

{
  "mcpServers": {
    "youtube": {
      "command": "C:/path/to/youtube-upload-mcp/.venv/Scripts/youtube-upload-mcp.exe",
      "env": {
        "YOUTUBE_MCP_CLIENT_SECRET": "C:/Users/you/.youtube-mcp/client_secret.json",
        "YOUTUBE_MCP_SCOPE_PROFILE": "full",
        "YOUTUBE_MCP_ALLOWED_MEDIA_DIR": "C:/Users/you/Videos/ToUpload"
      }
    }
  }
}

macOS / Linux:

{
  "mcpServers": {
    "youtube": {
      "command": "/path/to/youtube-upload-mcp/.venv/bin/youtube-upload-mcp",
      "env": {
        "YOUTUBE_MCP_CLIENT_SECRET": "/home/you/.youtube-mcp/client_secret.json",
        "YOUTUBE_MCP_SCOPE_PROFILE": "full",
        "YOUTUBE_MCP_ALLOWED_MEDIA_DIR": "/home/you/Videos/ToUpload"
      }
    }
  }
}

Tip: If you only want an AI assistant to upload videos and read stats without deletion or comment permissions, set "YOUTUBE_MCP_SCOPE_PROFILE": "upload_only".


Testing & Verification

1. Run Automated Tests & Linter (No Google Account Needed)

pytest -v
ruff check src tests

2. Test the MCP Server Interactively with MCP Inspector

If you have Node.js installed, you can inspect and call all 43 tools in a browser UI before connecting an AI client:

# Windows (PowerShell)
npx @modelcontextprotocol/inspector C:\path\to\youtube-upload-mcp\.venv\Scripts\youtube-upload-mcp.exe
# macOS / Linux
npx @modelcontextprotocol/inspector /path/to/youtube-upload-mcp/.venv/bin/youtube-upload-mcp

3. Safe Live End-to-End Test Checklist

Once your client_secret.json is in place (~/.youtube-mcp/client_secret.json), test in this order:

  1. Call youtube_auth: opens your browser to sign in with the Google account that owns your channel and saves ~/.youtube-mcp/token.json.

  2. Call youtube_auth_status: confirms authentication, active scope_profile, and remaining daily quota.

  3. Call youtube_get_channel with mine=True: verifies read access to your channel.

  4. Call youtube_upload_video with a short test .mp4 (it defaults to privacy_status="private" so nothing goes public until you publish it in YouTube Studio).


Environment Variables

Variable

Default

Description

YOUTUBE_MCP_CLIENT_SECRET

~/.youtube-mcp/client_secret.json

Path to Google OAuth Desktop App JSON

YOUTUBE_MCP_CONFIG_DIR

~/.youtube-mcp

Directory for token.json and quota.json

YOUTUBE_MCP_SCOPE_PROFILE

full

full, upload_only, or read_only

YOUTUBE_MCP_ALLOWED_MEDIA_DIR

(unset)

Optional folder allowlist for video/thumbnail uploads

YOUTUBE_MCP_DAILY_QUOTA

10000

Daily quota limit enforced client-side

YOUTUBE_API_KEY

(unset)

Optional API key for public-only lookups


Tools Reference (43 Tools)

  • Auth & Status (2): youtube_auth, youtube_auth_status

  • Channel & Video (3): youtube_get_channel, youtube_list_videos, youtube_get_video

  • Publishing (4): youtube_upload_video, youtube_update_video, youtube_set_thumbnail, youtube_delete_video

  • Playlists (6): youtube_list_playlists, youtube_create_playlist, youtube_update_playlist, youtube_delete_playlist, youtube_add_to_playlist, youtube_remove_from_playlist

  • Comments (4): youtube_list_comments, youtube_post_comment, youtube_reply_to_comment, youtube_delete_comment

  • Search & SEO (4): youtube_search, youtube_search_suggestions, youtube_trending, youtube_get_categories

  • Transcripts (2): youtube_list_captions, youtube_get_transcript

  • Analytics (13): youtube_analytics_overview, youtube_analytics_top_videos, youtube_analytics_top_shorts, youtube_analytics_video_detail, youtube_analytics_traffic_sources, youtube_analytics_demographics, youtube_analytics_geography, youtube_analytics_daily, youtube_analytics_day_of_week, youtube_analytics_content_type_breakdown, youtube_analytics_revenue, youtube_analytics_revenue_by_video, youtube_analytics_retention

  • Bulk Reporting (5): youtube_reporting_list_types, youtube_reporting_create_job, youtube_reporting_list_jobs, youtube_reporting_list_reports, youtube_reporting_download


License

MIT

Available Tools

43 tools
youtube_add_to_playlistB

Add a video to a playlist.

Args: playlist_id: Playlist ID to add the video to. video_id: Video ID to add. position: Optional 0-based position in the playlist.

Inputs: video_id (required), playlist_id (required), position.

youtube_analytics_content_type_breakdownC
Read-onlyIdempotent

Compare performance of Shorts vs long-form videos vs live streams.

Inputs: end_date, start_date.

youtube_analytics_dailyC
Read-onlyIdempotent

Get daily performance metrics over time.

Inputs: end_date, start_date.

youtube_analytics_day_of_weekC
Read-onlyIdempotent

Get average performance aggregated by day of the week.

Inputs: end_date, start_date.

youtube_analytics_demographicsC
Read-onlyIdempotent

Get audience age group and gender breakdown.

Inputs: end_date, start_date.

youtube_analytics_geographyC
Read-onlyIdempotent

Get views and watch time by country.

Inputs: end_date, start_date, max_results.

youtube_analytics_overviewC
Read-onlyIdempotent

Get channel-level analytics summary (views, watch time, subs, likes, comments, shares).

Inputs: end_date, start_date.

youtube_analytics_retentionC
Read-onlyIdempotent

Get audience retention curve for a specific video.

Inputs: video_id (required), end_date, start_date.

youtube_analytics_revenueB
Read-onlyIdempotent

Get revenue breakdown (requires YouTube Partner Program).

Inputs: end_date, start_date.

youtube_analytics_revenue_by_videoC
Read-onlyIdempotent

Get revenue per video, sorted by highest revenue.

Inputs: end_date, start_date, max_results.

youtube_analytics_top_shortsC
Read-onlyIdempotent

Get top-performing Shorts by views.

Inputs: end_date, start_date, max_results.

youtube_analytics_top_videosA
Read-onlyIdempotent

Get top-performing videos by views (excluding Shorts).

Inputs: end_date, start_date, max_results.

youtube_analytics_traffic_sourcesC
Read-onlyIdempotent

Get traffic source breakdown (search, suggested, browse, external, etc.).

Inputs: end_date, video_id, start_date.

youtube_analytics_video_detailB
Read-onlyIdempotent

Get daily analytics for a specific video.

Inputs: video_id (required), end_date, start_date.

youtube_authA

Initiate OAuth 2.0 authentication flow.

Opens a browser window for Google OAuth consent using your own client_secret.json. Required before using tools that access or modify your YouTube channel.

Inputs: no named parameters.

youtube_auth_statusA
Read-onlyIdempotent

Check current authentication status, scope profile, and daily quota usage.

Inputs: no named parameters.

youtube_create_playlistA

Create a new playlist (private by default).

Args: title: Playlist title. description: Playlist description. privacy_status: "private" (default), "public", or "unlisted".

Inputs: title (required), description, privacy_status.

youtube_delete_commentB
DestructiveIdempotent

Delete a comment permanently. This action is irreversible.

Args: comment_id: Comment ID to delete. confirm: Must be True to execute the deletion.

Inputs: comment_id (required), confirm.

youtube_delete_playlistA
DestructiveIdempotent

Delete a playlist permanently. Does not delete the videos inside it.

Args: playlist_id: Playlist ID to delete. confirm: Must be True to execute the deletion.

Inputs: playlist_id (required), confirm.

youtube_delete_videoA
DestructiveIdempotent

Delete a video permanently. This action is irreversible.

Args: video_id: YouTube video ID to delete. confirm: Must be True to execute the deletion. When False (default), returns a safety confirmation prompt without deleting anything.

Inputs: video_id (required), confirm.

youtube_get_categoriesA
Read-onlyIdempotent

List assignable YouTube video categories for a region (costs 1 quota unit).

Inputs: region_code.

youtube_get_channelA
Read-onlyIdempotent

Get channel details by channel ID, handle (@username), or the authenticated channel.

Args: channel_id: YouTube channel ID (e.g., "UCxxxxxxx"). handle: Channel handle (e.g., "@mkbhd"). mine: If True, get the authenticated user's own channel.

Inputs: mine, handle, channel_id.

youtube_get_transcriptA
Read-onlyIdempotent

Get transcript/captions for a video.

Uses youtube-transcript-api by default (works for public videos, zero quota). Set use_official_api=True to use the official YouTube Data API (own videos).

Inputs: video_id (required), language, use_official_api.

youtube_get_videoB
Read-onlyIdempotent

Get detailed metadata and statistics for a specific video.

Args: video_id: YouTube video ID (e.g., "dQw4w9WgXcQ").

Inputs: video_id (required).

youtube_list_captionsA
Read-onlyIdempotent

List available caption tracks for a video you own (requires OAuth).

Inputs: video_id (required).

youtube_list_commentsA
Read-onlyIdempotent

List top-level comments on a video.

Args: video_id: YouTube video ID. max_results: Number of comment threads to return (0 or negative fetches all). order: Sort order: "relevance" or "time".

Inputs: video_id (required), order, max_results.

youtube_list_playlistsB
Read-onlyIdempotent

List playlists for a channel.

Args: channel_id: Channel ID to list playlists from. mine: If True, list the authenticated user's playlists. max_results: Number of playlists to return (0 or negative fetches all).

Inputs: mine, channel_id, max_results.

youtube_list_videosA
Read-onlyIdempotent

List videos from a channel or playlist, sorted by most recent.

Args: channel_id: Channel ID to list videos from. playlist_id: Playlist ID to list videos from (overrides channel_id). mine: If True, list the authenticated user's videos. max_results: Number of videos to return. Values above 50 page through results; 0 or negative fetches every video in the playlist.

Inputs: mine, channel_id, max_results, playlist_id.

youtube_post_commentB

Post a new top-level comment on a video.

Args: video_id: YouTube video ID to comment on. text: Comment text.

Inputs: text (required), video_id (required).

youtube_remove_from_playlistA
DestructiveIdempotent

Remove a video from a playlist using its playlist_item_id.

Args: playlist_item_id: The playlist item ID (not the video ID). confirm: Must be True to execute the removal.

Inputs: playlist_item_id (required), confirm.

youtube_reply_to_commentA

Reply to an existing comment.

Args: parent_id: Comment ID to reply to (from youtube_list_comments). text: Reply text.

Inputs: text (required), parent_id (required).

youtube_reporting_create_jobC

Schedule a daily bulk reporting job.

Inputs: report_type_id (required), name.

youtube_reporting_downloadB
Read-onlyIdempotent

Download a report CSV from a trusted Google API HTTPS URL.

Only https://*.googleapis.com URLs are permitted so OAuth tokens cannot be leaked to untrusted hosts.

Inputs: download_url (required).

youtube_reporting_list_jobsB
Read-onlyIdempotent

List all active reporting jobs.

Inputs: no named parameters.

youtube_reporting_list_reportsC
Read-onlyIdempotent

List available reports for a reporting job.

Inputs: job_id (required).

youtube_reporting_list_typesB
Read-onlyIdempotent

List available YouTube bulk report types.

Inputs: no named parameters.

youtube_search_suggestionsB
Read-onlyIdempotent

Get YouTube autocomplete/search suggestions for SEO research (no quota cost).

Inputs: query (required), language.

youtube_set_thumbnailA
Idempotent

Upload a custom thumbnail for a video (max 2 MB).

Args: video_id: YouTube video ID. file_path: Path to the thumbnail image (JPEG, PNG, GIF, or BMP; max 2 MB).

Inputs: video_id (required), file_path (required).

youtube_update_playlistB
Idempotent

Update metadata for an existing playlist.

Args: playlist_id: Playlist ID to update. title: New title. description: New description. privacy_status: "private", "public", or "unlisted".

Inputs: playlist_id (required), title, description, privacy_status.

youtube_update_videoA
Idempotent

Update metadata for an existing video.

Only provided fields are updated; others remain unchanged.

Args: video_id: YouTube video ID. title: New title (max 100 characters). description: New description (max 5,000 characters). tags: New tags (replaces existing tags). category_id: New category ID. privacy_status: "private", "public", or "unlisted". publish_at: ISO 8601 datetime to schedule publishing (requires privacy_status="private"). made_for_kids: COPPA self-declaration (True/False).

Inputs: video_id (required), tags, title, publish_at, +4 more.

youtube_upload_videoA

Upload a video to YouTube.

Costs 1,600 quota units. Video is uploaded as private by default.

Args: file_path: Path to the local video file. title: Video title (max 100 characters). description: Video description (max 5,000 characters). tags: Optional list of tags. category_id: YouTube category ID (default "22" = People & Blogs). privacy_status: "private" (default), "public", or "unlisted". publish_at: ISO 8601 datetime to schedule publishing (requires privacy_status="private"). made_for_kids: COPPA self-declaration (default False).

Inputs: title (required), file_path (required), tags, publish_at, +4 more.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3.1/5.0

    Scored across 43 tools

    Disambiguation4/5

    The analytics family is granular but mostly non-overlapping (traffic sources vs demographics vs geography vs retention), and the CRUD tools target distinct resources. Minor confusion is possible between youtube_analytics_daily, youtube_analytics_video_detail, and youtube_analytics_day_of_week, and between youtube_list_captions and youtube_get_transcript, but descriptions clarify the boundaries.

    Naming Consistency4/5

    Nearly all names follow a predictable youtube_<verb>_<noun> snake_case pattern with consistent prefixes for sub-areas (youtube_analytics_*, youtube_reporting_*). The analytics and reporting groups use noun_metric naming rather than verb_noun, which is a minor deviation but internally consistent.

    Tool Count2/5

    43 tools is a very large surface for one server, roughly triple the comfortable range. While the domain (upload, analytics, playlists, comments, reporting) is broad, the 14-tool analytics family alone suggests the surface could be consolidated or split into separate servers.

    Completeness4/5

    Core lifecycle is well covered: upload/update/delete video, thumbnail, full playlist CRUD plus add/remove, comment list/post/reply/delete, search, trending, and rich analytics. Gaps remain around comment moderation (no hold/spam/approve), caption upload/download/delete, and video interactions like ratings, but these are workaroundable.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers