Labsco
nattyraz logo

YouTube MCP Server

โ˜… 5

from nattyraz

Extract metadata and captions from YouTube videos and convert them to markdown.

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedAccount requiredAdvanced setup

YouTube MCP Server

A Model Context Protocol (MCP) server for interacting with YouTube videos. This server provides tools for extracting video metadata, captions, and converting them to markdown format with various templates.

Features

  • Video Metadata: Fetch comprehensive video information
  • Caption Extraction: Support for auto-generated and manual captions
  • Multiple Languages: Built-in support for English and French
  • Template System: Three built-in markdown templates:
    • Basic: Simple transcript format
    • Detailed: Full metadata with timestamps
    • Search: Results highlighting with context
  • Search Functionality: Search within video captions
  • Flexible Authentication: Supports both API key and OAuth2 authentication

Dependencies

{
  "dependencies": {
    "@modelcontextprotocol/sdk": "latest",
    "googleapis": "^146.0.0",
    "google-auth-library": "^9.0.0",
    "youtube-captions-scraper": "^2.0.0",
    "express": "^4.18.2",
    "open": "^9.1.0"
  },
  "devDependencies": {
    "@types/node": "^20.0.0",
    "typescript": "^5.0.0",
    "tsx": "^4.0.0"
  }
}

Customizing Templates

You can add custom templates by modifying the DEFAULT_TEMPLATES array in src/index.ts. Templates follow this structure:

interface MarkdownTemplate {
  name: string;
  description: string;
  format: {
    header?: string;
    chapter_format?: string;
    caption_block: string;
    timestamp_format?: string;
    search_result_format?: string;
  }
}