home / mcp / youtube mcp server

YouTube MCP Server

Provides YouTube data access and transcripts via the YouTube Data API v3 for MCP clients.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "anirudhyadavms-youtube_mcp": {
      "command": "node",
      "args": [
        "/absolute/path/to/youtube-mcp-server/dist/server.js"
      ],
      "env": {
        "YOUTUBE_API_KEY": "YOUR_API_KEY_HERE"
      }
    }
  }
}

You can run an MCP server that lets you browse YouTube content and generate summaries using YouTube Data API v3. This server exposes powerful tools for searching videos, pulling details and transcripts, and exploring channels and playlists, all accessible through any MCP-compatible client.

How to use

Connect with your MCP client and enable the YouTube tools. You can perform tasks such as searching for videos, retrieving detailed video data, fetching transcripts for summarization, and exploring channels and playlists. Use natural language prompts to guide the AI assistant, and the MCP client will delegate to the corresponding tool to return structured results.

How to install

Prerequisites you need before installation:

- Node.js v18 or higher

- npm (comes with Node.js) or another package manager you prefer

Install from npm (coming soon)

npm install -g youtube-mcp-server

Install from source

# Clone the repository
git clone https://github.com/anirudhyadavMS/youtube_mcp.git
cd youtube-mcp-server

# Install dependencies
npm install

# Build the project
npm run build

Configuration

Configure your MCP client to connect to the YouTube MCP server using a stdio transport. The server is started by running Node with the built server file and an API key for the YouTube Data API v3.

{
  "mcpServers": {
    "youtube": {
      "type": "stdio",
      "command": "node",
      "args": ["/absolute/path/to/youtube-mcp-server/dist/server.js"],
      "env": {
        "YOUTUBE_API_KEY": "YOUR_API_KEY_HERE"
      }
    }
  }
}

Usage details

After you start the MCP client with this configuration, the following tools become available:

- Search YouTube for videos by keyword and sort results by relevance, date, view count, or rating.

- Retrieve comprehensive video details including title, description, duration, views, likes, and tags.

- Fetch transcripts or captions for videos to enable summarization and analysis.

- Get information about channels, including subscriber counts and recent videos.

- List all videos from a specific channel with sorting options.

- Obtain playlist information and list videos with their positions.

API Quota Management

The YouTube Data API has a daily quota. Plan usage to stay within limits, and leverage transcripts (web scraping) for data without consuming API quota where possible.

Development

Build the project and run the server to verify everything is wired correctly.

# Build the project
npm run build

# Start the server (example using the compiled file)
npm start

Notes

To use the API key securely, restrict the key to YouTube Data API v3 and avoid exposing it in client-side code.

Available tools

search_youtube

Search YouTube for videos by keyword with optional max results and order parameters.

get_video_details

Retrieve comprehensive metadata for a specific video, including title, description, duration, views, and tags.

get_video_transcript

Fetch the transcript or captions for a given video, with optional language and timestamps.

get_channel_info

Obtain channel details such as name, description, subscriber count, and optional recent videos.

get_channel_videos

List videos from a specific channel with sorting and pagination options.

get_playlist_info

Get metadata for a YouTube playlist, including title, description, and video count.

get_playlist_videos

List all videos in a playlist with their positions and metadata.