YouTube transcript MCP server for Claude & ChatGPT. Token-efficient, cached, reliable.
Project description
yt-transcript-mcp
YouTube transcripts as token-efficient AI context. One fetch, cached forever.
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 |
| yt-transcript-mcp | 6–12k | 1–3s | Instant (cached) |
Once cached, a transcript costs zero tokens to retrieve again. Same content can feed 10 different conversations without a single YouTube request. Less compute, less energy, more output.
Demo
You say:
Fetch the transcript from https://www.youtube.com/watch?v=dQw4w9WgXcQ
The tool returns:
# Never Gonna Give You Up
source: https://www.youtube.com/watch?v=dQw4w9WgXcQ
channel: Rick Astley
published: 2009-10-25
language: en
segments: 56
metadata_source: oembed+pytubefix
fetched: 2026-08-02
---
## Transcript
We're no strangers to love You know the rules and so do I
A full commitment's what I'm thinking of You wouldn't get
this from any other guy...
Clean markdown. Metadata header for context. 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": ["--from", "git+https://github.com/bjornwalther/yt-transcript", "yt-transcript-mcp"]
}
}
}
Restart Claude Desktop. Done.
ChatGPT Desktop
Same config in your Codex MCP settings, or add manually:
| Field | Value |
|---|---|
| Command | uvx (or full path: ~/.local/bin/uvx) |
| Arguments | --from git+https://github.com/bjornwalther/yt-transcript yt-transcript-mcp |
Tip: Find your uvx path with
which uvx. Arguments must be separate values, not one string.
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
Features
Local cache. Transcripts stored in ~/.cache/yt-transcript/ (15–50 KB per video). A year of heavy use stays under 25 MB. Second fetch: instant, zero network, zero energy.
Retry with backoff. YouTube rate-limits sometimes. Retries 3x with 3s delays. Output tells you what happened:
note: Retry succeeded (attempt 2/3).
Layered metadata. Title and channel via YouTube oEmbed (fast, no API key). Publish date via pytubefix fallback. Manual overrides always win: pass title, channel, or published directly.
Transparency. Every response shows metadata source, cache status, retry info. No guessing, no silent failures.
Lean code. Minimal dependencies, ~100 lines for the MCP server. Less code = less to break, less energy to run.
Parameters
| Parameter | Description |
|---|---|
url |
YouTube URL (required, any format) |
languages |
Language codes, e.g. sv,en (default: sv,en) |
include_timestamps |
true for [HH:MM:SS] per line |
title |
Override title |
channel |
Override channel |
published |
Override date (YYYY-MM-DD) |
bypass_cache |
true to force fresh fetch |
CLI
Also works standalone, no MCP client needed:
uvx --from git+https://github.com/bjornwalther/yt-transcript yt-transcript https://youtu.be/ABC123
Saves a .md file to ./transcripts/. Flags: --date, --title, --channel, --lang, --out, --no-clean, --no-cache.
Roadmap
- Summary mode — condensed output for lower token cost
- Chapter/topic filtering — return only relevant sections
- Token budget (
max_tokens) — fit any context window - Batch URLs — multiple videos in one call
- MCP registry listing
Support
If this saves you time or tokens:
MIT © Björn Walther
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ytfetch_mcp-1.1.0.tar.gz.
File metadata
- Download URL: ytfetch_mcp-1.1.0.tar.gz
- Upload date:
- Size: 9.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
253785d1f0629972bd17d512170c88389e5e49f0dabd431dc4f9c818411e4f16
|
|
| MD5 |
45c7e58b2644cbd51209de09e2a557e2
|
|
| BLAKE2b-256 |
420961a64b68a65251411fb289091f6f4f3c5b280d6548807227a80677940781
|
File details
Details for the file ytfetch_mcp-1.1.0-py3-none-any.whl.
File metadata
- Download URL: ytfetch_mcp-1.1.0-py3-none-any.whl
- Upload date:
- Size: 9.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
56379def53b273ba734323b5d6fa5425bcf39944fe29ca27ca54e9940d65e0fd
|
|
| MD5 |
31399514416b74c7b23d0feb7d784e13
|
|
| BLAKE2b-256 |
670dda603587bd9633e2f9f7af71b92c58c588af0307df63409fb2c77ba8545f
|