youtube-mcp
Provides tools for retrieving public video, channel, and playlist metadata, searching videos, fetching timestamped transcripts, and managing owned playlists via the YouTube Data 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-mcpget video metadata and comments from this link: https://youtu.be/abc123"
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
Local YouTube MCP server for Codex. It turns public video, channel, and playlist URLs into structured context, bounded public-comment retrieval, timestamped caption research, and owned-playlist management.
The repository is public, but the server is intentionally local and single-user: bring your own Google Cloud credentials, authenticate your own YouTube channel, and keep credentials and tokens on your machine. It is not a hosted service or a multi-user connector.
Tools
youtube_get_videoyoutube_get_commentsyoutube_find_commentsyoutube_get_channelyoutube_get_channel_videosyoutube_search_videosyoutube_get_playlist_itemsyoutube_list_transcript_languagesyoutube_get_transcriptyoutube_get_authenticated_channelyoutube_list_owned_playlistsyoutube_get_owned_playlist_itemsyoutube_create_playlistyoutube_update_playlistyoutube_add_playlist_videoyoutube_remove_playlist_itemyoutube_reorder_playlist_item
Public research tools remain read-only. Authenticated V2 tools manage only playlists owned by the locally authenticated channel; the server does not expose account-library reads, media downloads, ASR generation, or background processing.
Related MCP server: Youtube-MCP
Requirements
Node.js 22+
pnpmA Google Cloud project with YouTube Data API v3 enabled
A restricted YouTube Data API key for public read tools
yt-dlponPATHfor transcript tools (orYT_DLP_PATH)
Authenticated playlist tools additionally require a Google OAuth desktop client. ChatGPT access through an OpenAI Secure MCP Tunnel is optional; it is not needed for local Codex use.
Authenticated playlist setup
In Google Cloud, enable YouTube Data API v3, create an OAuth Desktop app client, and configure the loopback redirect URI from YOUTUBE_REDIRECT_URI (by default http://127.0.0.1:8787/callback) as required by that client configuration. Configure its client ID and optional client secret in .env, then run the local PKCE flow once:
pnpm auth:login
pnpm auth:statusTokens are saved outside the repository at ~/.config/youtube-mcp/tokens.json with private filesystem permissions. pnpm auth:logout revokes the local session when possible and removes that file.
youtube_list_owned_playlists and youtube_get_owned_playlist_items use explicit pagination. youtube_create_playlist defaults to private. Update and add operations apply directly; removal and reorder require confirm: true. Only playlists owned by the authenticated channel can be read through the owned workflow or changed.
Set YOUTUBE_SMOKE_OWNED_PLAYLIST_URL only for a private test playlist you own to add an authenticated, read-only ownership smoke check. It does not create, update, add, remove, or reorder items.
Setup
Copy
.env.exampleto.env.Set
YOUTUBE_API_KEYto a restricted YouTube Data API key.Install and build:
pnpm install
pnpm buildRun the stable local stdio server:
pnpm startFor contributor development only, run pnpm dev.
Codex setup
Build the server, then add a local MCP entry to your Codex configuration:
[mcp_servers.youtube]
command = "node"
args = ["--env-file=/absolute/path/to/youtube-mcp/.env", "/absolute/path/to/youtube-mcp/dist/server.js"]Replace /absolute/path/to/youtube-mcp with your clone path. Rebuild after source changes before using the stable server.
Tool behavior
youtube_get_video accepts normal watch, Shorts, live, embed, and youtu.be URLs. It returns public metadata only.
youtube_get_comments accepts limit (default 50, maximum 100), order (relevance or time), an explicit pageToken, includeReplies, and optional matchTerms.
A call fetches one page only and returns
next_page_tokenwhen YouTube supplies one.includeRepliesreturns only the inline reply subset provided by YouTube.replies_truncatedis true when more replies exist.matchTermsapplies a case-insensitive literal OR filter after retrieving the page. When it is used,search_scopeis alwaysretrieved_page_only; it does not search every comment on the video.
youtube_find_comments searches a caller-specified maxPages (1–5) of comment threads for matchTerms. It returns searched_pages, complete, and next_page_token; its search_scope is always retrieved_pages_only.
youtube_get_channel accepts public /channel/CHANNEL_ID and /@handle URLs. youtube_get_channel_videos returns one explicit page of the channel's public uploads playlist.
youtube_search_videos returns one explicit page of public video search results, enriched with normalized video metadata. Search is quota-expensive, so requests are limited to 25 results.
youtube_get_playlist_items accepts public /playlist?list=... and /watch?...&list=... URLs and returns one explicit item page. Items retain their playlist item IDs and positions for safe future authenticated workflows.
youtube_list_transcript_languages lists caption tracks exposed for a video. youtube_get_transcript returns one explicit page of timestamped creator or automatic caption segments. It prefers English when no language is requested, then falls back to the video language. Transcript retrieval uses local yt-dlp metadata and YouTube-exposed caption URLs; it never downloads media, writes a cache, or generates ASR text. Availability can change and is not guaranteed for every public video.
Optional ChatGPT connection
Keep this server and .env on the Mac. Create an OpenAI Secure MCP Tunnel, run tunnel-client where it can reach the built stdio server, and register the tunnel endpoint in ChatGPT Developer Mode. The tunnel lets ChatGPT reach a private MCP server without a public listener. Follow the current Secure MCP Tunnel documentation for tunnel creation and tunnel-client configuration.
Do not commit the Google API key, OAuth client credentials, OpenAI runtime key, generated tunnel configuration, or local token file.
Privacy and API terms
This server runs locally. It does not include telemetry, a hosted backend, or a shared credential service. OAuth tokens are stored only in the local token file described above, and YouTube API requests use the credentials configured by the local user.
Users are responsible for their own Google Cloud projects and compliance with the YouTube API Services Terms of Service and YouTube Developer Policies. Caption tools use yt-dlp only to retrieve YouTube-exposed caption tracks; caption availability and extraction behavior can change without notice.
Verification
pnpm format:check
pnpm lint
pnpm typecheck
pnpm test
pnpm build
pnpm transcript:doctor
pnpm auth:status
pnpm smokepnpm smoke makes live read-only requests. It uses YOUTUBE_SMOKE_URL when set; otherwise it uses a default public video. Set YOUTUBE_SMOKE_COMMENTS_URL when you need to require a comments-enabled smoke target, and YOUTUBE_SMOKE_TRANSCRIPT_URL to verify a caption-enabled transcript target.
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
- AlicenseAqualityAmaintenanceHigh-efficiency YouTube MCP server: Get token-optimized, structured data for your LLMs using the YouTube Data API v3.935128MIT
- AlicenseAqualityDmaintenanceProduction-grade Model Context Protocol 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.161MIT
- AlicenseBqualityCmaintenanceLocal read-only MCP server for YouTube Data API v3 and YouTube Analytics API, enabling public video searches and OAuth-based private channel reads.9MIT
- AlicenseAqualityCmaintenanceA Model Context Protocol server enabling AI language models to search, retrieve, and manage YouTube content including videos, channels, transcripts, and playlists.10308MIT
Related MCP Connectors
YouTube MCP — wraps the YouTube Data API v3 (BYO API key)
MCP server for Clipkit — gives AI agents a video toolbox via the Clipkit schema.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
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/EthanDM/youtube-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server