yt-transcript-mcp
This MCP server fetches YouTube transcripts as token-efficient structured JSON or markdown for AI agents.
Fetch transcripts from any YouTube URL (watch, youtu.be, shorts, embed)
Prioritize languages via comma-separated codes (default sv,en)
Choose output mode: segments (default), text, or both
Select response format: compact JSON or markdown
Include per-line timestamps in text output (optional)
Override title, channel, and publish date manually
Force a fresh fetch with bypass_cache
Receive provenance metadata: caption type, metadata sources, content hash, warnings
Cache transcripts locally for instant repeat queries
Get structured error codes with retryable flags for agent branching
Works with any MCP client (Claude Desktop, ChatGPT Desktop, Cursor, Windsurf, VS Code)
Can also run standalone as a CLI tool
Fetches YouTube video transcripts as clean, token-efficient markdown with metadata, language selection, timestamp options, and local caching for repeated requests.
yt-transcript-mcp
YouTube transcripts as token-efficient AI context. One fetch, cached forever.
Agent-first: returns structured JSON by default. Zero dependencies on yt-dlp, ffmpeg, or API keys.
Works with Claude Desktop, ChatGPT Desktop, Cursor, Windsurf, and any MCP client.
Why?
When AI browses YouTube for a transcript, it processes the entire page: navigation, ads, recommendations, scripts. That's 75,000-150,000 tokens of noise to extract maybe 6,000 tokens of actual content.
This tool fetches only the transcript.
Tokens | Speed | Repeat queries | |
AI browses YouTube | 75-150k | 20-90s | Same cost every time |
ytfetch-mcp | 6-12k | 1-3s | Instant (cached) |
~50 KB per video in cache. A year of daily use stays under 120 MB.
Related MCP server: rippr
Demo
You say:
Fetch the transcript from https://www.youtube.com/watch?v=dQw4w9WgXcQ
Default response (compact JSON, segments only):
{
"is_error": false,
"video_id": "dQw4w9WgXcQ",
"title": "Never Gonna Give You Up",
"channel": "Rick Astley",
"published": "2009-10-25",
"language": "en",
"caption_type": "manual",
"segment_count": 56,
"transcript_duration_seconds": 213.5,
"content_hash": "a1b2c3...",
"cache_hit": false,
"warnings": [],
"segments": [
{"text": "We're no strangers to love", "start": 18.0, "end": 21.4},
{"text": "You know the rules and so do I", "start": 21.4, "end": 24.8}
]
}Structured, machine-readable, one transcript representation. No HTML, no noise, no wasted tokens.
Install
One line. No git clone needed.
Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"yt-transcript": {
"command": "uvx",
"args": ["ytfetch-mcp"]
}
}
}Restart Claude Desktop. Done.
ChatGPT Desktop
Same config in your Codex MCP settings, or add manually:
Field | Value |
Command |
|
Arguments |
|
Tip: Find your uvx path with
which uvx. Restart the app after config changes.
Cursor / Windsurf / VS Code
Paste the same JSON block into your MCP server config.
Requires
uv (includes uvx): curl -LsSf https://astral.sh/uv/install.sh | sh
Parameters
Parameter | Description | Default |
| YouTube URL (required, any format) | |
| Language codes in priority order |
|
|
|
|
|
|
|
|
|
|
| Override title | |
| Override channel | |
| Override date (YYYY-MM-DD) | |
|
|
|
Output modes
| What you get |
| Array of |
| Single readable string (clean or timestamped) |
| Both representations |
Markdown format (format=markdown) always renders readable text regardless of output mode.
How it works
Fetches transcripts directly from YouTube's InnerTube API. No yt-dlp, ffmpeg, browser, Node.js, or API key.
Tries several YouTube client identities (
android_vr,ios,android) and moves to the next only when one is bot-checked or needs a Proof-of-Origin token. A client that was blocked is skipped for 10 minutes.Retries only transient failures (HTTP 429, 5xx, timeouts) and never repeats a permanent one.
This relies on YouTube's unofficial client API, so it can need an update when YouTube changes it.
Error handling
Failures are MCP tool errors (isError: true). The result's text is a structured payload with a machine-readable code and a retryable flag, so agents can branch automatically:
{
"is_error": true,
"error_code": "VIDEO_UNAVAILABLE",
"error_message": "Video is unavailable, private, or removed.",
"retryable": false,
"retry_count": 0
}Error code | Meaning | Retryable |
| Not a YouTube URL or malformed video ID | No |
| Transcripts disabled for this video | No |
| Reserved, not currently returned: if none of your languages exist, another available track is used and | No |
| Video unavailable, private, age-restricted, or unplayable | No |
| YouTube bot check on every client tried (often specific to the video) | No |
| Every client tried needs a Proof-of-Origin token | No |
| YouTube rate limit (429), server error, or timeout. Also used for unclassified failures: check | Yes, unless |
Provenance
Every response includes provenance so you know exactly where the data comes from:
caption_type:manual,auto-generated, orunknownmetadata_sources: per-field tracking ({"title": "oembed", "published": "pytubefix"})content_hash: SHA256 of the segments array for reproducibilitywarnings:AUTO_GENERATED(speech recognition, may contain errors),LANGUAGE_FALLBACK(got a different language than requested),METADATA_FETCH_FAILED(some metadata unavailable),CLIENT_FALLBACK(an earlier YouTube client was blocked and a later one served the request)
Logging
The server logs to stderr (stdout carries the MCP protocol). Default level is WARNING, which includes client fallbacks and retries. Set YTFETCH_LOG_LEVEL=INFO to also log which YouTube client served each fetch.
Cache
Transcripts cached locally in ~/.cache/yt-transcript/. Keyed by video ID + language preference. Second fetch: instant, zero network.
Cache entries validated on load (version, types, segments, metadata)
Legacy or corrupted entries silently skipped
Cache write failures never block transcript delivery
CLI
Also works standalone, no MCP client needed:
uvx ytfetch-mcp # starts the MCP server
uv run yt_transcript.py https://youtu.be/ABC123 # CLI mode, saves .md fileCLI flags: --date, --title, --channel, --lang, --out, --no-clean, --no-cache.
Roadmap
Summary mode -- condensed output for lower token cost
Token budget (
max_tokens) -- fit any context windowBatch URLs -- multiple videos in one call
Chapter/topic filtering -- return only relevant sections
Remote HTTP transport -- expose as streamable HTTP MCP server
Schema.org metadata -- replace pytubefix for publish date
MCP outputSchema / structured content
PO-token fallback -- keep working if YouTube enforces tokens on every client
Support
If this saves you time or tokens:
MIT \u00a9 Bj\u00f6rn Walther
Available Tools
1 toolfetch_transcriptA
Fetch a YouTube video transcript. Returns compact JSON (default) or markdown. Defaults to segments-only for token efficiency. Cached by language preference. Retries only transient errors. Includes provenance, caption type, and verifiable content hash.
Inputs: url (required), title, format, output, +5 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 1 tool
With only one tool, there is no possibility of confusing it with another. The tool's purpose is narrowly and clearly defined.
The single tool name 'fetch_transcript' follows a clear verb_noun convention. There are no other names to contradict this pattern.
One tool is borderline for a server, but it is reasonable for a narrowly focused YouTube transcript service. It feels thin if broader video or transcript management is expected, though the scope appears intentionally minimal.
The tool covers the core need of fetching a transcript with useful options like markdown output, caching, and provenance. Minor gaps exist around listing available transcripts or explicitly choosing languages, but these are workable and not fatal for the stated purpose.
Maintenance
Related MCP Connectors
YouTube transcripts, video search, chapters and extractive summaries. No YouTube API key, no LLM.
YouTube transcripts, search, and channel and playlist listings for any AI app. Hosted.
YouTube transcripts for AI agents: 150+ languages, AI transcription fallback, search, summaries.
Transcripts from YouTube videos, whole channels and playlists for AI agents, with bulk ZIP export.
Related MCP Servers
- AlicenseNot gradedqualityNot gradedmaintenanceEnables AI models to extract transcripts from YouTube videos in multiple languages with zero local setup. It supports all YouTube URL formats and features smart caching via Cloudflare Workers for fast responses.99 npm1MIT
- AlicenseAqualityDmaintenanceExtract YouTube transcripts for AI agents, RAG pipelines, and LLM workflows. Supports any YouTube URL. Returns clean text or timestamped segments. No API keys required.14MIT
- AlicenseAqualityDmaintenanceFast, minimal YouTube 'watch' engine for AI agents that extracts clean transcripts, searches, and slices any YouTube video without requiring an API key.4MIT
- FlicenseNot gradedqualityDmaintenancePay-per-success YouTube transcript extractor for AI agents and RAG pipelines. Timestamps, SRT, plain text. Failed videos are never charged. $0.005/video.-