Yt-to-transcript-MCP
Provides tools to retrieve YouTube video transcripts and captions, list available caption languages, translate auto-captions, search transcripts, slice time ranges, get video metadata and chapters, and save transcripts in multiple formats.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Yt-to-transcript-MCP grab the transcript of https://youtu.be/dQw4w9WgXcQ as SRT"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Yt-to-transcript-MCP
Turn any YouTube video into a transcript from inside Claude, Gemini, or ChatGPT.
A single Model Context Protocol server,
written in Python. It speaks stdio for desktop clients (Claude Desktop,
Claude Code, Gemini CLI) and streamable-http / sse for remote clients
(ChatGPT web, the OpenAI Responses API). One codebase, three assistants.
Repository: https://github.com/YassineBadriDev/Yt-to-transcript-MCP
What it does
YouTube URL / video ID
│
├─ 1. youtube-transcript-api → human captions, then auto-generated captions
├─ 2. yt-dlp → direct caption-track download (fallback if 1 is IP-blocked)
└─ 3. Whisper (optional) → download audio + local speech-to-text (videos with NO captions)
│
▼
text · timestamped lines · Markdown · SRT · WebVTT · JSONIt also lists available caption languages, translates auto-captions, searches inside a transcript, slices a time range, and exposes video metadata (title, channel, duration, chapters). MCP resources and a prompt template are included too.
No API key required. It uses YouTube's public caption tracks. Whisper runs locally and needs no external service either.
Related MCP server: YouTube Transcript MCP Server
Tools
Tool | Purpose |
| Main tool. URL or ID → transcript in |
| Title, channel, duration, chapters, views, upload date (via yt-dlp, with an oEmbed fallback). |
| All caption tracks, human vs auto-generated, and available translation targets. |
| Only the captions between two timestamps — essential for long videos. |
| Find a word/phrase and get timestamped matches with surrounding context. |
| Write the transcript to |
| Whisper fallback for videos with no captions at all. |
Resources: youtube://video/{id}/info, youtube://video/{id}/transcript/{lang}.
Prompt: summarize_video.
Install
Requires Python 3.10+.
git clone https://github.com/YassineBadriDev/Yt-to-transcript-MCP.git
cd Yt-to-transcript-MCP
python -m venv .venv
.venv\Scripts\activate # Windows | source .venv/bin/activate on Unix
python -m pip install -e .
python -m youtube_mcp --selftest # offline check, no network neededOr without cloning: python -m pip install -r requirements.txt and set
PYTHONPATH=<repo>/src.
Optional extras:
python -m pip install -e ".[whisper]" # audio -> text fallback; also needs ffmpeg on PATH
python -m pip install -e ".[dev]" # pytest
python -m pytest tests -qUse with Claude
Claude Desktop
Merge config/claude_desktop_config.json into:
OS | Path |
Windows |
|
macOS |
|
{
"mcpServers": {
"youtube-transcript": {
"command": "python",
"args": ["-m", "youtube_mcp"],
"env": { "YOUTUBE_MCP_DEFAULT_LANGUAGE": "en" }
}
}
}Restart Claude Desktop. If python is not on its PATH (common on Windows),
replace command with the absolute path to your venv's python.exe.
Claude Code
claude mcp add youtube-transcript -- python -m youtube_mcpOr copy config/claude_code.mcp.json to your project root as .mcp.json.
See config/README.md for all details.
Use with Gemini
Gemini CLI uses the same mcpServers schema. Add config/gemini_settings.json
to ~/.gemini/settings.json (global) or <project>/.gemini/settings.json:
gemini mcp add youtube-transcript python -- -m youtube_mcpThen run /mcp to confirm the tools are discovered. Gemini CLI also supports
reading MCP resources with @youtube://video/<id>/info.
Use a hyphenated server name (
youtube-transcript), not an underscored one — Gemini CLI splits policy names on underscores.
Optionally point it at the HTTP server instead:
{ "mcpServers": { "youtube-transcript": { "httpUrl": "http://127.0.0.1:8000/mcp" } } }Use with ChatGPT
ChatGPT is remote-only: it cannot spawn a local stdio process. Start the HTTP transport and expose it over HTTPS:
python -m youtube_mcp --transport streamable-http --port 8000 --auth-token "a-long-random-secret"
cloudflared tunnel --url http://127.0.0.1:8000 # or: ngrok http 8000Then either:
ChatGPT web (Business / Enterprise / Edu; Pro has read/fetch-only): Settings → Plugins → Add custom MCP server →
https://<tunnel>/mcp.OpenAI Responses API from code (any plan), using the
mcptool type:
from openai import OpenAI
resp = OpenAI().responses.create(
model="gpt-5.2",
tools=[{
"type": "mcp",
"server_label": "youtube_transcript",
"server_url": "https://<tunnel>/mcp",
"authorization": "a-long-random-secret",
"require_approval": "never",
}],
input="Transcribe https://youtu.be/dQw4w9WgXcQ and give 3 timestamped highlights.",
)
print(resp.output_text)OpenAI Agents SDK can use the local stdio server, exactly like Claude/Gemini.
Full instructions (auth options, tunnels, Docker, approvals): config/chatgpt.md. Runnable example: examples/openai_responses_api.py.
Example prompts
Transcribe https://www.youtube.com/watch?v=VIDEO_ID as SRT and save it to talk.srt.What does https://youtu.be/VIDEO_ID say about diffusion models?
Find the relevant timestamps and quote them.List the caption languages available for this video, then translate the
French auto-captions into English.Summarize this 2-hour lecture chapter by chapter using its chapters and
get_transcript_range.Configuration
All settings are environment variables (see .env.example).
Variable | Default | Meaning |
|
| Language used when a tool call omits |
|
|
|
|
| Bind address for HTTP transports. |
|
| Bind port for HTTP transports. |
| (empty) | Require |
|
| Only directory |
| (empty) | HTTP proxy, useful on cloud IPs blocked by YouTube. |
| (empty) | e.g. |
| (empty) | Netscape-format cookie file for yt-dlp. |
|
|
|
CLI flags override the environment:
python -m youtube_mcp --transport streamable-http --host 0.0.0.0 --port 8080 --auth-token SECRETGET /health is always public so tunnels and load balancers can probe it.
Output formats
| Shape |
| One clean paragraph of plain text. |
|
|
| Title/metadata header plus bold timestamps. |
| Ready-to-use subtitle files. |
|
|
Long videos: pass max_chars, or use search_transcript +
get_transcript_range instead of loading the whole transcript into context.
Whisper fallback (videos with no captions)
python -m pip install -e ".[whisper]" # faster-whisper
# also install ffmpeg (winget install ffmpeg / choco install ffmpeg / apt install ffmpeg)Then ask the model to call transcribe_audio. It downloads the audio with
yt-dlp and transcribes locally. This is slow — roughly minutes for a long
video — and is deliberately a separate tool so normal caption retrieval stays
instant.
Troubleshooting
Symptom | Fix |
| The server automatically falls back to yt-dlp. If both fail, set |
| Call |
No captions at all | Use |
Age-restricted / "Sign in to confirm" | Set |
Client cannot find | Use an absolute interpreter path in the config (config/README.md). |
| Files must stay inside |
YouTube layout changed |
|
| Try |
Debug with the MCP Inspector:
npx @modelcontextprotocol/inspector python -m youtube_mcpSecurity notes
save_transcriptis sandboxed toYOUTUBE_MCP_OUTPUT_DIR; it cannot write anywhere else.When exposing HTTP publicly, always set
YOUTUBE_MCP_AUTH_TOKEN(or put the server behind OAuth)./healthremains unauthenticated.Never expose an unauthenticated server to the internet just to test ChatGPT; use a short-lived tunnel instead.
Transcripts are third-party content. Treat anything returned by a tool as untrusted data, and be mindful of prompt-injection text inside captions.
Legal
This tool reads publicly available caption tracks; it does not bypass DRM or download protected video streams. YouTube captions and video content may be copyrighted. Summarise and quote short excerpts rather than reproducing entire works, and comply with YouTube's Terms of Service and your local law.
Development
src/youtube_mcp/
core.py # retrieval engine (no MCP imports, usable as a library)
formats.py # text / timestamped / markdown / srt / vtt / json
server.py # FastMCP tools, resources, prompts
__main__.py # transports, bearer auth, CLI
config/ # ready-to-edit client configs
examples/ # offline smoke test + Responses API example
tests/ # offline unit testspython -m pytest tests -q
python -m youtube_mcp --selftest
python examples/smoke_test.py dQw4w9WgXcQ # one real network callLicense
MIT — see LICENSE.
Available Tools
7 toolsget_transcriptA
Convert a YouTube video into a transcript.
Returns human captions when available, otherwise YouTube auto-generated
captions, with an automatic yt-dlp fallback if the caption API is blocked.
Use format='timestamped' or format='json' to keep timing information.
Inputs: video (required), format, prefer, language, +2 more. Returns: result
get_transcript_rangeA
Return only the part of a transcript between two timestamps.
Useful for long videos: fetch metadata/chapters, then pull just the relevant section instead of the whole transcript.
Inputs: video (required), end_seconds (required), start_seconds (required), format, +1 more. Returns: result
get_video_infoA
Get metadata for a YouTube video: title, channel, duration, chapters, upload date, views.
No transcript is fetched, so this is cheap. Use it before pulling a long transcript.
Inputs: video (required). Returns: result
list_transcript_languagesA
List all caption tracks for a video (language code, human vs auto, translatable targets).
Call this when get_transcript reports that the requested language is unavailable.
Inputs: video (required). Returns: result
save_transcriptA
Fetch a transcript and write it to a file (txt / srt / vtt / md / json).
Returns the absolute path written. Writes are restricted to the YOUTUBE_MCP_OUTPUT_DIR directory for safety.
Inputs: video (required), filename (required), format, prefer, +1 more. Returns: result
search_transcriptA
Find where a word or phrase is spoken in a video.
Returns timestamped matches so the model can jump straight to the relevant part of a long video with get_transcript_range.
Inputs: query (required), video (required), context, language, +1 more. Returns: result
transcribe_audioA
Speech-to-text fallback for videos with NO captions.
Downloads the audio with yt-dlp and transcribes it locally with Whisper.
Requires pip install '.[whisper]' and the ffmpeg binary on PATH.
This is slow (minutes for a long video) - only use it when get_transcript fails.
Inputs: video (required), format, language, model_size. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Each tool has a clearly distinct role: metadata, language discovery, full transcript, timestamped range, search, file saving, and audio fallback. The only apparent overlap, get_transcript vs transcribe_audio, is explicitly separated by captions vs no-captions fallback usage.
All tool names use consistent snake_case verb_noun conventions such as get_transcript, search_transcript, list_transcript_languages, and save_transcript. Compound names like get_transcript_range still follow the same predictable pattern.
Seven tools is well-scoped for a YouTube transcript server. Each tool earns its place by covering a distinct workflow step without redundant or filler operations.
The surface covers the full practical lifecycle: inspect video info, discover caption languages, fetch transcripts, search and slice long transcripts, save outputs, and fall back to local speech-to-text when captions are absent. No obvious dead ends exist for the stated transcript-extraction purpose.
Maintenance
Related MCP Connectors
Transcripts of YouTube videos, channels, playlists and searches; AI transcription when no captions.
Transcripts, translations, summaries, subtitles, and search for public YouTube videos.
Transcribe YouTube via Whisper. Summaries, chapters, semantic-search across your corpus.
Fetch YouTube transcripts with timestamps, search history, and export data for AI models.
Related MCP Servers
- AlicenseAqualityCmaintenanceEnables fetching, searching, and analyzing YouTube video transcripts in multiple languages using yt-dlp. Supports timestamp filtering, language detection, and transcript summaries with robust error handling for production use.4MIT
- AlicenseAqualityDmaintenanceEnables fetching, searching, and summarizing YouTube video transcripts with multi-language support.4MIT
- AlicenseNot gradedqualityNot gradedmaintenanceEnables Claude AI to extract transcripts from YouTube videos with zero local setup, supporting multi-language and all URL formats.MIT
- AlicenseAqualityCmaintenanceEnables MCP clients and agents to fetch YouTube transcripts and caption lists from video IDs or links, preferring manual/auto captions by ordered language preference and falling back to local Faster-Whisper audio transcription when captions are unavailable. Results include source, language, full text and timestamped segments, with CLI exports to JSON, text, SRT and WebVTT, all without paid APIs or API keys.3MIT