A community-driven registry for the Claude Code ecosystem. Not affiliated with Anthropic.
Are you the author? Sign in to claim
YouTube MCP server — transcripts, search, metadata, analytics and trending videos
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.
git clone https://github.com/wynandw87/claude-code-youtube-mcp.git
cd claude-code-youtube-mcp
macOS / Linux / Windows:
npm install
Note: Dependencies are installed and the server is built automatically in one step.
Choose your install scope:
| Scope | Flag | Who can use it |
|---|---|---|
| User (recommended) | -s user | You, in any project |
| Project | -s project | Anyone who clones this repo |
| Local | -s 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.js
Windows (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"
export YOUTUBE_API_KEY=YOUR_API_KEY
npm run install:claude
Close and reopen Claude Code for the changes to take effect.
claude mcp list
You should see youtube listed with a Connected status.
get_transcript) - Fetch full video transcripts with timestamps, supports multiple languagessearch_transcript) - Find where a keyword or phrase appears in a video with timestampsget_clean_transcript) - Transcript with sponsors, intros, outros, and filler removed via SponsorBlockextract_chapters) - Parse chapter timestamps from video descriptionssearch_videos) - Full YouTube search with filters for date, duration, type, and sort ordersearch_within_channel) - Search for videos from a specific creatorget_trending_videos) - Currently trending videos by region and categoryget_channel_videos) - Recent uploads from a channel, sorted by date or viewsget_video_metadata) - Title, description, duration, views, likes, tags, and moreget_channel_info) - Subscriber count, video count, description, countryget_playlist_items) - All videos in a playlist with positions and metadatacalculate_engagement) - Like rate, comment rate, and engagement rate from public statsget_most_replayed) - Heatmap data showing which parts viewers rewatch mostget_video_comments) - Top comments with like counts and reply countsparse_youtube_url) - Extract video/channel/playlist IDs from any YouTube URL formatOnce installed, use trigger phrases to invoke YouTube tools:
| Trigger | Tool | Example |
|---|---|---|
youtube transcript | Get Transcript | "get the youtube transcript for this video" |
youtube search | Search Videos | "youtube search for React tutorials" |
youtube metadata | Video Metadata | "get youtube metadata for this video" |
youtube channel | Channel Info | "get youtube channel info for @ThePrimeagen" |
youtube playlist | Playlist Items | "list the videos in this youtube playlist" |
youtube comments | Video Comments | "get youtube comments for this video" |
youtube trending | Trending Videos | "what's trending on youtube in the US?" |
youtube chapters | Extract Chapters | "extract chapters from this youtube video" |
youtube engagement | Calculate Engagement | "calculate youtube engagement for this video" |
youtube most replayed | Most Replayed | "show the most replayed parts of this youtube video" |
youtube clean transcript | Clean Transcript | "get a clean youtube transcript without sponsors" |
youtube search transcript | Search Transcript | "search the youtube transcript for 'authentication'" |
Or ask naturally:
Parse any YouTube URL format and extract identifiers. No API key needed.
Parameters:
url (string, required) - Any YouTube URL or video IDSupported formats: youtube.com/watch?v=, youtu.be/, /shorts/, /embed/, /playlist?list=, /channel/, /@handle, /c/, /user/, bare video IDs
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 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 chapter timestamps from a video's description.
Parameters:
url (string, required) - YouTube video URL or video IDFetch 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 the "most replayed" heatmap data showing which parts viewers rewatch most.
Parameters:
url (string, required) - YouTube video URL or video IDNote: Requires approximately 50K+ views to have heatmap data available.
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 detailed metadata for a YouTube video.
Parameters:
url (string, required) - YouTube video URL or video IDReturns: Title, description, channel, duration, view/like/comment counts, tags, category, thumbnails, live status, and more.
Get YouTube channel information.
Parameters:
url (string, required) - YouTube channel URL, @handle, or channel IDReturns: Title, description, subscriber/video/view counts, country, custom URL, and thumbnail.
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 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 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 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)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 metrics for a YouTube video.
Parameters:
url (string, required) - YouTube video URL or video IDReturns: View count, like count, comment count, like rate, comment rate, and overall engagement rate.
This MCP server connects to Claude Code via stdio transport and provides 15 tools:
| Tool | Data Source | Needs API Key? |
|---|---|---|
parse_youtube_url | Local parsing | No |
get_transcript | youtube-transcript library | No |
search_transcript | youtube-transcript library | No |
get_clean_transcript | youtube-transcript + SponsorBlock API | No |
get_most_replayed | YouTube page (Innertube) | No |
extract_chapters | YouTube Data API v3 | Yes |
search_videos | YouTube Data API v3 | Yes |
get_video_metadata | YouTube Data API v3 | Yes |
get_channel_info | YouTube Data API v3 | Yes |
get_playlist_items | YouTube Data API v3 | Yes |
get_channel_videos | YouTube Data API v3 | Yes |
get_trending_videos | YouTube Data API v3 | Yes |
search_within_channel | YouTube Data API v3 | Yes |
get_video_comments | YouTube Data API v3 | Yes |
calculate_engagement | 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.
| Variable | Required | Default | Description |
|---|---|---|---|
YOUTUBE_API_KEY | Yes | — | YouTube Data API v3 key |
YOUTUBE_TIMEOUT | No | 30000 | API timeout in ms |
The YouTube Data API v3 has a daily quota of 10,000 units. Each tool uses a different amount:
| Operation | Cost per call |
|---|---|
search (search_videos, search_within_channel) | 100 units |
videos.list (get_video_metadata, get_trending, calculate_engagement) | 1 unit |
channels.list (get_channel_info, get_channel_videos) | 1 unit |
playlists.list (get_playlist_items) | 1 unit |
playlistItems.list (get_playlist_items, get_channel_videos) | 1 unit |
commentThreads.list (get_video_comments) | 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.
If you entered the wrong API key, remove and reinstall:
claude mcp remove youtube
Then reinstall using the command from Step 3.3 above (use the same scope you originally installed with).
Check if the server is installed:
claude mcp list
If not listed, follow Step 3 to install it.
Verify your API key is valid at Google Cloud Console
Check the YouTube Data API is enabled:
Check Node.js version (needs 18+):
node --version
Ensure the server was built — if dist/index.js is missing, run npm install again
dist/index.js exists — if not, run npm installclaude mcp add commandIf you see "quotaExceeded" errors:
get_video_metadata at 1 unit) over search tools (100 units)Some videos have transcripts disabled. The get_transcript tool will return a clear error message. Try:
lang: "es")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.js
claude mcp list
Pull requests welcome! Please keep it simple and beginner-friendly.
MIT
Made for the Claude Code community
Manage Cloudflare Workers, KV, R2, and D1 from Claude
Manage Supabase projects, databases, and edge functions from Claude
Browser automation and testing via Playwright integration
Browser workflow automation using LLMs and computer vision with a no-code builder