The YouTube Data MCP acts as a smart bridge between AI models and the vast library of content on YouTube. In simple terms, it gives an AI assistant the ability to search for videos, read through transcripts, and look up information about its favorite creators. By providing these capabilities, the server transforms a standard language model into a specialized video research assistant that can analyze real-time trends and summarize video content without needing a human to copy and paste links. For developers and AI power users, this tool is specifically engineered with "token efficiency" at its core. Since Large Language Models charge based on the amount of data they process, this server returns highly structured, "lean" data packets that strip away unnecessary fluff. This design ensures that the AI receives only the most relevant metadata, engagement ratios, and caption segments, which significantly reduces operational costs and improves the speed of the model's responses. It handles complex tasks like multi-language transcript fetching and sentiment-friendly comment retrieval with ease. On a more technical level, the server offers a robust suite of professional tools, including the ability to identify consistent outlier channels within specific niches and discover trending content by region or category. It is built using Zod for rigorous input validation and provides clear error handling to maintain reliability in production environments. Additionally, it features optional MongoDB integration, allowing developers to cache API responses to significantly boost performance and stay within YouTube’s API quota limits. This makes it a comprehensive, high-performance solution for any application requiring deep YouTube data integration.
Category: Databases & Data Stores
Tags: metadata, mongodb, transcripts, video, youtube
youtube_niche_analysis.claude_desktop_config.json):json { "mcpServers": { "youtube": { "command": "npx", "args": ["-y", "@kirbah/mcp-youtube"], "env": { "YOUTUBE_API_KEY": "YOUR_YOUTUBE_API_KEY_HERE", "MDB_MCP_CONNECTION_STRING": "mongodb+srv://user:pass@cluster0.abc.mongodb.net/youtube_niche_analysis" } } } }npx on Windows, use the following command structure: json { "mcpServers": { "youtube": { "command": "cmd", "args": ["/k", "npx", "-y", "@kirbah/mcp-youtube"], "env": { "YOUTUBE_API_KEY": "YOUR_YOUTUBE_API_KEY_HERE", "MDB_MCP_CONNECTION_STRING": "mongodb+srv://user:pass@cluster0.abc.mongodb.net/youtube_niche_analysis" } } } }getVideoDetails | Retrieves lean metadata, stats, and engagement for videos. | videoIds (array of strings) | | searchVideos | Searches for videos or channels with filters. | query, maxResults, order, type, channelId | | getTranscripts | Fetches token-efficient captions (full text or key segments). | videoIds, lang, format ('full_text' or 'key_segments') | | getChannelStatistics | Lean stats (subscribers, views, video count). | channelIds (array of strings) | | getChannelTopVideos | Lists a channel's best-performing videos. | channelId, maxResults | | getTrendingVideos | Lists trending videos by region and category. | regionCode, categoryId, maxResults | | getVideoCategories | Retrieves valid YouTube category IDs for a region. | regionCode | | getVideoComments | Fetches comments for sentiment analysis or feedback. | videoId, maxResults, order, maxReplies | | findConsistentOutlierChannels | Identifies high-performing niche channels (Requires MongoDB). | niche, minVideos, maxChannels |getTranscripts (fetching the full_text format) and getVideoDetails, then instantly generates a structured summary with time-coded key takeaways and a draft LinkedIn post.findConsistentOutlierChannels, and getChannelTopVideos. These tools allow an LLM to scan a specific niche and find channels that consistently perform better than their subscriber count would suggest. Example: A user asks, "Find me 5 outlier channels in the 'mechanical keyboard' niche that have under 10k subscribers but videos with over 50k views." The LLM uses the outlier tool to scan the niche and then analyzes the getChannelTopVideos data to explain why those specific videos were successful.getVideoComments tool, an LLM can fetch a large volume of comments and their replies in a lean, structured format. The AI can then perform sentiment analysis and categorize the feedback into actionable buckets. Example: A company pulls comments from their latest product launch video. The LLM processes the data and reports: "70% positive sentiment; 15% of users are asking about USB-C compatibility; 5% reported a bug in the setup process shown at 04:30."getChannelStatistics and getTrendingVideos tools provide instant access to subscriber counts, total views, and engagement ratios.…Part of MCP Servers
You can install and run it directly via npx by referencing @kirbah/mcp-youtube in your MCP client configuration file, such as Claude Desktop or Cursor. Node.js version 20.0.0 or higher is required. You can provide an optional YouTube Data API v3 key and a MongoDB connection string via environment variables.
Yes, YouTube Data MCP supports a zero-config mode that does not require an API key if you only need to retrieve video transcripts. Captions can be accessed with zero YouTube API quota cost. However, search, channel statistics, and comment retrieval tools require a valid YouTube Data API key.
The server includes getVideoDetails, searchVideos, getTranscripts, getChannelStatistics, getChannelTopVideos, getTrendingVideos, getVideoCategories, getVideoComments, and findConsistentOutlierChannels. Each tool returns lean data payloads designed to reduce context token usage compared to raw YouTube API responses.
MongoDB is an optional caching layer that stores API responses to protect against strict daily YouTube API quota limits. When enabled, repeated queries for video details or trending lists are served directly from cache at zero quota cost, and it enables the outlier channel discovery tool.
Yes, YouTube Data MCP is an open-source project hosted on GitHub under the repository kirbah/mcp-youtube, where you can inspect source code, view unit tests, or contribute.