YouTube Data API▌
by kirbah
Unlock deep YouTube analytics: search videos, track channel stats, explore trends, and analyze high-performing YouTubers
Integrates with YouTube Data API v3 to provide video search, channel statistics, trending content analysis, transcript extraction, and niche analysis for discovering high-performance channels within specific topics and timeframes.
Both formats append explainx.ai attribution and the canonical URL for this MCP server listing.
best for
- / Content creators researching competitors
- / Marketing teams analyzing YouTube trends
- / AI agents needing YouTube data integration
- / Developers building YouTube analytics tools
capabilities
- / Search YouTube videos and channels
- / Extract video transcripts
- / Analyze trending content
- / Get channel statistics and performance metrics
- / Discover high-performance channels in specific niches
- / Cache API responses to protect quotas
what it does
Connects to YouTube Data API v3 to search videos, get channel stats, analyze trending content, and extract transcripts. Optimized for AI agents with reduced token usage and built-in caching.
about
YouTube Data API is a community-built MCP server published by kirbah that provides AI assistants with tools and capabilities via the Model Context Protocol. Unlock deep YouTube analytics: search videos, track channel stats, explore trends, and analyze high-performing YouTubers It is categorized under other, analytics data.
how to install
You can install YouTube Data API in your AI client of choice. Use the install panel on this page to get one-click setup for Cursor, Claude Desktop, VS Code, and other MCP-compatible clients. This server runs locally on your machine via the stdio transport.
license
MIT
YouTube Data API is released under the MIT license. This is a permissive open-source license, meaning you can freely use, modify, and distribute the software.
readme
YouTube Data MCP Server (@kirbah/mcp-youtube)
<!-- Badges Start --> <p align="left"> <!-- GitHub Actions CI --> <a href="https://github.com/kirbah/mcp-youtube/actions/workflows/ci.yml"> <img src="https://github.com/kirbah/mcp-youtube/actions/workflows/ci.yml/badge.svg" alt="CI Status" /> </a> <!-- Codecov --> <a href="https://codecov.io/gh/kirbah/mcp-youtube"> <img src="https://codecov.io/gh/kirbah/mcp-youtube/branch/main/graph/badge.svg?token=Y6B2E0T82P" alt="Code Coverage"/> </a> <!-- NPM Version --> <a href="https://www.npmjs.com/package/@kirbah/mcp-youtube"> <img src="https://img.shields.io/npm/v/@kirbah/mcp-youtube.svg" alt="NPM Version" /> </a> <!-- NPM Downloads --> <a href="https://www.npmjs.com/package/@kirbah/mcp-youtube"> <img src="https://img.shields.io/npm/dt/@kirbah/mcp-youtube.svg" alt="NPM Downloads" /> </a> <!-- Node Version --> <a href="package.json"> <img src="https://img.shields.io/node/v/@kirbah/mcp-youtube.svg" alt="Node.js Version Support" /> </a> </p> <a href="https://glama.ai/mcp/servers/@kirbah/mcp-youtube"> <img width="380" height="200" src="https://glama.ai/mcp/servers/@kirbah/mcp-youtube/badge" /> </a> <!-- Badges End -->A production-grade YouTube Data MCP server engineered specifically for AI agents.
Unlike standard API wrappers that flood your LLM with redundant data, this server strips away YouTube's heavy payload bloat. It is designed to save you massive amounts of context window tokens, protect your daily API quotas via caching, and run reliably without breaking your workflows.
Why Choose This Server?
Most MCP servers are weekend projects. @kirbah/mcp-youtube is built for reliable, daily, cost-effective agentic workflows.
📉 1. Save Up to 87% on Tokens (and Context Window)
The raw YouTube API returns massive JSON payloads filled with nested eTags, redundant thumbnails, and localization data that LLMs don't need. This server structures the data to give your LLM exactly what it needs to reason, and nothing else.
%%{init: { "theme": "base", "themeVariables": { "xyChart": { "plotColorPalette": "#ef4444, #22c55e" } } } }%%
xychart-beta
title "Token Consumption (Lower is Better)"
x-axis ["getVideoDetails", "searchVideos", "getChannelStats"]
y-axis "Context Tokens" 0 --> 1200
bar "Raw YouTube API" [854, 1115, 673]
bar "MCP-YouTube (Optimized)" [209, 402, 86]
| API Method | Raw YouTube Tokens | MCP-YouTube Tokens | Token Savings | Data Size |
|---|---|---|---|---|
getChannelStatistics | 673 | 86 | ~87% Less | 1.9 KB ➔ 0.2 KB |
getVideoDetails | 854 | 209 | ~75% Less | 2.9 KB ➔ 0.6 KB |
searchVideos | 1115 | 402 | ~64% Less | 3.4 KB ➔ 1.2 KB |
(Curious? You can compare the raw API responses vs optimized outputs in the examples folder).
🛡️ 2. Protect Your API Quotas (Smart Caching)
The YouTube Data API has strict daily limits (10,000 quota units). If your LLM gets stuck in a loop or re-asks a question, standard servers will drain your API limit in minutes. This server includes an optional MongoDB caching layer. If your agent requests a video details or searches the same trending videos twice, the server serves it from the cache - costing you 0 API quota points.
🏗️ 3. Production-Grade & Actively Maintained
Tired of MCP tools crashing your AI client? This server is built to be a rock-solid dependency:
- 97% Test Coverage: Comprehensively unit-tested (check the Codecov badge).
- Zero Lint Errors/Warnings: Enforces strict, clean code (
npm run lintpasses 100%). - Active Security: Automated Dependabot patching ensures underlying libraries are never left with known vulnerabilities.
- Strict Type Safety: Built using Zod validation and the robust MCP TypeScript Starter architecture.
Quick Start: Installation
The easiest way to install this server is by clicking the "Add to Claude Desktop" (or other supported clients) button on Glama server page.
Manual Configuration
If you prefer to configure your MCP client manually (e.g., Claude Desktop or Cursor), add the following to your configuration file:
- Get a YouTube Data API v3 Key (See Setup Instructions below).
- (Highly Recommended) Get a free MongoDB Connection String to enable quota-saving caching.
{
"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:[email protected]/youtube_niche_analysis"
}
}
}
}
(Windows PowerShell Users: If npx fails, try using "command": "cmd" and "args": ["/k", "npx", "-y", "@kirbah/mcp-youtube"])
Key Features
- Optimized Video Information: Search videos with advanced filters. Retrieve detailed metadata, statistics (views, likes, etc.), and content details, all structured for minimal token footprint.
- Efficient Transcript Management: Fetch video captions/subtitles with multi-language support, perfect for content analysis by LLMs.
- Insightful Channel Analysis: Get concise channel statistics (subscribers, views, video count) and discover a channel's top-performing videos without data bloat.
- Lean Trend Discovery: Find trending videos by region and category, and get lists of available video categories, optimized for quick AI processing.
- Structured for AI: All responses are designed to be easily parsable and immediately useful for language models.
- Efficient Comment Retrieval: Fetch video comments with fine-grained control over the number of results and replies, optimized for sentiment analysis and feedback extraction.
Available Tools
The server provides the following MCP tools, each designed to return token-optimized data:
| Tool Name | Description | Parameters (see details in tool schema) |
|---|---|---|
getVideoDetails | Retrieves detailed, lean information for multiple YouTube videos including metadata, statistics, engagement ratios, and content details. | videoIds (array of strings) |
searchVideos | Searches for videos or channels based on a query string with various filtering options, returning concise results. | query (string), maxResults (optional number), order (optional), type (optional), channelId (optional), etc. |
getTranscripts | Retrieves token-efficient transcripts (captions) for multiple videos, with options for full text or key segments (intro/outro). | videoIds (array of strings), lang (optional string for language code), format (optional enum: 'full_text', 'key_segments' - default 'key_segments') |
getChannelStatistics | Retrieves lean statistics for multiple channels (subscriber count, view count, video count, creation date). | channelIds (array of strings) |
getChannelTopVideos | Retrieves a list of a channel's top-performing videos with lean details and engagement ratios. | channelId (string), maxResults (optional number) |
getTrendingVideos | Retrieves a list of trending videos for a given region and optional category, with lean details and engagement ratios. | regionCode (optional string), categoryId (optional string), maxResults (optional number) |
getVideoCategories | Retrieves available YouTube video categories (ID and title) for a specific region, providing essential data only. | regionCode (optional string) |
getVideoComments | Retrieves comments for a YouTube video. Allows sorting, limiting results, and fetching a small number of replies per comment. | videoId (string), maxResults (optional number), order (optional), maxReplies (optional number), commentDetail (optional string) |
findConsistentOutlierChannels | Identifies channels that consistently perform as outliers within a specific niche. Requires a MongoDB connection. | niche (string), minVideos (optional number), maxChannels (optional number) |
_For detailed input parameters and their descriptions, please refer to the inputSchema within each tool's configuration
FAQ
- What is the YouTube Data API MCP server?
- YouTube Data API is a Model Context Protocol (MCP) server profile on explainx.ai. MCP lets AI hosts (e.g. Claude Desktop, Cursor) call tools and resources through a standard interface; this page summarizes categories, install hints, and community ratings.
- How do MCP servers relate to agent skills?
- Skills are reusable instruction packages (often SKILL.md); MCP servers expose live capabilities. Teams frequently combine both—skills for workflows, MCP for APIs and data. See explainx.ai/skills and explainx.ai/mcp-servers for parallel directories.
- How are reviews shown for YouTube Data API?
- This profile displays 34 aggregated ratings (sample rows for discoverability plus signed-in user reviews). Average score is about 4.8 out of 5—verify behavior in your own environment before production use.
Use Cases▌
Extended AI Capabilities
Add new capabilities to Claude beyond text generation
Example
Access external data sources, execute code, interact with tools and services
Transform Claude from chatbot to action-taking agent
Context Enhancement
Provide Claude with access to relevant context and data
Example
Load project documentation, access knowledge bases, query databases
Get more accurate, context-aware responses
Workflow Automation
Automate multi-step workflows combining AI and external tools
Example
Research → Summarize → Create document → Send notification
Complete complex tasks end-to-end without manual steps
Implementation Guide▌
Prerequisites
- ›Claude Desktop 0.7.0+ or Cursor IDE with MCP support
- ›Basic understanding of MCP architecture and capabilities
- ›Access credentials for integrated services (if required)
- ›Willingness to experiment and iterate on configuration
Time Estimate
15-60 minutes depending on server complexity
Installation Steps
- 1.Install MCP server: npm install -g [package-name] or via GitHub
- 2.Add server configuration to ~/.claude/mcp.json
- 3.Provide required credentials and configuration
- 4.Restart Claude Desktop to load new server
- 5.Test basic functionality with simple prompts
- 6.Explore capabilities and experiment with use cases
- 7.Document successful patterns for reuse
Troubleshooting
- ⚠MCP server not loading: Check config syntax, verify installation
- ⚠Connection errors: Check network, firewall, credentials
- ⚠Feature not working: Read server docs, check required parameters
- ⚠Performance issues: Monitor resource usage, check for network latency
- ⚠Conflicts with other servers: Check port assignments, namespace collisions
Best Practices▌
✓ Do
- +Read server documentation thoroughly before setup
- +Start with simple use cases to validate functionality
- +Test in non-production environment first
- +Monitor resource usage and performance
- +Keep servers updated for bug fixes and new features
- +Document configuration for team members
- +Use environment variables for sensitive configuration
✗ Don't
- −Don't grant overly permissive access to MCP servers
- −Don't skip reading security considerations in docs
- −Don't expose sensitive data without proper controls
- −Don't run untrusted MCP servers without code review
- −Don't ignore error messages—investigate root cause
💡 Pro Tips
- ★Combine multiple MCP servers for powerful workflows
- ★Create custom MCP servers for your specific needs
- ★Share successful configurations with team
- ★Use MCP inspector for debugging
- ★Join MCP community for tips and troubleshooting
Technical Details▌
Architecture
Model Context Protocol standardizes how AI hosts (Claude, Cursor) communicate with external tools and data sources through server implementations.
Protocols
- Model Context Protocol (MCP)
- JSON-RPC 2.0
- stdio or HTTP transport
Compatibility
- Claude Desktop
- Cursor IDE
- Custom MCP clients
When to Use This▌
✓ Use When
Use when you need Claude to access external data, execute actions, or integrate with tools. Best for extending AI capabilities beyond conversation.
✗ Avoid When
Avoid when native integrations exist (use official APIs directly), for real-time critical systems, or when security/compliance requires zero external dependencies.
Integration▌
- →Tool composition: Chain multiple MCP tools in workflows
- →Context augmentation: Provide AI with relevant external data
- →Action delegation: Let AI execute tasks on external systems
- →Bidirectional sync: Keep AI context and external systems in sync
Discussion
Product Hunt–style comments (not star reviews)- No comments yet — start the thread.
List & Promote Your MCP Server
Share your MCP server with the developer community
Ratings
4.8★★★★★34 reviews- ★★★★★Shikha Mishra· Dec 20, 2024
Useful MCP listing: YouTube Data API is the kind of server we cite when onboarding engineers to host + tool permissions.
- ★★★★★Yusuf Abebe· Dec 20, 2024
YouTube Data API is a well-scoped MCP server in the explainx.ai directory — install snippets and categories matched our Claude Code setup.
- ★★★★★Isabella Verma· Dec 16, 2024
I recommend YouTube Data API for teams standardizing on MCP; the explainx.ai page compares cleanly with sibling servers.
- ★★★★★Yash Thakker· Nov 11, 2024
According to our notes, YouTube Data API benefits from clear Model Context Protocol framing — fewer ambiguous “AI plugin” claims.
- ★★★★★Yusuf Farah· Nov 11, 2024
We wired YouTube Data API into a staging workspace; the listing’s GitHub and npm pointers saved time versus hunting across READMEs.
- ★★★★★Alexander Brown· Nov 7, 2024
Strong directory entry: YouTube Data API surfaces stars and publisher context so we could sanity-check maintenance before adopting.
- ★★★★★Kwame Desai· Oct 26, 2024
Useful MCP listing: YouTube Data API is the kind of server we cite when onboarding engineers to host + tool permissions.
- ★★★★★Dhruvi Jain· Oct 2, 2024
I recommend YouTube Data API for teams standardizing on MCP; the explainx.ai page compares cleanly with sibling servers.
- ★★★★★Naina Abbas· Oct 2, 2024
We evaluated YouTube Data API against two servers with overlapping tools; this profile had the clearer scope statement.
- ★★★★★Yusuf Patel· Sep 13, 2024
We wired YouTube Data API into a staging workspace; the listing’s GitHub and npm pointers saved time versus hunting across READMEs.
showing 1-10 of 34