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 🙏

© 2026 – Pkg Stats / Ryan Hefner

youtube-api-mcp-server

v1.0.0

Published

YouTube API MCP Server - Access YouTube content via Model Context Protocol

Downloads

7

Readme

YouTube API MCP Server

smithery badge CI Status

A Model Context Protocol (MCP) server implementation for the YouTube API, enabling AI language models to interact with YouTube content through a standardized interface. Supports both stdio and HTTP transports using FastMCP.

Features

Video Information

  • Get video details (title, description, duration, etc.)
  • List channel videos
  • Get video statistics (views, likes, comments)
  • Search videos across YouTube

Transcript Management

  • Retrieve video transcripts
  • Support for multiple languages
  • Get timestamped captions
  • Search within transcripts

Channel Management

  • Get channel details
  • List channel playlists
  • Get channel statistics
  • Search within channel content

Playlist Management

  • List playlist items
  • Get playlist details
  • Search within playlists
  • Get playlist video transcripts

Installation

Using NPX (Recommended)

The easiest way to use the YouTube API MCP Server is with npx:

npx youtube-api-mcp-server

Add this to your Claude Desktop configuration:

{
  "mcpServers": {
    "youtube": {
      "command": "npx",
      "args": ["youtube-api-mcp-server"],
      "env": {
        "YOUTUBE_API_KEY": "your_youtube_api_key_here"
      }
    }
  }
}

Global Installation

Install globally for direct command access:

# Using npm
npm install -g youtube-api-mcp-server

# Using pnpm
pnpm add -g youtube-api-mcp-server

Then add to your Claude Desktop configuration:

{
  "mcpServers": {
    "youtube-api-mcp-server": {
      "command": "youtube-api-mcp-server",
      "env": {
        "YOUTUBE_API_KEY": "your_youtube_api_key_here"
      }
    }
  }
}

Installing via Smithery

To install YouTube API MCP Server for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install @jordanburke/youtube-api --client claude

Configuration

Environment Variables

  • YOUTUBE_API_KEY: Your YouTube Data API key (required)
  • YOUTUBE_TRANSCRIPT_LANG: Default language for transcripts (optional, defaults to 'en')

Transport Configuration

The server supports both stdio (default) and HTTP transports:

  • MCP_TRANSPORT: Transport type - stdio (default) or http
  • MCP_HTTP_PORT: HTTP server port (default: 3000) - only used when transport is http
  • MCP_HTTP_HOST: HTTP server host (default: localhost) - only used when transport is http

Using with Docker

The YouTube API MCP Server is available as a Docker image from GitHub Container Registry. By default, the Docker image runs with HTTP transport on port 3000:

# Pull the latest image
docker pull ghcr.io/jordanburke/youtube-api-mcp-server:latest

# Run with HTTP transport (default - exposed on port 3000)
docker run --rm \
  -e YOUTUBE_API_KEY="your_youtube_api_key_here" \
  -p 3000:3000 \
  ghcr.io/jordanburke/youtube-api-mcp-server:latest

# Run with stdio transport (for Claude Desktop)
docker run --rm \
  -e YOUTUBE_API_KEY="your_youtube_api_key_here" \
  -e MCP_TRANSPORT="stdio" \
  -i \
  ghcr.io/jordanburke/youtube-api-mcp-server:latest

Using Docker Compose

  1. Create a .env file from the example:
cp .env.example .env
# Edit .env and add your YouTube API key
  1. Run with Docker Compose:
# Start the server
docker-compose up -d

# View logs
docker-compose logs -f youtube-mcp-server

# Stop the server
docker-compose down

For Claude Desktop configuration with Docker:

{
  "mcpServers": {
    "youtube": {
      "command": "docker",
      "args": [
        "run",
        "--rm",
        "-i",
        "ghcr.io/jordanburke/youtube-api-mcp-server:latest"
      ],
      "env": {
        "YOUTUBE_API_KEY": "your_youtube_api_key_here"
      }
    }
  }
}

Using with HTTP Transport

To run the server with HTTP transport for remote access or web integrations:

# Using npm
MCP_TRANSPORT=http MCP_HTTP_PORT=8080 youtube-api-mcp-server

# Using Docker
docker run --rm \
  -e YOUTUBE_API_KEY="your_youtube_api_key_here" \
  -e MCP_TRANSPORT="http" \
  -e MCP_HTTP_PORT="8080" \
  -p 8080:8080 \
  ghcr.io/jordanburke/youtube-api-mcp-server:latest

HTTP Streaming Client Example

The HTTP transport uses Server-Sent Events (SSE) for streaming responses. You can interact with it using any SSE-compatible client:

// Example using JavaScript EventSource
const eventSource = new EventSource('http://localhost:3000/events');

eventSource.onmessage = (event) => {
  const message = JSON.parse(event.data);
  console.log('Received:', message);
};

// Send requests via POST to the main endpoint
fetch('http://localhost:3000', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    jsonrpc: '2.0',
    method: 'tools/list',
    params: {},
    id: 1
  })
});

Using with VS Code

For one-click installation, click one of the install buttons below:

Install with NPX in VS Code Install with NPX in VS Code Insiders

Manual Installation

If you prefer manual installation, first check the install buttons at the top of this section. Otherwise, follow these steps:

Add the following JSON block to your User Settings (JSON) file in VS Code. You can do this by pressing Ctrl + Shift + P and typing Preferences: Open User Settings (JSON).

{
  "mcp": {
    "inputs": [
      {
        "type": "promptString",
        "id": "apiKey",
        "description": "YouTube API Key",
        "password": true
      }
    ],
    "servers": {
      "youtube": {
        "command": "npx",
        "args": ["-y", "youtube-api-mcp-server"],
        "env": {
          "YOUTUBE_API_KEY": "${input:apiKey}"
        }
      }
    }
  }
}

Optionally, you can add it to a file called .vscode/mcp.json in your workspace:

{
  "inputs": [
    {
      "type": "promptString",
      "id": "apiKey",
      "description": "YouTube API Key",
      "password": true
    }
  ],
  "servers": {
    "youtube": {
      "command": "npx",
      "args": ["-y", "youtube-api-mcp-server"],
      "env": {
        "YOUTUBE_API_KEY": "${input:apiKey}"
      }
    }
  }
}

YouTube API Setup

  1. Go to Google Cloud Console
  2. Create a new project or select an existing one
  3. Enable the YouTube Data API v3
  4. Create API credentials (API key)
  5. Copy the API key for configuration

Examples

Managing Videos

// Get video details
const video = await youtube.videos.getVideo({
  videoId: "video-id"
});

// Get video transcript
const transcript = await youtube.transcripts.getTranscript({
  videoId: "video-id",
  language: "en"
});

// Search videos
const searchResults = await youtube.videos.searchVideos({
  query: "search term",
  maxResults: 10
});

Managing Channels

// Get channel details
const channel = await youtube.channels.getChannel({
  channelId: "channel-id"
});

// List channel videos
const videos = await youtube.channels.listVideos({
  channelId: "channel-id",
  maxResults: 50
});

Managing Playlists

// Get playlist items
const playlistItems = await youtube.playlists.getPlaylistItems({
  playlistId: "playlist-id",
  maxResults: 50
});

// Get playlist details
const playlist = await youtube.playlists.getPlaylist({
  playlistId: "playlist-id"
});

Development

This project uses modern tooling for a streamlined development experience:

  • Build System: tsup for fast, zero-config TypeScript builds
  • Package Manager: pnpm for efficient dependency management
  • Transport Layer: FastMCP for multi-transport support (stdio/HTTP)

Commands

# Install dependencies
pnpm install

# Build the project
pnpm build

# Development mode with auto-rebuild
pnpm dev

# Run with HTTP transport in development
pnpm dev:http

# Type checking
pnpm typecheck

# Linting
pnpm lint
pnpm lint:fix

# Format code
pnpm format
pnpm format:check

# Full build verification
pnpm build:check

CI/CD

This project uses GitHub Actions for continuous integration:

  • Linting & Formatting: Ensures code quality and consistent style
  • Type Checking: Validates TypeScript types without emitting files
  • Build Matrix: Tests against Node.js 18, 20, and 22
  • Publish Test: Verifies the package is ready for npm publishing

The CI workflow runs on:

  • Push to main or develop branches
  • All pull requests to main

Contributing

See CONTRIBUTING.md for information about contributing to this repository.

Author

Jordan Burke [email protected]

Originally created by Zubeid Hendricks.

License

This project is licensed under the MIT License - see the LICENSE file for details.