Skip to main content
Glama
jedarden

YouTube Transcript DL MCP Server

by jedarden

get_playlist_transcripts

Extract transcripts from all videos in a YouTube playlist, supporting multiple languages and output formats like text, JSON, or SRT. Includes optional metadata for enhanced analysis.

Instructions

Extract transcripts from all videos in a YouTube playlist

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
includeMetadataNoInclude metadata in response
languageNoLanguage code (e.g., "en", "es", "fr")en
outputFormatNoOutput formatjson
playlistIdYesYouTube playlist ID or URL

Implementation Reference

  • The primary handler function implementing the getPlaylistTranscripts tool logic. It extracts the playlist ID and currently throws an error, noting that full implementation requires a YouTube Data API key to fetch video IDs from the playlist.
    public async getPlaylistTranscripts( request: PlaylistTranscriptRequest ): Promise<BulkTranscriptResponse> { try { // Extract playlist ID const playlistId = this.extractPlaylistId(request.playlistId); // Get video IDs from playlist (this would need YouTube Data API) // For now, we'll throw an error indicating this needs API key throw new Error('Playlist processing requires YouTube Data API key. Please extract video IDs manually.'); } catch (error) { this.logger.error(`Failed to process playlist ${request.playlistId}:`, error); return { results: [], errors: [{ videoId: request.playlistId, error: error instanceof Error ? error.message : 'Unknown error' }], summary: { total: 0, successful: 0, failed: 1 } }; } }
  • TypeScript interface defining the input schema for the get_playlist_transcripts tool.
    export interface PlaylistTranscriptRequest { playlistId: string; outputFormat: 'text' | 'json' | 'srt'; language?: string; includeMetadata?: boolean; }
  • Registration of the 'get_playlist_transcripts' tool in the MCP server's list of available tools, including its description and input schema.
    name: 'get_playlist_transcripts', description: 'Extract transcripts from all videos in a YouTube playlist', inputSchema: { type: 'object', properties: { playlistId: { type: 'string', description: 'YouTube playlist ID or URL' }, language: { type: 'string', description: 'Language code (e.g., "en", "es", "fr")', default: 'en' }, outputFormat: { type: 'string', enum: ['text', 'json', 'srt'], description: 'Output format', default: 'json' }, includeMetadata: { type: 'boolean', description: 'Include metadata in response', default: true } }, required: ['playlistId'] } },
  • MCP server wrapper handler that parses arguments, validates input, calls the transcript service, and formats the response for the MCP protocol.
    private async handleGetPlaylistTranscripts(args: any) { const { playlistId, language = 'en', outputFormat = 'json', includeMetadata = true } = args; if (!playlistId) { throw new McpError(ErrorCode.InvalidParams, 'playlistId is required'); } const request = { playlistId, language, outputFormat, includeMetadata }; const result = await this.transcriptService.getPlaylistTranscripts(request); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; }

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/jedarden/yt-transcript-dl-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server