youtube-mcp
This server provides OAuth-authenticated YouTube channel management across videos, playlists, comments, captions, analytics, and AI-generated thumbnails.
Videos
List uploaded videos (newest first, paginated)
Get full details for a specific video (snippet, status, statistics, duration)
Update metadata: title, description, tags, category, privacy status
Delete a video (with title-match confirmation guard against accidental deletion)
Captions
List caption tracks (language, name, status)
Upload SRT or WebVTT caption tracks
Delete caption tracks by ID
Shorts
List recent Shorts (videos ≤60s)
Query Shorts-specific analytics
Playlists
Create playlists (title, description, privacy)
Add videos to existing playlists
Comments
List top-level comments (author, text, like counts)
Reply to comments
Moderate comments: hold for review, approve, or reject/delete
Analytics
Query channel analytics with date ranges, custom metrics, dimensions, filters, and sorting (views, watch time, retention, traffic sources, etc.)
AI Thumbnail Generation (requires ComfyUI)
Generate a 1280×720 thumbnail from a text prompt via ComfyUI bridge and automatically upload it to a video in a single call
Requires Google Cloud project setup with YouTube Data API v3 and YouTube Analytics API enabled, using OAuth consent screen configuration for authentication and authorization scopes.
Integrates with YouTube Data API v3 and YouTube Analytics API via OAuth 2.0, allowing authenticated channel owners to edit video metadata, manage comments and playlists, query analytics, and generate/set thumbnails.
youtube-mcp
OAuth-authenticated YouTube MCP for channel owners. Edit video metadata, reply to and moderate comments, manage playlists, query channel analytics, and generate or set AI thumbnails via a ComfyUI bridge. Goes beyond the read-only Data API v3 wrappers that dominate this space.
The pitch
Most existing YouTube MCPs use an API key against Data API v3. Search videos, fetch public metadata, read-only. This one uses OAuth 2.0 (Authorization Code + PKCE) so it can actually write to your channel: update video titles, descriptions and tags, reply to comments, moderate spam, manage playlists. It also hits the separate YouTube Analytics API for channel stats, and generates a thumbnail via ComfyUI and pushes it to YouTube in a single MCP call.
Claude, use generate_and_set_thumbnail on video abc123:
prompt: "cyberpunk hacker at keyboard, neon blue and pink, high contrast"ComfyUI renders 1280×720, youtube-mcp fetches the bytes, and POSTs to thumbnails.set. Done.
Related MCP server: yt-fetch
Install
# npx, no install
npx @miller-joe/youtube-mcp --help
# Docker
docker run -p 9120:9120 \
-e YOUTUBE_CLIENT_ID=... \
-e YOUTUBE_CLIENT_SECRET=... \
-e YOUTUBE_TOKEN_FILE=/token/token.json \
-v $PWD/token:/token \
ghcr.io/miller-joe/youtube-mcp:latestSetup: Google Cloud one-time (~10 min)
Google account plus YouTube channel. Use a personal account, not a workspace one you might lose.
Google Cloud project at https://console.cloud.google.com. Call it whatever you want (e.g.
youtube-mcp).Enable APIs:
YouTube Data API v3
YouTube Analytics API
OAuth consent screen: External, App name, support email. In Scopes, add:
youtube.uploadyoutube.force-sslyt-analytics.readonly
Stay in Testing mode. Add yourself as a test user (required). As the project owner, your refresh token won't expire.
Create OAuth Client ID: Application type = Desktop app. Download the JSON.
Run the interactive auth flow:
npx @miller-joe/youtube-mcp --auth --client-secret-file ./client_secret.jsonA browser opens, you log in to the Google account tied to your YouTube channel, and grant the requested scopes. On success, a refresh token is saved to
~/.config/youtube-mcp/token.json.Start the server:
npx @miller-joe/youtube-mcp --client-secret-file ./client_secret.jsonOr provide the client credentials via env:
YOUTUBE_CLIENT_SECRET_FILE, orYOUTUBE_CLIENT_ID+YOUTUBE_CLIENT_SECRET.
Connect an MCP client
claude mcp add --transport http youtube http://localhost:9120/mcpOr point your MCP gateway at the Streamable HTTP endpoint.
Configuration
CLI flag | Env var | Default | Notes |
|
| (none) | Path to Google OAuth JSON |
|
| (none) | Alternative to the secret file |
|
| (none) | Alternative to the secret file |
|
|
| Refresh token storage |
|
|
| Bind host (HTTP mode only) |
|
|
| Bind port (HTTP mode only) |
|
| (unset) | Speak MCP over stdio instead of HTTP. Use when launched as a subprocess by a stdio-first MCP client (Claude Desktop, mcp-inspector). |
|
| (unset, bridge disabled) | ComfyUI HTTP URL for bridge tools |
(no flag) |
|
| Default checkpoint for bridge tool |
Transports
The server speaks streamable HTTP by default (great for Claude Code, MetaMCP, raw fetch). Pass --stdio (or set MCP_TRANSPORT=stdio) to switch into stdio mode, which is what stdio-first clients like Claude Desktop and the MCP Inspector expect:
// claude_desktop_config.json
{
"mcpServers": {
"youtube": {
"command": "npx",
"args": ["-y", "@miller-joe/youtube-mcp", "--stdio"],
"env": {
"YOUTUBE_CLIENT_SECRET_FILE": "/path/to/client_secret.json",
"YOUTUBE_TOKEN_FILE": "/path/to/token.json"
}
}
}
}Stdio mode skips the OAuth-token preflight check — the server boots even without a stored token and surfaces auth errors at tool-call time. Run youtube-mcp --auth --client-secret-file <path> once in HTTP mode to seed the refresh token before pointing Claude Desktop at it.
Tools
Videos
list_my_videos: paginated list of the authenticated channel's uploads.get_video: full detail for one video.update_video_metadata: title, description, tags, category, privacy.delete_video: permanently delete a video. Requiresconfirm_video_titleto match the current title exactly, as a guard against deleting the wrong video.
Captions
list_captions: list caption tracks on a video (language, name, status, draft flag).upload_caption: upload an SRT or WebVTT caption track to a video.delete_caption: delete a caption track.
Shorts
list_my_shorts: find Shorts in recent uploads (filters by duration ≤60s).get_shorts_analytics: YouTube Analytics query restricted to Shorts (creatorContentType==SHORTS).
Playlists
create_playlist: create a playlist (default private).add_to_playlist: add a video to an existing playlist.
Comments
list_comments: top-level comment threads on a video.reply_to_comment: reply to a top-level comment.moderate_comment: hold, approve, or reject a comment.
Analytics
query_channel_analytics: date-ranged metrics with optional dimensions and filters.
Bridge (when COMFYUI_URL is configured)
generate_and_set_thumbnail: generate a thumbnail via ComfyUI and set it on a video in one call.
Quota notes
YouTube Data API free tier = 10,000 units/day. Key operation costs:
videos.list,commentThreads.list: 1 unit each.videos.update,comments.insert,thumbnails.set: 50 units each.videos.insert(upload): 1,600 units, so about 6 uploads per day on the free tier.
Most creator-ops workflows stay well under the free cap.
Architecture
┌────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ MCP client │────▶│ youtube-mcp │────▶│ YouTube APIs │
│ (Claude etc.) │◀────│ (this server) │◀────│ (Data/Analytics)│
└────────────────┘ └────────┬─────────┘ └─────────────────┘
│
│ (bridge tools only)
▼
┌──────────────────┐
│ ComfyUI │
│ (txt2img) │
└──────────────────┘OAuth refresh tokens are cached locally and refreshed just-in-time before expiry. The bridge tool downloads image bytes from ComfyUI internally, so ComfyUI does not need to be publicly reachable.
Development
git clone https://github.com/miller-joe/youtube-mcp
cd youtube-mcp
npm install
npm run dev
npm run build
npm testRequires Node 20+.
Roadmap
Shipped:
Videos: list, get, update metadata, delete with title-match confirm guard.
Captions: upload, list, delete.
Shorts:
list_my_shorts(duration filter) andget_shorts_analytics(creatorContentType==SHORTS).Playlists: create, add-to.
Comments: list, reply, moderate.
Analytics: channel analytics query.
ComfyUI thumbnail bridge:
generate_and_set_thumbnail.
Planned:
Video upload (
video_upload) with resumable-upload support.Reporting API for bulk historical data exports.
License
MIT © Joe Miller
Support
If this saves you time, consider supporting development:
Available Tools
15 toolsadd_to_playlistB
Add a video to an existing playlist. Both playlist_id and video_id are YouTube IDs (not URLs).
Inputs: playlist_id (required), video_id (required).
create_playlistB
Create a new playlist on the authenticated channel. Default privacy is 'private'.
Inputs: title (required), description, privacy_status.
delete_captionA
Delete a caption track by ID. Use list_captions to find the track ID first.
Inputs: caption_id (required).
delete_videoA
Permanently delete a video. Requires confirm_video_title to match the video's current title exactly — guards against deleting the wrong video by ID. Deletion is irreversible.
Inputs: video_id (required), confirm_video_title (required).
get_shorts_analyticsA
Query YouTube Analytics restricted to Shorts for the authenticated channel. Applies filters=creatorContentType==SHORTS on top of the usual start_date/end_date/metrics/dimensions knobs.
Inputs: start_date (required), end_date (required), metrics, dimensions, +2 more.
get_videoA
Fetch full details for one video by ID — snippet, status, statistics, duration.
Inputs: video_id (required).
list_captionsA
List caption tracks on a video with their language, name, status, and whether they are drafts.
Inputs: video_id (required).
list_commentsB
List top-level comment threads on a video (newest first). Returns comment IDs, authors, text, and like counts.
Inputs: video_id (required), max_results.
list_my_shortsA
List your recent Shorts — scans the most recent uploads and filters to videos ≤60s. Useful when the Data API doesn't expose a direct Shorts filter.
Inputs: max_candidates.
list_my_videosA
List videos on the authenticated channel (newest first via the uploads playlist). Returns video IDs, titles, view counts, and privacy status.
Inputs: max_results, page_token.
moderate_commentA
Change the moderation status of a comment: heldForReview (hide pending approval), published (approve), or rejected (delete).
Inputs: comment_id (required), moderation_status (required).
query_channel_analyticsA
Query YouTube Analytics for the authenticated channel. Returns tabular data — useful for views/watch-time/retention/traffic-source reports. Date-ranged and optionally grouped by dimensions.
Inputs: start_date (required), end_date (required), metrics, dimensions, +3 more.
reply_to_commentB
Reply to a top-level comment. Requires youtube.force-ssl scope.
Inputs: parent_id (required), text (required).
update_video_metadataA
Update a video's metadata — title, description, tags, category, or privacy. Only provide fields you want changed.
Inputs: video_id (required), title, description, tags, +2 more.
upload_captionA
Upload a caption track (SRT or WebVTT) to a video. Creates a new track — use a distinct name per language/track, or is_draft=true while iterating.
Inputs: video_id (required), language (required), caption_text (required), name, +2 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 15 tools
Each tool targets a distinct resource and action. Analytics tools are clearly differentiated (general vs Shorts-specific), and video list vs Shorts list is scoped by content type. Comments, captions, and playlists each have their own dedicated tools with no overlap.
All tool names follow a consistent verb_noun snake_case pattern (list_, get_, create_, update_, delete_, upload_, reply_to_, add_to_, moderate_, query_). There are no mixed conventions or cryptic abbreviations, making the naming predictable and easy to reason about.
15 tools cover a broad YouTube management surface without feeling bloated. The set is well-scoped for the server's purpose—video, playlist, caption, comment, and analytics operations—and each tool has a clear role within that scope.
The coverage has significant gaps, especially for playlists: there is no way to list, retrieve, delete, or remove items from playlists, creating dead ends after creation. Caption updates are also absent (only create and delete), although video CRUD and comment moderation are well covered.
Maintenance
Related MCP Connectors
Create and refine AI YouTube thumbnails with the ThumblifyAI MCP server.
An MCP server that gives any LLM or agent clean YouTube transcripts on demand: a single video, a whole channel, or a playlist, plus AI cleanup of auto-generated captions. API-key auth, credit-based, same backend as the public v1 API. Get a free API key with 25 free credits at youtubetranscriptdownload.com/account.
MCP server for Google Veo AI video generation
Hosted MCP for YouTube Studio: uploads, metadata, playlists, comments, analytics, captions.
Related MCP Servers
- FlicenseAqualityDmaintenanceA Model Context Protocol server that enables Claude to interact with YouTube data and functionality through the Claude Desktop application.112-
- FlicenseNot gradedqualityDmaintenanceAn MCP server that enables interaction with the YouTube Data API, allowing users to search videos, get video and channel details, analyze trends, and fetch video transcripts.-
- AlicenseAqualityDmaintenanceMCP server for ComfyUI — text-to-image, variations, img2img refine, upscale, image proxy, and workflow runner.15120 npm2MIT
- AlicenseAqualityBmaintenanceA comprehensive MCP server integrating YouTube Data, Analytics, and Reporting APIs, providing 40 tools for channel management, analytics, video publishing, transcripts, SEO, and comments.4031MIT