Skip to main content

Fast, minimal YouTube watch engine for AI agents — clean transcripts, no API key required.

Project description

Youtube MCP

Fast, minimal, and reliable YouTube MCP for AI agents.

Banner

Install

Claude Code

claude mcp add youtube -- uvx youtube-watch-mcp

Before publish (local dev): point uvx at the checkout instead: claude mcp add youtube -- uvx --from /path/to/youtube-mcp youtube-watch-mcp

Claude Desktop / Codex / other MCP clients

Add to the client's MCP config:

{
  "mcpServers": {
    "youtube": {
      "command": "uvx",
      "args": ["youtube-watch-mcp"]
    }
  }
}

CLI only

uvx --from youtube-watch-mcp youtube-watch-mcp-cli info "https://youtu.be/VIDEO_ID"

That's it. uvx pulls youtube-watch-mcp, yt-dlp, and dependencies into an isolated environment automatically. Nothing to install globally.

Optional: ffmpeg on PATH is required only for --asr (speech-to-text on caption-less videos). Core transcript extraction needs nothing.

Optional API key

A YouTube Data API key is not needed to read videos. Add one only to enable cross-YouTube search:

claude mcp add youtube -e YOUTUBE_API_KEY=your_key -- uvx youtube-watch-mcp

Transcript extraction never uses the key (YouTube only allows caption download for video owners).

Tools

Tool Returns Purpose
get_info(url) title, duration, chapters, has_captions Cheap probe before fetching.
get_transcript(url, asr=False) file path + word count + preview Clean transcript to disk. Returns path, not full text.
search_transcript(url, query) timestamped snippets Grep a long video without loading it all.
get_segment(url, start, end) text slice Read one time range.

Design principle: pull, don't dump. Transcripts write to a local cache file; tools return a path and a short preview. The agent reads or searches on demand — long videos never flood the context.

/get_info $url
/get_transcript $url
/search_transcript $url
/get_segment $url

Architecture

Adapters (thin):   cli.py   mcp_server.py   skill
                        │  call
Core (all logic):  fetch → clean → chunk → cache
                        │  uses
Backends:          youtube-transcript-api · yt-dlp · faster-whisper

Fetch fallback chain:

  1. youtube-transcript-api — fastest, no download
  2. yt-dlp auto-captions
  3. yt-dlp manual captions
  4. --asr: audio → local faster-whisper

On yt-dlp failure the engine self-updates yt-dlp and retries once — most breakage is a stale yt-dlp.

Caching: results are keyed by video ID under ~/.cache/youtube-mcp/<id>/. Repeat calls are instant.

Cleaning: auto-captions are de-duplicated (rolling-caption overlap removed), stripped of timestamps and [Music] noise, and whitespace-collapsed before the agent ever sees them.

Requirements

  • Python 3.11+ (managed automatically by uvx)
  • ffmpeg — optional, only for --asr

License

MIT

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

youtube_watch_mcp-0.1.3.tar.gz (1.3 MB view details)

Uploaded Source

Built Distribution

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

youtube_watch_mcp-0.1.3-py3-none-any.whl (13.9 kB view details)

Uploaded Python 3

File details

Details for the file youtube_watch_mcp-0.1.3.tar.gz.

File metadata

  • Download URL: youtube_watch_mcp-0.1.3.tar.gz
  • Upload date:
  • Size: 1.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for youtube_watch_mcp-0.1.3.tar.gz
Algorithm Hash digest
SHA256 2cf8ea984cc5dbe5d9dae099438a3f3061729c6cf6c97341749aff03f667104b
MD5 2379ed67f4bebd5909923b5a37137752
BLAKE2b-256 7316b77737fc6c7393cb3834ea79acc3cd1dfe13ab630251cd3e5c6123637756

See more details on using hashes here.

File details

Details for the file youtube_watch_mcp-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for youtube_watch_mcp-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 72269b6bb4f894d8372d77fa79a87378d53067bd2a0a9e2f7ad6ed99cc960f62
MD5 bd8c421920a86a32ddf96dae8e351f6d
BLAKE2b-256 6e488533adf890b545564fe0525bb136f48dbe6bea6c4a934b4a3701633a8168

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