YouTube MCP Server
Provides tools for interacting with YouTube, including fetching video transcripts, searching videos, retrieving video metadata, channel information, playlist contents, comments, trending videos, engagement analytics, chapter extraction, SponsorBlock integration for clean transcripts, and most-replayed heatmap data.
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 MCP Serverget transcript for this YouTube 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 Server
MCP server that brings YouTube to Claude Code — video transcripts, search, metadata, channel info, playlists, comments, trending videos, engagement analytics, chapter extraction, SponsorBlock integration, and most-replayed heatmaps. Uses the YouTube Data API v3, youtube-transcript, and SponsorBlock.
Quick Start
Step 1: Get Your API Key
Go to Google Cloud Console
Create a project (or select an existing one)
Enable the YouTube Data API v3:
Go to API Library
Click Enable
Create an API key:
Go to Credentials
Click Create Credentials > API key
Copy the key (you'll need it in Step 3)
Step 2: Install Prerequisites
Node.js 18+ - Download here
Claude Code CLI - Installation guide
Step 3: Install the MCP Server
3.1 Clone the repository
git clone https://github.com/wynandw87/claude-code-youtube-mcp.git
cd claude-code-youtube-mcp3.2 Install dependencies
macOS / Linux / Windows:
npm installNote: Dependencies are installed and the server is built automatically in one step.
3.3 Register with Claude Code
Choose your install scope:
Scope | Flag | Who can use it |
User (recommended) |
| You, in any project |
Project |
| Anyone who clones this repo |
Local |
| Only in current directory |
Replace YOUR_API_KEY with your actual YouTube Data API key, and use the full path to dist/index.js.
Tip: To get the full path, run this from the cloned directory:
macOS/Linux:
echo "$(pwd)/dist/index.js"Windows:
echo %cd%\dist\index.js
macOS / Linux:
claude mcp add -s user youtube -e YOUTUBE_API_KEY=YOUR_API_KEY -- node /full/path/to/dist/index.jsWindows (CMD):
claude mcp add -s user youtube -e "YOUTUBE_API_KEY=YOUR_API_KEY" -- node "C:\full\path\to\dist\index.js"Windows (PowerShell):
claude mcp add -s user youtube -e "YOUTUBE_API_KEY=YOUR_API_KEY" '--' node "C:\full\path\to\dist\index.js"Alternative: Use the npm helper (if API key is set in environment)
export YOUTUBE_API_KEY=YOUR_API_KEY
npm run install:claudeStep 4: Restart Claude Code
Close and reopen Claude Code for the changes to take effect.
Step 5: Verify Installation
claude mcp listYou should see youtube listed with a Connected status.
Features
Transcripts & Captions
Get Transcript (
get_transcript) - Fetch full video transcripts with timestamps, supports multiple languagesSearch Transcript (
search_transcript) - Find where a keyword or phrase appears in a video with timestampsClean Transcript (
get_clean_transcript) - Transcript with sponsors, intros, outros, and filler removed via SponsorBlockExtract Chapters (
extract_chapters) - Parse chapter timestamps from video descriptions
Search & Discovery
Search Videos (
search_videos) - Full YouTube search with filters for date, duration, type, and sort orderSearch Within Channel (
search_within_channel) - Search for videos from a specific creatorGet Trending Videos (
get_trending_videos) - Currently trending videos by region and categoryGet Channel Videos (
get_channel_videos) - Recent uploads from a channel, sorted by date or views
Video & Channel Info
Video Metadata (
get_video_metadata) - Title, description, duration, views, likes, tags, and moreChannel Info (
get_channel_info) - Subscriber count, video count, description, countryPlaylist Items (
get_playlist_items) - All videos in a playlist with positions and metadata
Analytics & Engagement
Calculate Engagement (
calculate_engagement) - Like rate, comment rate, and engagement rate from public statsMost Replayed (
get_most_replayed) - Heatmap data showing which parts viewers rewatch mostVideo Comments (
get_video_comments) - Top comments with like counts and reply counts
Utilities
Parse YouTube URL (
parse_youtube_url) - Extract video/channel/playlist IDs from any YouTube URL format
Usage
Once installed, use trigger phrases to invoke YouTube tools:
Trigger | Tool | Example |
| Get Transcript | "get the youtube transcript for this video" |
| Search Videos | "youtube search for React tutorials" |
| Video Metadata | "get youtube metadata for this video" |
| Channel Info | "get youtube channel info for @ThePrimeagen" |
| Playlist Items | "list the videos in this youtube playlist" |
| Video Comments | "get youtube comments for this video" |
| Trending Videos | "what's trending on youtube in the US?" |
| Extract Chapters | "extract chapters from this youtube video" |
| Calculate Engagement | "calculate youtube engagement for this video" |
| Most Replayed | "show the most replayed parts of this youtube video" |
| Clean Transcript | "get a clean youtube transcript without sponsors" |
| Search Transcript | "search the youtube transcript for 'authentication'" |
Or ask naturally:
"Get the transcript of this YouTube video and summarize it"
"What are the most replayed parts of this video?"
"Find recent videos about TypeScript on this channel"
"How many views and likes does this video have?"
"Get the comments on this video and summarize the sentiment"
"Show me the chapters for this tutorial"
"Get a clean transcript without the sponsor reads"
"What's trending on YouTube in gaming right now?"
Tool Reference
parse_youtube_url
Parse any YouTube URL format and extract identifiers. No API key needed.
Parameters:
url(string, required) - Any YouTube URL or video ID
Supported formats: youtube.com/watch?v=, youtu.be/, /shorts/, /embed/, /playlist?list=, /channel/, /@handle, /c/, /user/, bare video IDs
get_transcript
Fetch the full transcript/captions of a YouTube video. No API key needed.
Parameters:
url(string, required) - YouTube video URL or video IDlang(string, optional) - Language code for captions (default:"en")
search_transcript
Search within a video's transcript for a keyword or phrase.
Parameters:
url(string, required) - YouTube video URL or video IDquery(string, required) - Keyword or phrase to search forlang(string, optional) - Language code for captions (default:"en")
extract_chapters
Extract chapter timestamps from a video's description.
Parameters:
url(string, required) - YouTube video URL or video ID
get_clean_transcript
Fetch transcript with sponsor reads, intros, outros, and filler removed via SponsorBlock.
Parameters:
url(string, required) - YouTube video URL or video IDlang(string, optional) - Language code for captions (default:"en")
get_most_replayed
Get the "most replayed" heatmap data showing which parts viewers rewatch most.
Parameters:
url(string, required) - YouTube video URL or video ID
Note: Requires approximately 50K+ views to have heatmap data available.
search_videos
Search YouTube with full filter support.
Parameters:
query(string, required) - Search querymax_results(number, optional) - Number of results, 1-50 (default:10)order(string, optional) -"relevance","date","viewCount","rating"(default:"relevance")duration(string, optional) -"short"(<4min),"medium"(4-20min),"long"(>20min)upload_date(string, optional) -"hour","day","week","month","year"type(string, optional) -"video","channel","playlist"(default:"video")
get_video_metadata
Get detailed metadata for a YouTube video.
Parameters:
url(string, required) - YouTube video URL or video ID
Returns: Title, description, channel, duration, view/like/comment counts, tags, category, thumbnails, live status, and more.
get_channel_info
Get YouTube channel information.
Parameters:
url(string, required) - YouTube channel URL, @handle, or channel ID
Returns: Title, description, subscriber/video/view counts, country, custom URL, and thumbnail.
get_playlist_items
Get all videos in a YouTube playlist.
Parameters:
url(string, required) - YouTube playlist URL or playlist IDmax_results(number, optional) - Number of items, 1-50 (default:25)
get_channel_videos
Get recent videos from a YouTube channel.
Parameters:
url(string, required) - YouTube channel URL, @handle, or channel IDmax_results(number, optional) - Number of videos, 1-50 (default:25)order(string, optional) -"date","viewCount"(default:"date")
get_trending_videos
Get currently trending/popular YouTube videos.
Parameters:
region_code(string, optional) - ISO 3166-1 alpha-2 country code (default:"US")category_id(string, optional) - YouTube category ID (e.g.,"10"for Music,"20"for Gaming,"28"for Science & Tech)max_results(number, optional) - Number of results, 1-50 (default:10)
search_within_channel
Search for videos within a specific YouTube channel.
Parameters:
url(string, required) - YouTube channel URL, @handle, or channel IDquery(string, required) - Search querymax_results(number, optional) - Number of results, 1-50 (default:10)
get_video_comments
Fetch top-level comments from a YouTube video.
Parameters:
url(string, required) - YouTube video URL or video IDmax_results(number, optional) - Number of comments, 1-100 (default:20)order(string, optional) -"relevance","time"(default:"relevance")
calculate_engagement
Calculate engagement metrics for a YouTube video.
Parameters:
url(string, required) - YouTube video URL or video ID
Returns: View count, like count, comment count, like rate, comment rate, and overall engagement rate.
How It Works
This MCP server connects to Claude Code via stdio transport and provides 15 tools:
Tool | Data Source | Needs API Key? |
| Local parsing | No |
| youtube-transcript library | No |
| youtube-transcript library | No |
| youtube-transcript + SponsorBlock API | No |
| YouTube page (Innertube) | No |
| YouTube Data API v3 | Yes |
| YouTube Data API v3 | Yes |
| YouTube Data API v3 | Yes |
| YouTube Data API v3 | Yes |
| YouTube Data API v3 | Yes |
| YouTube Data API v3 | Yes |
| YouTube Data API v3 | Yes |
| YouTube Data API v3 | Yes |
| YouTube Data API v3 | Yes |
| YouTube Data API v3 | Yes |
Note: 5 tools work without an API key (transcripts, SponsorBlock, heatmaps, URL parsing). The remaining 10 require a YouTube Data API v3 key.
Configuration
Environment Variables
Variable | Required | Default | Description |
| Yes | — | YouTube Data API v3 key |
| No |
| API timeout in ms |
YouTube API Quota
The YouTube Data API v3 has a daily quota of 10,000 units. Each tool uses a different amount:
Operation | Cost per call |
| 100 units |
| 1 unit |
| 1 unit |
| 1 unit |
| 1 unit |
| 1 unit |
Tip: Search operations are the most expensive. Use
get_channel_videos(1 unit) instead ofsearch_within_channel(100 units) when you just need recent uploads.
Troubleshooting
Fix API Key
If you entered the wrong API key, remove and reinstall:
claude mcp remove youtubeThen reinstall using the command from Step 3.3 above (use the same scope you originally installed with).
MCP Server Not Showing Up
Check if the server is installed:
claude mcp listIf not listed, follow Step 3 to install it.
Server Won't Start
Verify your API key is valid at Google Cloud Console
Check the YouTube Data API is enabled:
Go to API Library
It should say "Enabled"
Check Node.js version (needs 18+):
node --versionEnsure the server was built — if
dist/index.jsis missing, runnpm installagain
Connection Errors
Check that
dist/index.jsexists — if not, runnpm installVerify the path is absolute in your
claude mcp addcommandRestart Claude Code after any configuration changes
Quota Exceeded
If you see "quotaExceeded" errors:
Wait until midnight Pacific Time (quota resets daily)
Use a different API key
Prefer low-cost tools (
get_video_metadataat 1 unit) over search tools (100 units)
Transcript Not Available
Some videos have transcripts disabled. The get_transcript tool will return a clear error message. Try:
A different language code (e.g.,
lang: "es")Auto-generated captions may be available even if manual ones aren't
Timeout Errors
Increase YOUTUBE_TIMEOUT environment variable for slow connections:
claude mcp add -s user youtube -e YOUTUBE_API_KEY=YOUR_KEY -e YOUTUBE_TIMEOUT=60000 -- node /path/to/dist/index.jsView Current Configuration
claude mcp listContributing
Pull requests welcome! Please keep it simple and beginner-friendly.
License
MIT
Made for the Claude Code community
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.
Latest Blog Posts
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/wynandw87/claude-code-youtube-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server