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: MCP Codebase RAG Server

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.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Local-first RAG indexing and semantic search MCP server. Enables document retrieval and context-aware queries using local embedding models.
      3
      8 npm
      MIT
    • F
      license
      Not graded
      quality
      B
      maintenance
      MCP server that indexes local Claude Code transcripts and provides keyword, phrase, semantic, and date-range search, plus full context/session recall.
      -
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables searching and reading local Cursor, Claude Code, and Codex session transcripts from any MCP client, with fuzzy, regex, and full-text search, plus optional semantic search.
      14
      MIT