Related MCP Server Resources

Explore more AI models, providers, and integration options:

  • Explore AI Models
  • Explore AI Providers
  • Explore MCP Servers
  • LangDB Pricing
  • Documentation
  • AI Industry Blog
  • MCP Web Browser Server
  • YouTube Watch Later MCP Server
  • Gemini MCP Image Generation Server
  • AWS Knowledge Base Retrieval MCP Server
  • SMTP MCP Server
Back to MCP Servers
YouTube MCP Server

YouTube MCP Server

Public
nattyraz/youtube-mcp

Model Context Protocol server enabling extraction of YouTube video metadata, captions in multiple languages, markdown conversion with customizable templates, and advanced search functionality using API key or OAuth2 authentication.

typescript
0 tools
May 30, 2025
Updated Jun 4, 2025

Supercharge Your AI with YouTube MCP Server

MCP Server

Unlock the full potential of YouTube MCP Server through LangDB's AI Gateway. Get enterprise-grade security, analytics, and seamless integration with zero configuration.

Unified API Access
Complete Tracing
Instant Setup
Get Started Now

Free tier available • No credit card required

Instant Setup
99.9% Uptime
10,000+Monthly Requests

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

Prerequisites

  • Node.js (v16 or higher)
  • npm or yarn
  • A YouTube Data API key and/or OAuth2 credentials

Installation

  1. Clone the repository:
git clone [repository-url] cd youtube-mcp
  1. Install dependencies:
npm install
  1. Build the project:
npm run build

Configuration

Create a .env file in the root directory with your YouTube credentials:

YOUTUBE_API_KEY=your_api_key YOUTUBE_CLIENT_ID=your_client_id YOUTUBE_CLIENT_SECRET=your_client_secret YOUTUBE_REFRESH_TOKEN=your_refresh_token # Optional, for OAuth2

MCP Configuration

Add the server to your MCP settings file (usually at ~/.config/Code/User/globalStorage/rooveterinaryinc.roo-cline/settings/cline_mcp_settings.json):

{ "mcpServers": { "youtube": { "command": "node", "args": ["path/to/youtube-mcp/build/index.js"], "env": { "YOUTUBE_API_KEY": "your_api_key", "YOUTUBE_CLIENT_ID": "your_client_id", "YOUTUBE_CLIENT_SECRET": "your_client_secret" }, "disabled": false, "alwaysAllow": [] } } }

Usage

The server provides the following tools:

1. Get Video Info

use_mcp_tool youtube get_video_info { "url": "https://www.youtube.com/watch?v=VIDEO_ID" }

2. Get Captions

use_mcp_tool youtube get_captions { "url": "https://www.youtube.com/watch?v=VIDEO_ID", "language": "en" // Optional, defaults to "en" }

3. Convert to Markdown

use_mcp_tool youtube convert_to_markdown { "url": "https://www.youtube.com/watch?v=VIDEO_ID", "template_name": "detailed", // Optional, "basic", "detailed", or "search" "language": "en", // Optional "options": { // Optional "include_chapters": true, "search_term": "keyword" // Only for search template } }

4. List Templates

use_mcp_tool youtube list_templates

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" } }

OAuth2 Setup

For OAuth2 authentication (required for private video access):

  1. Create a project in the Google Cloud Console
  2. Enable the YouTube Data API v3
  3. Create OAuth2 credentials (Web application type)
  4. Run the authentication script:
node src/get-api-key.js
  1. Follow the browser prompts to authorize the application
  2. Copy the refresh token to your configuration

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; } }

License

MIT

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request
Publicly Shared Threads0

Discover shared experiences

Shared threads will appear here, showcasing real-world applications and insights from the community. Check back soon for updates!

Share your threads to help others
Related MCPs5
  • MCP Web Browser Server
    MCP Web Browser Server

    Advanced Model Context Protocol server enabling headless web browsing with multi-tab support, dynami...

    6 tools
    Added May 30, 2025
  • YouTube Watch Later MCP Server
    YouTube Watch Later MCP Server

    Provides secure OAuth2 access to retrieve URLs of YouTube videos added to a custom playlist within a...

    Added May 30, 2025
  • Gemini MCP Image Generation Server
    Gemini MCP Image Generation Server

    Provides image generation capabilities via Google's Gemini 2 API using the Model Context Protocol, e...

    1 tools
    Added May 30, 2025
  • AWS Knowledge Base Retrieval MCP Server
    AWS Knowledge Base Retrieval MCP Server

    Retrieval-Augmented Generation (RAG) server enabling efficient extraction of contextual information ...

    Added May 30, 2025
  • SMTP MCP Server
    SMTP MCP Server

    Model Context Protocol server enabling AI assistants to send and manage emails with multiple SMTP co...

    11 tools
    Added May 30, 2025