← Back to directory
Y

YouTube Data MCP Server

Community
High-efficiency YouTube MCP server for AI agents
GitHub source repository ↗
★ 29 Stars Category · Other Popular Source revision 720e6c76ee9a
62FMRS · C

Users praise the server for its token optimization, significantly reducing context window usage. The caching mechanism effectively protects API quotas. Code quality is high with 97% test coverage, and it is actively maintained. Suitable for production, but note it's unofficial and potential quota costs for search operations.

Reliability
10/20
Security and permissions
12/20
Maintenance
12/20
Documentation
14/20
Setup experience
14/20
Read the FMRS scoring method →

The YouTube Data MCP Server (@kirbah/mcp-youtube) is a production-grade MCP server designed for AI agents, fetching structured data via the YouTube Data API v3. It optimizes token usage, saving up to 87% on context window, includes smart caching to protect API quotas, and boasts high test coverage. It provides tools like fetching video details, searching videos, retrieving transcripts, channel statistics, trending videos, and more. Supports zero-config mode (no API key needed for transcripts) and optional MongoDB caching for quota savings.

Tools

getVideoDetails
Retrieves detailed, lean information for multiple YouTube videos including metadata, statistics, and engagement ratios.
searchVideos
Searches for videos or channels based on a query string, returning concise results.
getTranscripts
Fetches token-efficient transcripts (captions) for multiple videos, with options for full text or key segments.
getChannelStatistics
Retrieves lean statistics for multiple channels (subscriber count, view count, video count, creation date).
getChannelTopVideos
Retrieves a list of a channel's top-performing videos with lean details and engagement ratios.
getTrendingVideos
Retrieves a list of trending videos for a region and optional category, with lean details and engagement ratios.
getVideoCategories
Retrieves available YouTube video categories (ID and title) for a specific region.
getVideoComments
Retrieves comments for a YouTube video, with sorting, limiting, and optional replies.
findConsistentOutlierChannels
Identifies channels that consistently outperform within a niche. Requires a MongoDB connection.

Setup

  1. Zero-config mode: Configure the MCP client with command npx -y @kirbah/mcp-youtube, no API key required for transcripts.
  2. Full features: Go to Google Cloud Console, enable YouTube Data API v3, and create an API key. Optionally, create a free MongoDB connection string for caching.
  3. Set environment variables YOUTUBE_API_KEY and MDB_MCP_CONNECTION_STRING in your client config.

Example config:

{
  "mcpServers": {
    "youtube": {
      "command": "npx",
      "args": ["-y", "@kirbah/mcp-youtube"],
      "env": {
        "YOUTUBE_API_KEY": "YOUR_KEY",
        "MDB_MCP_CONNECTION_STRING": "mongodb+srv://..."
      }
    }
  }
}
claude_desktop_config.json
{
  "mcpServers": {
    "youtube": {
      "command": "npx",
      "args": ["-y", "@kirbah/mcp-youtube"]
    }
  }
}

Fit and risk

Best for

  • LLM agents that need to minimize token consumption.
  • Users who frequently access YouTube data and want to protect API quotas.
  • Developers seeking a high-quality, well-tested MCP server.

Not for

  • Users needing raw, unoptimized YouTube API responses with all nested fields.
  • Users requiring real-time or very fresh data (caching may introduce staleness).
  • Users without MongoDB who want to use the `findConsistentOutlierChannels` tool.

Required permissions

  • Network access to the YouTube Data API v3.
  • Optional: Access to API key from environment variables.
  • Optional: Access to MongoDB connection string for caching.

Risks and side effects

  • API key exposure: Stored in env vars, risk of accidental commit if misconfigured.
  • API quota exhaustion: Search tools still cost significant units (e.g., search 100 units) despite optimizations.
  • Data caching may return stale info; avoid enabling MongoDB if not needed.
  • Dependency on a third-party server (non-official), subject to changes as YouTube API evolves.

Troubleshooting

  1. Common issues:
  2. - If tools fail, check that `YOUTUBE_API_KEY` is correctly set and not expired.
  3. - Ensure network access to Google APIs.
  4. - If MongoDB caching enabled, verify the connection string is valid.
  5. - On quota errors, review usage in Google Cloud Console.

Use cases

Content creators analyze their own channel performance to optimize strategy.
Marketers research trending videos and popular channels.
Developers build AI applications that require video metadata or transcripts.
Researchers analyze comment sentiment and engagement metrics.

Supported clients

Claude DesktopFull support
CursorPartial support