Skip to main content
Glama

yt-knowledge-mcp

Turn YouTube channels into a searchable knowledge base for AI assistants.

ytk downloads the transcripts of a channel (YouTube subtitles first, Whisper as fallback), indexes them for semantic search and exposes them through an MCP server, so Claude Desktop (or any MCP client) can search them and quote the exact fragment with a timestamped link.

Features

  • Any channel: register channels by URL and keep them in sync.

  • Subtitles first, Whisper as fallback: cheap when captions exist, complete when they do not.

  • Semantic search with ChromaDB and bge-m3 (multilingual), filterable by channel and date.

  • Cited answers: every fragment carries video_id, time range and a youtube.com/watch?v=...&t=...s link.

  • MCP server with three tools: list_channels, search_transcripts, get_transcript_excerpt.

  • Optional ytk ask to answer a question with Claude, citing fragments.

  • Light core: the domain, use cases and CLI have no third-party dependencies. Heavy libraries live behind optional extras and are imported lazily.

Related MCP server: web-summaries-mcp

Install

python -m venv .venv && source .venv/bin/activate
pip install -e ".[youtube,search,mcp]"      # subtitles + search + MCP server
# optional extras: whisper, cuda, llm, all, dev

Quick start

ytk add https://www.youtube.com/@some-channel
ytk update                      # sync transcripts + build the index
ytk search "risk management"    # semantic search from the terminal

ytk update --latest 20 processes only the most recent videos. Run ytk --help for every command: add, remove, channels, sync, index, update, search, ask, excerpt, serve.

Use it from Claude Desktop

Add the server to claude_desktop_config.json:

{
  "mcpServers": {
    "yt-knowledge": {
      "command": "/path/to/yt-knowledge-mcp/.venv/bin/python",
      "args": ["-m", "yt_knowledge", "serve"],
      "env": { "YTK_WORKSPACE": "/path/to/yt-knowledge-mcp/workspace" }
    }
  }
}

Configuration

All settings are optional environment variables. The data directory can also be set with --workspace.

Variable

Purpose

YTK_WORKSPACE

Data directory (default ./workspace)

YTK_SUBTITLE_LANGS

Preferred subtitle languages

YTK_WHISPER_MODEL, YTK_WHISPER_DEVICE, YTK_WHISPER_LANGUAGE

Whisper fallback

YTK_EMBEDDING_MODEL, YTK_EMBEDDING_DEVICE

Embedding model for search

YTK_COOKIES_FROM_BROWSER

Browser to read cookies from, if YouTube asks for them

YTK_LLM_MODEL

Claude model used by ytk ask (needs ANTHROPIC_API_KEY)

Your data stays yours

workspace/ (transcripts, vector index, channel list) is git-ignored. See docs/sharing.md for how to share a knowledge base. Respect YouTube's terms of service and the copyright of the channels you archive.

Development

pip install -e ".[dev,mcp]"
pytest -q && ruff check . && mypy

The architecture is described in docs/architecture.md.

License

MIT, see LICENSE.

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    B
    maintenance
    Local MCP server that indexes public YouTube captions into a searchable SQLite FTS5 database, enabling timestamped search and transcript retrieval without an API key.
    6
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    MCP server for turning YouTube channels into a queryable local knowledge base. Enables BM25 search and extractive Q&A over captions with timestamped citations.
    MIT