Purpose mcp-server-youtube-transcript is a Model Context Protocol server used to fetch subtitles and transcripts of YouTube videos and provide them through the MCP interface to clients that support the protocol, such as Claude Desktop.
Main capabilities
- get_transcript: Extract subtitles and transcripts from YouTube videos. Input parameters include: url (required; can be a YouTube video URL, Shorts URL, or video ID), lang (optional, default "en", specifies the subtitle language code, such as 'ko', 'en'; if the requested language does not exist, it automatically falls back to an available language), include_timestamps (optional, default false, includes timestamps in the output, such as '[0:05] text'), strip_ads (optional, default true, filters sponsored, advertising, and promotional content based on chapter markers).
- analyze_video (optional, requires a TwelveLabs API key): Uses the TwelveLabs Pegasus video understanding model to analyze videos. Unlike get_transcript, this tool reasons based on visual content, so it can generate useful summaries and answers even when the video has little or no speech (such as demos, gameplay footage, B-roll, music videos). Input parameters include: url (required, a publicly accessible direct video URL, such as an .mp4 / .mov / .webm link or a presigned URL; TwelveLabs fetches the file server-side, so a YouTube watch page URL is not usable because it returns HTML rather than the raw video stream), prompt (optional, instructions or questions for the model, defaulting to a general summary), model (optional, default "pegasus1.2", can be "pegasus1.2" or "pegasus1.5"), max_tokens (optional, default 2048, maximum response length). This tool requires the environment variable TWELVELABS_API_KEY; the transcript tool does not require this key, and video analysis is a completely optional feature.
Other features: supports multiple video URL formats (including YouTube Shorts); supports fetching subtitles by language and automatically retregression; optional timestamps facilitate referencing specific moments; built-in ad/sponsor filtering (enabled by default); zero external dependencies for subtitle retrieval; detailed metadata included in responses.
Usage Can be automatically installed into Claude Desktop via Smithery, or the server configuration can be manually added in Claude Desktop; to enable the optional analyze_video tool, a TwelveLabs API key must be added. MCP servers can also be installed and managed via the mcp-get command-line tool, and the project is also listed in the awesome-mcp-servers list. The runtime environment requires Node.js 18 or higher. After installing dependencies, build the server; during development, automatic rebuilds can be used. Since the MCP server communicates via stdio, debugging can be difficult, so using MCP Inspector for development is recommended. The evals package loads the mcp client and runs the index.ts file, so there is no need to rebuild between tests, and environment variables can be loaded by prefixing the npx command.
Use cases Suitable for scenarios that need to bring YouTube video subtitles or transcripts into MCP client workflows, such as content organization, subtitle retrieval, timestamp-based referencing, and summarization and question answering combined with video frames in MCP-enabled tools.
Limitations analyze_video requires a TwelveLabs API key and only accepts publicly accessible direct video URLs; YouTube watch page URLs are not supported. Subtitle retrieval depends on YouTube subtitles being available; the server implements error handling for common scenarios such as invalid video URLs or IDs, unavailable subtitles, and language availability issues, including input parameter validation, YouTube API error handling, subtitle retrieval timeouts, and detailed error messages.
License This project uses the MIT License, see the LICENSE file for details.