npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

youtube-hybrid-mcp

v1.1.0

Published

Hybrid YouTube MCP server using API and yt-dlp

Readme

YouTube Hybrid MCP Server

A Model Context Protocol (MCP) server that provides YouTube video tools using both the YouTube Data API and yt-dlp.

Features

  • Get video metadata (title, description, views, likes, etc.)
  • Retrieve video comments
  • Extract video subtitles/transcripts

Prerequisites

Installation

Via npx (after publishing)

npx youtube-hybrid-mcp

Local development

git clone <repository-url>
cd youtube-hybrid-mcp
npm install
npm run build

Getting YouTube API Key

To use this MCP server, you need a YouTube Data API v3 key. Follow these steps:

1. Create Google Cloud Project

  1. Go to Google Cloud Console
  2. Create a new project or select an existing one

2. Enable YouTube Data API v3

  1. In the Cloud Console, go to "APIs & Services" > "Library"
  2. Search for "YouTube Data API v3"
  3. Click on it and enable the API

3. Create API Credentials

  1. Go to "APIs & Services" > "Credentials"
  2. Click "Create Credentials" > "API key"
  3. Copy the generated API key

4. Restrict the API Key (Recommended)

  1. Click on the created API key
  2. Under "Application restrictions":
    • Select "HTTP referrers"
    • Add your domain or leave unrestricted for development
  3. Under "API restrictions":
    • Select "Restrict key"
    • Choose "YouTube Data API v3"
  4. Save the changes

5. Set Environment Variable

export YOUTUBE_API_KEY=your_api_key_here

Note: Keep your API key secure and never commit it to version control.

Installing yt-dlp

yt-dlp is required only for the get_subtitles tool. If you don't need subtitles functionality, you can skip this step.

Windows

pip install yt-dlp

macOS

pip install yt-dlp
# or using Homebrew
brew install yt-dlp

Linux

pip install yt-dlp
# or using package manager
# Ubuntu/Debian
sudo apt install yt-dlp
# Fedora
sudo dnf install yt-dlp
# Arch Linux
sudo pacman -S yt-dlp

Verify Installation

After installation, verify yt-dlp is in your PATH:

yt-dlp --version

If yt-dlp is not found, you may need to add Python Scripts to your PATH:

  • Windows: Add %USERPROFILE%\AppData\Roaming\Python\Python3X\Scripts to PATH
  • macOS/Linux: Add ~/.local/bin to PATH

Configuration

Environment Setup

Set your YouTube API key as an environment variable:

export YOUTUBE_API_KEY=your_api_key_here

Editor/IDE Configuration

VSCode (with KiloCode extension)

Add to your MCP settings (usually in settings.json or MCP configuration):

{
  "mcpServers": {
    "youtube": {
      "command": "npx",
      "args": ["-y", "youtube-hybrid-mcp"],
      "env": {
        "YOUTUBE_API_KEY": "your_api_key_here"
      }
    }
  }
}

Cursor

Add to your .cursorrules or MCP configuration:

{
  "mcpServers": {
    "youtube": {
      "command": "npx",
      "args": ["-y", "youtube-hybrid-mcp"],
      "env": {
        "YOUTUBE_API_KEY": "your_api_key_here"
      }
    }
  }
}

Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "youtube": {
      "command": "npx",
      "args": ["-y", "youtube-hybrid-mcp"],
      "env": {
        "YOUTUBE_API_KEY": "your_api_key_here"
      }
    }
  }
}

Other MCP-compatible editors

For any MCP-compatible editor, use this configuration:

{
  "mcpServers": {
    "youtube": {
      "command": "npx",
      "args": ["-y", "youtube-hybrid-mcp"],
      "env": {
        "YOUTUBE_API_KEY": "your_api_key_here"
      }
    }
  }
}

Usage

Run the server directly:

npm start

Or via npx:

npx youtube-hybrid-mcp

Tools

get_video_meta

Retrieves metadata for a YouTube video.

Parameters:

  • videoId (string): YouTube video ID

get_comments

Retrieves comments for a YouTube video.

Parameters:

  • videoId (string): YouTube video ID
  • maxResults (number, optional): Maximum number of comments (default: 10)

get_subtitles

Extracts subtitles/transcript from a YouTube video.

Parameters:

  • videoId (string): YouTube video ID
  • language (string, optional): Language code (default: "en")

get_related_videos

Gets videos related to a specific video (shows other videos from the same channel).

Parameters:

  • videoId (string): YouTube video ID
  • maxResults (number, optional): Maximum number of related videos (default: 10)

get_channel_info

Gets information about a YouTube channel.

Parameters:

  • channelId (string): YouTube channel ID

search_videos

Searches for videos on YouTube.

Parameters:

  • query (string): Search query
  • maxResults (number, optional): Maximum number of results (default: 10)

get_video_thumbnails

Gets thumbnail information for a video.

Parameters:

  • videoId (string): YouTube video ID

MCP Integration

This server implements the Model Context Protocol and can be used with MCP-compatible clients.

License

MIT