MCP HubMCP Hub
kimtaeyoon83

mcp-server-youtube-transcript

by: kimtaeyoon83

This is an MCP server that allows you to directly download transcripts of YouTube videos.

142created 29/11/2024
Visit
YouTube
transcripts

📌Overview

Purpose: To enable easy retrieval of transcripts from YouTube videos through a simple interface.

Overview: The YouTube Transcript Server is a Model Context Protocol (MCP) server that facilitates access to video captions and subtitles from YouTube. It is designed to streamline the process of extracting transcripts, making it user-friendly for various applications.

Key Features:

  • Support for multiple video URL formats: Allows extraction of transcripts from various formats of YouTube video URLs, enhancing usability.

  • Language-specific transcript retrieval: Users can request transcripts in different languages, accommodating a diverse audience.

  • Detailed metadata in responses: Provides additional context and information in the output, improving the user experience.


YouTube Transcript Server

A Model Context Protocol server that enables retrieval of transcripts from YouTube videos, providing direct access to video captions and subtitles through a simple interface.

Installation

Via Smithery

To install YouTube Transcript Server for Claude Desktop:

npx -y @smithery/cli install @kimtaeyoon83/mcp-server-youtube-transcript --client claude

Components

Tools

  • get_transcript: Extracts transcripts from YouTube videos.
    • Inputs:
      • url (string, required): YouTube video URL or video ID
      • lang (string, optional, default: "en"): Language code for transcript (e.g., 'ko', 'en')

Configuration

To use with Claude Desktop, add the following server configuration:

{
  "mcpServers": {
    "youtube-transcript": {
      "command": "npx",
      "args": ["-y", "@kimtaeyoon83/mcp-server-youtube-transcript"]
    }
  }
}

Installation via Tool

Use mcp-get to install:

npx @michaellatman/mcp-get@latest install @kimtaeyoon83/mcp-server-youtube-transcript

Development

Prerequisites

  • Node.js 18 or higher
  • npm or yarn

Setup Steps

  1. Install dependencies:

    npm install
    
  2. Build the server:

    npm run build
    
  3. For development with auto-rebuild:

    npm run watch
    

Testing

To run tests:

npm test

Debugging

Use the MCP Inspector for development:

npm run inspector

Error Handling

The server implements robust error handling for:

  • Invalid video URLs or IDs
  • Unavailable transcripts
  • Language availability issues
  • Network errors

Usage Examples

  1. Get transcript by video URL:

    await server.callTool("get_transcript", {
      url: "https://www.youtube.com/watch?v=VIDEO_ID",
      lang: "en"
    });
    
  2. Get transcript by video ID:

    await server.callTool("get_transcript", {
      url: "VIDEO_ID",
      lang: "ko"
    });
    

Security Considerations

The server:

  • Validates all input parameters
  • Handles YouTube API errors gracefully
  • Implements timeouts for transcript retrieval
  • Provides detailed error messages for troubleshooting

License

This MCP server is licensed under the MIT License. See the LICENSE file for details.