Skip to main content

YouTube transcript MCP server for Claude & ChatGPT. Token-efficient, cached, reliable.

Project description

yt-transcript-mcp

MIT Python 3.11+ 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:

Ko-fi GitHub Sponsors


MIT © Björn Walther

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ytfetch_mcp-1.1.0.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ytfetch_mcp-1.1.0-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

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

Hashes for ytfetch_mcp-1.1.0.tar.gz
Algorithm Hash digest
SHA256 253785d1f0629972bd17d512170c88389e5e49f0dabd431dc4f9c818411e4f16
MD5 45c7e58b2644cbd51209de09e2a557e2
BLAKE2b-256 420961a64b68a65251411fb289091f6f4f3c5b280d6548807227a80677940781

See more details on using hashes here.

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

Hashes for ytfetch_mcp-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 56379def53b273ba734323b5d6fa5425bcf39944fe29ca27ca54e9940d65e0fd
MD5 31399514416b74c7b23d0feb7d784e13
BLAKE2b-256 670dda603587bd9633e2f9f7af71b92c58c588af0307df63409fb2c77ba8545f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page