🧑🚀 全世界最好的LLM资料总结(Agent框架、辅助编程、数据处理、模型训练、模型推理、o1 模型、MCP、小语言模型、视觉语言模型) | Summary of the world's best LLM resources.

youtube_transcript_mcp
0
Github Watches
0
Github Forks
0
Github Stars
YouTube Transcript MCP
A Python-based MCP (Model Control Protocol) server that provides a robust solution for extracting transcripts from YouTube videos using both subtitle-based and audio-based transcription methods. This project enables AI assistants to easily obtain transcripts from any YouTube video through a standardized interface.
Table of Contents
What It Does
This MCP server provides a dual-approach transcription system:
Primary Method: Subtitle-based Transcription
- Extracts available subtitles from YouTube videos
- Supports multiple language preferences
- Uses the
youtube_transcript_api
for efficient subtitle extraction
Fallback Method: Audio-based Transcription
If subtitles are unavailable or explicitly requested, the system will:
- Download the video's audio track using
pytubefix
- Convert the audio to a suitable format using
pydub
- Process the audio in chunks using Google Speech Recognition
- Generate a transcript from the spoken content
Project Architecture
Component Interaction
-
YouTubeTranscriptManager (Main Controller)
- Coordinates the transcription process
- Manages fallback between subtitle and audio methods
- Handles error reporting
-
YouTubeTranscriptExtractor (Subtitle Handler)
- Processes YouTube URLs
- Extracts video IDs
- Manages subtitle retrieval
-
YouTubeAudioManager (Audio Handler)
- Downloads audio content
- Manages audio processing
- Handles speech recognition
Quick Started
Prerequisites
- Python 3.8 or higher
-
uv
package manager ornpm
package manager -
FFmpeg: Required for audio processing (used by
pydub
)
Dependencies
-
youtube_transcript_api
: For subtitle extraction -
pytubefix
: For downloading YouTube audio -
SpeechRecognition
: For audio transcription -
pydub
: For audio processing (requires FFmpeg) -
mcp-python
: For MCP server implementation
Installation
- Clone this repository:
git clone [your-repo-url]
cd youtube_transcript_mcp
- Install dependencies:
uv venv
uv pip install -r requirements.txt
- Install FFmpeg:
-
Windows: Download FFmpeg from https://ffmpeg.org/download.html, extract it, and add the
bin
folder to your system's PATH. -
macOS: Use Homebrew:
brew install ffmpeg
-
Linux: Use your package manager, e.g.,
sudo apt install ffmpeg
(Debian/Ubuntu)
-
Windows: Download FFmpeg from https://ffmpeg.org/download.html, extract it, and add the
Running the Server
Run the server using:
uv run youtube_transcript_manager.py
Configuration with Claude for Desktop
To use this server with Claude for Desktop, add the following to your Claude configuration file (~/Library/Application Support/Claude/claude_desktop_config.json
):
{
"mcpServers": {
"youtube_transcript": {
"command": "uv",
"args": [
"--directory",
"PATH_TO_YOUR_PROJECT_FOLDER",
"run",
"youtube_transcript_manager.py"
]
}
}
}
Replace PATH_TO_YOUR_PROJECT_FOLDER
with the absolute path to your project directory.
MCP Server Usage
The server provides a single powerful tool get_youtube_transcript
with the following parameters:
async def get_youtube_transcript(
url: str, # YouTube video URL
languages: Optional[List[str]] = None, # Preferred subtitle languages
use_audio: bool = False # Force audio-based transcription
) -> str: # Returns the transcript text
Example Usage
- To get transcript using available subtitles:
transcript = await get_youtube_transcript("https://www.youtube.com/watch?v=VIDEO_ID")
- To get transcript in specific languages:
transcript = await get_youtube_transcript(
"https://www.youtube.com/watch?v=VIDEO_ID",
languages=["en", "es"]
)
- To force audio-based transcription:
transcript = await get_youtube_transcript(
"https://www.youtube.com/watch?v=VIDEO_ID",
use_audio=True
)
相关推荐
🔥 1Panel provides an intuitive web interface and MCP Server to manage websites, files, containers, databases, and LLMs on a Linux server.
Dify is an open-source LLM app development platform. Dify's intuitive interface combines AI workflow, RAG pipeline, agent capabilities, model management, observability features and more, letting you quickly go from prototype to production.
an easy-to-use dynamic service discovery, configuration and service management platform for building AI cloud native applications.
⛓️RuleGo is a lightweight, high-performance, embedded, next-generation component orchestration rule engine framework for Go.
Easily create LLM tools and agents using plain Bash/JavaScript/Python functions.
Reviews

user_080hK8N1
The youtube_transcript_mcp by yuncheng-wu has been a fantastic tool for me. It effortlessly extracts transcripts from YouTube videos, making content analysis a breeze. The seamless integration and user-friendly interface are remarkable. Highly recommend for anyone who needs accurate and quick transcripts from YouTube!

user_aVUuRFbf
I'm a huge fan of youtube_transcript_mcp by yuncheng-wu! This tool is incredibly efficient for extracting transcripts from YouTube videos, making it easier to get the content you need quickly. It’s user-friendly and works like a charm. Highly recommended for anyone who frequently relies on YouTube content for study or work!