YouTube MCP
Provides tools for uploading videos, updating video metadata, setting thumbnails, retrieving video statistics, channel information, latest videos, and analytics through the YouTube Data API and YouTube Analytics API.
Click on "Install 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 MCPUpload the video at /tmp/clip.mp4 as unlisted with title 'My First Video'"
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 MCP
This project provides a Python MCP server for a practical YouTube upload and management workflow that uses the real YouTube Data API v3 and YouTube Analytics API with Google OAuth 2.0.
Architecture
The code is intentionally split into separate layers:
youtube_mcp/server.pyexposes MCP tools to Claude or any MCP client.youtube_mcp/services/youtube_service.pycontains the actual YouTube API logic and validation.youtube_mcp/config.pyreads environment variables and keeps secret values out of source control.
This separation keeps the tool layer focused on MCP contracts while the service layer handles YouTube API requests, validation, and error handling.
Related MCP server: youtube-organic-mcp
Required OAuth and API approach
This project is designed for authenticated workflow operations, not API-key-only use.
For upload, channel management, thumbnail update, and other private/channel-based actions, use Google OAuth 2.0 with the following scopes:
https://www.googleapis.com/auth/youtube.uploadhttps://www.googleapis.com/auth/youtube.readonlyhttps://www.googleapis.com/auth/youtubepartnerhttps://www.googleapis.com/auth/yt-analytics.readonly
The server expects these values in environment variables or a local .env file:
export GOOGLE_CLIENT_ID="your-google-client-id"
export GOOGLE_CLIENT_SECRET="your-google-client-secret"
export YOUTUBE_REFRESH_TOKEN="your-google-refresh-token"
export YOUTUBE_ACCESS_TOKEN="optional-current-access-token"
export YOUTUBE_CHANNEL_ID="optional-channel-id"Never put client secrets, refresh tokens, or access tokens in source code or Git.
Tool set
hello_youtube
Simple validation tool that returns:
YouTube MCP is workingupload_video
Uploads a video file to YouTube.
Inputs:
title(required)description(required)file_path(required local/publicly accessible path)tags(optional list of YouTube tag strings)hashtags(optional list of hashtags; these are added to the description text)privacy_status(optional:public,private, orunlisted)scheduled_publish_at(optional ISO 8601 future datetime; requiresprivacy_status="private"for YouTube scheduling)category_id(optional)made_for_kids(optional boolean)
Behavior:
Does not fake a success result.
Returns the uploaded video ID only when the YouTube API confirms it.
Validates
scheduled_publish_atand rejects non-future or invalid timestamps.Treats hashtags separately from YouTube tags; hashtags are represented in the title/description text, while tags go into the video
tagsfield.
update_video
Updates video metadata.
Inputs:
video_id(required)title(optional)description(optional)tags(optional)hashtags(optional)privacy_status(optional)scheduled_publish_at(optional)category_id(optional)made_for_kids(optional)
Rules:
Requires a valid update payload.
For scheduled publishing, YouTube requires private + publishAt workflow.
Returns the API result only when the update request succeeds.
set_thumbnail
Sets a thumbnail image for an existing YouTube video.
Inputs:
video_id(required)thumbnail_path(required local file path)
get_video_stats
Gets public YouTube video metadata and statistics for a given video ID.
get_channel_info
Fetches channel metadata for a channel ID, username, or mine=True when authenticated.
get_latest_videos
Lists recent videos for a channel.
get_video_analytics
Uses the YouTube Analytics API with authorized metrics for available reporting dimensions and filters.
Validation and error handling
The service layer validates:
privacy_statusscheduled_publish_atmissing required parameters
file existence for uploads and thumbnails
OAuth environment configuration before channel or upload actions run
If the YouTube API responds with an error, the code raises a clear RuntimeError or ValueError with the API response details instead of masking the failure.
Local development / stdio mode
Run the local MCP server over stdio:
cd /workspaces/youtube-mcp
python -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
python -m youtube_mcp.serverThis uses the local stdio transport for testing and debugging.
Remote HTTP MCP mode for Claude Custom Connector
The repository also supports a remote HTTP transport using the installed official MCP Python SDK.
Set the host/port and transport mode before starting the server:
cd /workspaces/youtube-mcp
source .venv/bin/activate
export YOUTUBE_MCP_TRANSPORT="http"
export YOUTUBE_MCP_HOST="127.0.0.1"
export YOUTUBE_MCP_PORT="8000"
export YOUTUBE_MCP_HTTP_PATH="/mcp"
python -m youtube_mcp.serverThis exposes the MCP protocol at:
http://127.0.0.1:8000/mcpThe health endpoint is available at:
http://127.0.0.1:8000/healthYou can verify the health endpoint with:
curl http://127.0.0.1:8000/healthExpected response:
{"status":"ok","service":"youtube-mcp","transport":"http"}Notes
.envis included in.gitignore.OAuth tokens and credentials are intentionally kept in environment variables.
No fake API responses are used.
No deployment or public publishing is configured in this repository.
The Google OAuth redirect URI is not changed here.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityFmaintenanceEnables interacting with YouTube Data API v3 through MCP tools (get-video, get-channel, get-latest-video) and bundled UI apps for video and channel profiles.84MIT
- 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.621MIT
- Flicense-qualityCmaintenanceMCP server for managing YouTube channels using Data API v3 and Analytics. Supports video upload, comments, playlists, and analytics via ~30 tools, with stateless OAuth authentication.
- Flicense-qualityCmaintenanceEnables searching YouTube and managing playlists on your own account via OAuth 2.0 authentication.
Related MCP Connectors
YouTube MCP — wraps the YouTube Data API v3 (BYO API key)
YouTube transcripts, subtitles, and video metadata as structured JSON via an Apify Actor.
Provide token-optimized, structured YouTube data to enhance your LLM applications. Access efficien…
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/contactshahameer-stack/youtube-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server