YouTube Data MCP server

Integrates with YouTube Data API to retrieve and analyze video content, transcripts, channel statistics, and engagement metrics across different regions and categories without leaving the conversation interface.
Back to servers
Provider
Hero
Release date
Mar 19, 2025
Language
TypeScript
Package
Stats
3.6K downloads
30 stars

This MCP server implementation allows AI language models to interact with YouTube content through a standardized interface. It provides tools for retrieving video information, transcripts, channel analytics, and trend analysis through the YouTube Data API.

Installation Options

Automatic Installation via Smithery

The easiest way to install the YouTube MCP Server for Claude Desktop is through Smithery:

npx -y @smithery/cli install @icraft2170/youtube-data-mcp-server --client claude

Manual Installation

You can also install the server manually using npm:

# Install from npm
npm install youtube-data-mcp-server

# Or clone repository
git clone https://github.com/icraft2170/youtube-data-mcp-server.git
cd youtube-data-mcp-server
npm install

Configuration

Environment Setup

Set these environment variables to configure the server:

  • YOUTUBE_API_KEY: Your YouTube Data API key (required)
  • YOUTUBE_TRANSCRIPT_LANG: Default caption language (optional, default: 'ko')

MCP Client Configuration

Add the following to your Claude Desktop configuration file:

{
  "mcpServers": {
    "youtube": {
      "command": "npx",
      "args": ["-y", "youtube-data-mcp-server"],
      "env": {
        "YOUTUBE_API_KEY": "YOUR_API_KEY_HERE",
        "YOUTUBE_TRANSCRIPT_LANG": "ko"
      }
    }
  }
}

YouTube API Setup

To get your YouTube API key:

  1. Access Google Cloud Console
  2. Create a new project or select an existing one
  3. Enable YouTube Data API v3
  4. Create API credentials (API key)
  5. Use the generated API key in your environment configuration

Available Tools

The server provides these MCP tools for interacting with YouTube:

Video Information Tools

  • getVideoDetails: Retrieves detailed information about YouTube videos

    • Required: videoIds (array)
  • searchVideos: Searches for videos based on a query string

    • Required: query
    • Optional: maxResults
  • getRelatedVideos: Gets videos related to a specific video

    • Required: videoId
    • Optional: maxResults
  • getVideoEngagementRatio: Calculates engagement metrics for videos

    • Required: videoIds (array)

Transcript Tools

  • getTranscripts: Retrieves transcripts for multiple videos
    • Required: videoIds (array)
    • Optional: lang

Channel Analysis Tools

  • getChannelStatistics: Retrieves detailed metrics for channels

    • Required: channelIds (array)
  • getChannelTopVideos: Gets the most viewed videos from a channel

    • Required: channelId
    • Optional: maxResults

Trend Analysis Tools

  • getTrendingVideos: Gets currently popular videos by region and category

    • Optional: regionCode, categoryId, maxResults
  • compareVideos: Compares statistics across multiple videos

    • Required: videoIds (array)

System Requirements

  • Node.js 18.0.0 or higher

Security Best Practices

  • Keep your API key secure and never commit it to version control
  • Manage your API key through environment variables
  • Set usage limits for your API key to prevent unauthorized use

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later