About YouTube Transcript API
A Python service for retrieving YouTube video information and transcripts through REST or MCP. It can use available captions or fall back to Whisper audio transcription.
Key features
- 01Fetch transcripts in multiple languages
- 02Detect available transcript languages
- 03Transcribe audio with Whisper as fallback
- 04Expose REST and MCP interfaces
- 05Report progress and clean temporary files
Use cases
- 01Retrieve captions for a YouTube video
- 02Transcribe audio when captions are unavailable
MCP support
The MCP server exposes tools to retrieve and extract transcripts and search YouTube videos.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.
Tools
Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.
Details
From the project READMEYouTube Transcript API
A Python service that provides APIs to fetch and transcribe YouTube video content. It supports both REST API (Flask) and MCP server implementations.
Features
- Fetch YouTube video transcripts in multiple languages (English and Vietnamese)
- Auto-detect and use available transcripts
- Fallback to audio transcription using Whisper when transcripts are unavailable
- Support for both REST API and MCP server interfaces
- Automatic language detection
- Temporary file cleanup
- Progress reporting for long-running operations
Installation
pip install -r requirements.txt
Usage
REST API (Flask)
Start the Flask server:
python apps/flask_server.py
Available endpoints:
GET /transcript?video_id=<video_id>&language=<lang>- Get video transcriptGET /video/info?video_id=<video_id>- Get video informationGET /health- Health check endpoint
MCP Server
Start the MCP server:
python apps/mcp_server.py
Available tools:
get_transcript(video_id, language)- Get video transcriptextract_transcript(video_id, language)- Extract transcript from audiosearch_youtube_video(query)- Search for YouTube videos
Language Support
- English (en)
- Vietnamese (vi)
- Auto-detection for other languages
Dependencies
- youtube-transcript-api
- pytube
- whisper
- torch
- langdetect
- flask (for REST API)
- mcp (for MCP server)
Development
The project structure:
apps/
├── __init__.py
├── flask_server.py # REST API implementation
├── mcp_server.py # MCP server implementation
└── utils.py # Shared utilities
License
MIT License
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.