Get the FREE Ultimate OpenClaw Setup Guide →

youtube

A comprehensive Model Context Protocol (MCP) server providing real-time YouTube Data API access for AI assistants. Features 14 functions including intelligent content evaluation with technology freshness scoring for knowledge base curation.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio dannysubsense-youtube-mcp-server python /path/to/youtube-mcp-server/youtube_mcp_server.py \
  --env YOUTUBE_API_KEY="your_youtube_api_key_here"

How to use

This YouTube MCP Server exposes a suite of functions that let AI clients query YouTube data in real time via the YouTube Data API v3. It supports retrieving detailed video information, channel and playlist metadata, searching for videos with customizable filters, and analyzing engagement or knowledge-base suitability. The 14 functions cover common needs like getting video details, listing playlist items, fetching channel videos, and obtaining transcripts or captions when available. Clients can leverage these capabilities to power knowledge bases, assistants, or content discovery workflows with structured responses and consistent error handling. The server is designed to manage API quotas and provide robust results even when some data points are missing or restricted by the source API.

How to install

Prerequisites:

  • Python 3.8 or newer
  • A YouTube Data API v3 key
  • Internet access to reach Google APIs
  • MCP-compatible client (e.g., Claude Desktop, Cursor) for testing and integration

Step 1: Clone the repository

git clone https://github.com/dannySubsense/youtube-mcp-server.git
cd youtube-mcp-server

Step 2: Install dependencies

pip install -r requirements.txt

Step 3: Obtain a YouTube Data API key

  • Go to Google Cloud Console, create or select a project
  • Enable YouTube Data API v3
  • Create an API key (restrict if desired for security)

Step 4: Configure credentials Create a credentials file at the project root. For example, credentials.yml with:

youtube_api_key: "YOUR_YOUTUBE_API_KEY_HERE"

Keep this file out of version control.

Step 5: Run or integrate

  • Local testing: you can run the server directly if a start script exists, or use the provided test utilities (see test_server.py in repo)
  • Integration: configure your MCP client with the provided mcp_config example (see Next section).

Additional notes

Environment variable best practice: you can either place your API key in credentials.yml or export YOUTUBE_API_KEY in your shell. Ensure you keep the key secure and restricted to YouTube Data API v3 as needed. When integrating with clients like Claude Desktop or Cursor, you may need to adjust the command path to your environment (e.g., Python path or absolute script location). If you encounter quota issues, consider implementing request batching, exponential backoff, and caching for frequently asked queries. The server supports multiple URL formats (youtube.com, youtu.be, and channel/user references), but some data access may depend on API permissions and channel privacy settings.

Related MCP Servers

Sponsor this space

Reach thousands of developers