Are you the author? Sign in to claim
YouTube transcript aggregation, summarization, and digest system with MCP server for AI agents.
Glean transcripts from YouTube channels, store them in SQLite, summarize via LLM, and expose the data as an MCP server.
pip install yt-dlpbrew install --cask Crymfox/tap/ytglean
scoop bucket add crymfox https://github.com/Crymfox/scoop-bucket
scoop install ytglean
# Using yay
yay -S ytglean-bin
# Using paru
paru -S ytglean-bin
go install github.com/CrymfoxLabs/YTGlean@latest
git clone https://github.com/CrymfoxLabs/YTGlean.git
cd YTGlean
go build -o ytglean .
YTGlean runs as an MCP server, giving AI coding agents full access to YouTube transcript data. Add it to your agent's config:
Edit ~/.config/claude/claude_desktop_config.json (Linux) or ~/Library/Application Support/Claude/claude_desktop_config.json (macOS):
{
"mcpServers": {
"ytglean": {
"command": "ytglean",
"args": ["serve"]
}
}
}
claude mcp add ytglean -- ytglean serve
Create .cursor/mcp.json in your project root:
{
"mcpServers": {
"ytglean": {
"command": "ytglean",
"args": ["serve"]
}
}
}
Edit MCP settings (VS Code: Cline panel → MCP Servers → Configure MCP Servers):
{
"mcpServers": {
"ytglean": {
"command": "ytglean",
"args": ["serve"],
"disabled": false,
"autoApprove": []
}
}
}
Add to opencode.json in your project root:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"ytglean": {
"type": "local",
"command": ["ytglean", "serve"],
"enabled": true
}
}
}
Tip: Add
"args": ["serve", "--watch"]to also run the background fetch loop inside the server process.
## Quick Start
On first run, YTGlean auto-generates a config file at `~/.config/ytglean/config.yaml`.
Edit it to set your API key and preferred settings.
```bash
# 1. Add a channel (name is auto-extracted from YouTube)
./ytglean channel add @Fireship
# 2. Fetch transcripts
./ytglean fetch
# 3. Summarize
./ytglean summarize
# 4. Search transcripts via MCP server
./ytglean serve
On first run, YTGlean creates ~/.config/ytglean/config.yaml with sensible defaults. Edit this file to customize settings.
Config is loaded from (in order of priority):
--config flag~/.config/ytglean/config.yaml./config.yamldatabase:
path: ~/.local/share/ytglean/ytglean.db
retention_days: 30
transcript:
provider: auto # auto | innertube | ytdlp
languages: [en] # tried in order, first available wins
max_concurrent: 3
fetch_delay: 2s # delay between requests to avoid rate limiting
fetch:
max_retries: 5 # attempts before a job is dead-lettered
base_retry_delay: 30s # doubles each retry (30s, 1m, 2m, 4m, 8m)
watch:
fetch_interval: 30m # how often watch mode checks for new videos
auto_summarize: false
summarize_threshold: 5 # min new transcripts before auto-summarize
summarize_channel: "" # optional channel filter for auto-digests
summarizer:
endpoint: https://api.openai.com/v1
api_key: your-api-key-here
model: gpt-4o-mini
max_tokens: 2048
mcp:
transport: stdio # stdio | http
port: 8080
ytglean channel add <url-or-id> # Name auto-extracted from YouTube
ytglean channel add @Fireship --name "Fire" # Override display name
ytglean channel remove <url-or-id-or-name> # Remove by URL, ID, or name
ytglean channel list [--json]
Channel inputs accept:
@Fireshiphttps://www.youtube.com/@FireshipUCsBjURrPoezykLs9EqgamOAFireshipytglean fetch # All channels, last 24h
ytglean fetch --channel <id> # Specific channel
ytglean fetch --since 7d # Last 7 days
ytglean fetch --all # All videos in feed
ytglean fetch --dry-run # Preview without fetching
Fetches are backed by a durable job queue: transient failures are retried with exponential backoff on subsequent runs, and jobs that keep failing are dead-lettered. Videos with no transcript available are remembered so they aren't re-attempted every run.
ytglean queue list # Show queued/failed/dead jobs
ytglean queue list --state failed # Filter by state
ytglean queue retry --id 42 # Reset a job with a fresh retry budget
ytglean queue retry-all # Make all failed jobs retry now
ytglean queue clear-dead # Remove dead and no-transcript jobs
ytglean watch # Fetch every 30m (config: watch.fetch_interval)
ytglean watch --fetch-interval 15m # Custom interval
ytglean watch --auto-summarize # Digest after enough new transcripts
ytglean watch --auto-summarize --summarize-threshold 10
ytglean watch --channel <id> # Watch a single channel
Runs until interrupted (SIGINT/SIGTERM); shuts down gracefully, releasing any in-flight queue claims.
ytglean summarize # Summarize transcripts from last 24h
ytglean summarize --since 7d # Last 7 days
ytglean summarize --channel <id> # Filter to specific channel
ytglean summarize --video <id> # Summarize a specific video
ytglean summarize --re-summarize # Force re-summarize even if videos unchanged
ytglean summarize --prompt "Custom..." # Custom system prompt
Skips automatically if the same set of videos was already summarized (compare with --re-summarize to force).
ytglean digests list # List all stored digests
ytglean digests list --json # Output as JSON
ytglean digests export <id> # Export digest to markdown (digest-<id>.md)
ytglean digests export <id> -o summary.md # Export to custom file
ytglean prune # Use config retention (default 30d)
ytglean prune --older-than 60d # Override retention period
ytglean prune --dry-run # Preview what would be deleted
ytglean prune --vacuum # Compact DB after pruning
ytglean serve # stdio (default, for Claude Desktop / Cursor)
ytglean serve --transport http # HTTP transport
ytglean serve --port 8080 # Custom port
ytglean serve --watch # Also run the watch loop in-process
MCP tools available:
| Tool | Description |
|---|---|
list_channels | List all tracked channels |
add_channel | Add a YouTube channel by handle, URL, or ID (name auto-resolved) |
remove_channel | Remove a tracked channel by ID or name |
search_transcripts | Full-text search (FTS5, bm25-ranked, term* prefix matching) with video titles, channel names, word-bounded excerpts |
get_transcript | Get full transcript (supports language, max_chars, timestamped format) |
get_video_info | Video metadata without full transcript (title, channel, word count) |
get_recent_videos | List recent videos from tracked channels |
list_videos | Browse all stored videos with transcript status |
fetch_new | Fetch new transcripts from YouTube (durable queue, rate-limited, retries, dry-run preview) |
list_digests | List stored summaries with metadata |
get_digest | Read a specific digest's full text |
summarize | Summarize via LLM (requires API key) or guide agent to self-summarize |
queue_list | Inspect fetch queue jobs (filter by state, see errors and retry info) |
queue_retry | Reset a specific failed job with a fresh retry budget |
queue_retry_all | Make all failed jobs immediately eligible for retry |
| Flag | Description |
|---|---|
--db <path> | Override database path |
--log-level <level> | debug, info, warn, error |
--quiet | Suppress non-error output |
MIT
Run Claude Code as an MCP server so any agent can delegate coding tasks to it
Browser automation using accessibility snapshots instead of screenshots
Google's universal MCP server supporting PostgreSQL, MySQL, MongoDB, Redis, and 10+ databases
Official GitHub integration for repos, issues, PRs, and CI/CD workflows