YouTube Data API

YouTube Data API

kirbah

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.

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.

14478 views11Local (stdio)

What it does

  • 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

Best for

Content creators researching competitorsMarketing teams analyzing YouTube trendsAI agents needing YouTube data integrationDevelopers building YouTube analytics tools
Saves up to 87% on LLM tokensBuilt-in caching protects API quotasProduction-grade reliability

About YouTube Data API

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

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.

YouTube Data MCP Server (@kirbah/mcp-youtube)

CI Status Code Coverage NPM Version NPM Downloads Node.js Version Support

README image Link to glama.ai

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 MethodRaw YouTube TokensMCP-YouTube TokensToken SavingsData Size
getChannelStatistics67386~87% Less1.9 KB βž” 0.2 KB
getVideoDetails854209~75% Less2.9 KB βž” 0.6 KB
searchVideos1115402~64% Less3.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 lint passes 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:

  1. Get a YouTube Data API v3 Key (See Setup Instructions below).
  2. (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 NameDescriptionParameters (see details in tool schema)
getVideoDetailsRetrieves detailed, lean information for multiple YouTube videos including metadata, statistics, engagement ratios, and content details.videoIds (array of strings)
searchVideosSearches 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.
getTranscriptsRetrieves 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')
getChannelStatisticsRetrieves lean statistics for multiple channels (subscriber count, view count, video count, creation date).channelIds (array of strings)
getChannelTopVideosRetrieves a list of a channel's top-performing videos with lean details and engagement ratios.channelId (string), maxResults (optional number)
getTrendingVideosRetrieves 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)
getVideoCategoriesRetrieves available YouTube video categories (ID and title) for a specific region, providing essential data only.regionCode (optional string)
getVideoCommentsRetrieves 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)
findConsistentOutlierChannelsIdentifies 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


README truncated. View full README on GitHub.

Alternatives

Related Skills

Browse all skills
youtube-analytics

YouTube Data API v3 analytics toolkit. Analyze YouTube channels, videos, and search results. Use when the user asks to: check YouTube channel stats, analyze video performance, compare channels, search for videos, get subscriber counts, view engagement metrics, find trending videos, get channel uploads, or analyze YouTube competition. Requires a YouTube Data API v3 key from Google Cloud Console.

2
content-trend-researcher

Advanced content and topic research skill that analyzes trends across Google Analytics, Google Trends, Substack, Medium, Reddit, LinkedIn, X, blogs, podcasts, and YouTube to generate data-driven article outlines based on user intent analysis

23
ai-multimodal

Process and generate multimedia content using Google Gemini API. Capabilities include analyze audio files (transcription with timestamps, summarization, speech understanding, music/sound analysis up to 9.5 hours), understand images (captioning, object detection, OCR, visual Q&A, segmentation), process videos (scene detection, Q&A, temporal analysis, YouTube URLs, up to 6 hours), extract from documents (PDF tables, forms, charts, diagrams, multi-page), generate images (text-to-image, editing, composition, refinement). Use when working with audio/video files, analyzing images or screenshots, processing PDF documents, extracting structured data from media, creating images from text prompts, or implementing multimodal AI features. Supports multiple models (Gemini 2.5/2.0) with context windows up to 2M tokens.

7
backend-dev-guidelines

Comprehensive backend development guide for Langfuse's Next.js 14/tRPC/Express/TypeScript monorepo. Use when creating tRPC routers, public API endpoints, BullMQ queue processors, services, or working with tRPC procedures, Next.js API routes, Prisma database access, ClickHouse analytics queries, Redis queues, OpenTelemetry instrumentation, Zod v4 validation, env.mjs configuration, tenant isolation patterns, or async patterns. Covers layered architecture (tRPC procedures β†’ services, queue processors β†’ services), dual database system (PostgreSQL + ClickHouse), projectId filtering for multi-tenant isolation, traceException error handling, observability patterns, and testing strategies (Jest for web, vitest for worker).

7
crypto-market-data

No API KEY needed for free tier. Professional-grade cryptocurrency market data integration for real-time prices, historical charts, and global analytics.

6
automation-brainstorm

Interactive workflow design advisor for Power Automate, n8n, Make, Zapier and other platforms. Guides users through planning automation workflows with smart questions about triggers, actions, data flow, and error handling. Uses research sub-agent to find best practices and generates detailed implementation plan. Triggers when user mentions "create workflow", "build flow", "design automation", "need ideas for", or describes workflow requirements without having a complete design.

6