youtube-knowledge-mcp 2.0.2 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +166 -33
- package/dist/brain-schemas.d.ts +502 -0
- package/dist/brain-schemas.d.ts.map +1 -0
- package/dist/brain-schemas.js +109 -0
- package/dist/brain-schemas.js.map +1 -0
- package/dist/http/app.d.ts +16 -0
- package/dist/http/app.d.ts.map +1 -0
- package/dist/http/app.js +176 -0
- package/dist/http/app.js.map +1 -0
- package/dist/http/auth.d.ts +38 -0
- package/dist/http/auth.d.ts.map +1 -0
- package/dist/http/auth.js +79 -0
- package/dist/http/auth.js.map +1 -0
- package/dist/http/config.d.ts +41 -0
- package/dist/http/config.d.ts.map +1 -0
- package/dist/http/config.js +65 -0
- package/dist/http/config.js.map +1 -0
- package/dist/http/rate-limiter.d.ts +24 -0
- package/dist/http/rate-limiter.d.ts.map +1 -0
- package/dist/http/rate-limiter.js +55 -0
- package/dist/http/rate-limiter.js.map +1 -0
- package/dist/http/sessions.d.ts +34 -0
- package/dist/http/sessions.d.ts.map +1 -0
- package/dist/http/sessions.js +62 -0
- package/dist/http/sessions.js.map +1 -0
- package/dist/http.d.ts +6 -48
- package/dist/http.d.ts.map +1 -1
- package/dist/http.js +35 -252
- package/dist/http.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -431
- package/dist/index.js.map +1 -1
- package/dist/prompts-brain.d.ts +4 -0
- package/dist/prompts-brain.d.ts.map +1 -0
- package/dist/prompts-brain.js +48 -0
- package/dist/prompts-brain.js.map +1 -0
- package/dist/prompts-research.d.ts +4 -0
- package/dist/prompts-research.d.ts.map +1 -0
- package/dist/prompts-research.js +74 -0
- package/dist/prompts-research.js.map +1 -0
- package/dist/prompts-shared.d.ts +13 -0
- package/dist/prompts-shared.d.ts.map +1 -0
- package/dist/prompts-shared.js +7 -0
- package/dist/prompts-shared.js.map +1 -0
- package/dist/prompts.d.ts.map +1 -1
- package/dist/prompts.js +5 -58
- package/dist/prompts.js.map +1 -1
- package/dist/registry/brain-tools.d.ts +4 -0
- package/dist/registry/brain-tools.d.ts.map +1 -0
- package/dist/registry/brain-tools.js +104 -0
- package/dist/registry/brain-tools.js.map +1 -0
- package/dist/registry/channel-tools.d.ts +4 -0
- package/dist/registry/channel-tools.d.ts.map +1 -0
- package/dist/registry/channel-tools.js +53 -0
- package/dist/registry/channel-tools.js.map +1 -0
- package/dist/registry/health-tools.d.ts +4 -0
- package/dist/registry/health-tools.d.ts.map +1 -0
- package/dist/registry/health-tools.js +21 -0
- package/dist/registry/health-tools.js.map +1 -0
- package/dist/registry/index.d.ts +8 -0
- package/dist/registry/index.d.ts.map +1 -0
- package/dist/registry/index.js +27 -0
- package/dist/registry/index.js.map +1 -0
- package/dist/registry/library-tools.d.ts +4 -0
- package/dist/registry/library-tools.d.ts.map +1 -0
- package/dist/registry/library-tools.js +116 -0
- package/dist/registry/library-tools.js.map +1 -0
- package/dist/registry/media-tools.d.ts +4 -0
- package/dist/registry/media-tools.d.ts.map +1 -0
- package/dist/registry/media-tools.js +100 -0
- package/dist/registry/media-tools.js.map +1 -0
- package/dist/registry/thumbnail-tools.d.ts +7 -0
- package/dist/registry/thumbnail-tools.d.ts.map +1 -0
- package/dist/registry/thumbnail-tools.js +72 -0
- package/dist/registry/thumbnail-tools.js.map +1 -0
- package/dist/registry/transcript-tools.d.ts +4 -0
- package/dist/registry/transcript-tools.d.ts.map +1 -0
- package/dist/registry/transcript-tools.js +68 -0
- package/dist/registry/transcript-tools.js.map +1 -0
- package/dist/registry/types.d.ts +41 -0
- package/dist/registry/types.d.ts.map +1 -0
- package/dist/registry/types.js +17 -0
- package/dist/registry/types.js.map +1 -0
- package/dist/registry/video-tools.d.ts +4 -0
- package/dist/registry/video-tools.d.ts.map +1 -0
- package/dist/registry/video-tools.js +101 -0
- package/dist/registry/video-tools.js.map +1 -0
- package/dist/resources.d.ts.map +1 -1
- package/dist/resources.js +75 -6
- package/dist/resources.js.map +1 -1
- package/dist/schemas.d.ts +74 -54
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +30 -4
- package/dist/schemas.js.map +1 -1
- package/dist/thumbnail-resource.d.ts +8 -0
- package/dist/thumbnail-resource.d.ts.map +1 -0
- package/dist/thumbnail-resource.js +38 -0
- package/dist/thumbnail-resource.js.map +1 -0
- package/dist/thumbnail-schemas.d.ts +512 -0
- package/dist/thumbnail-schemas.d.ts.map +1 -0
- package/dist/thumbnail-schemas.js +95 -0
- package/dist/thumbnail-schemas.js.map +1 -0
- package/dist/tools/ask-brain.d.ts +62 -0
- package/dist/tools/ask-brain.d.ts.map +1 -0
- package/dist/tools/ask-brain.js +70 -0
- package/dist/tools/ask-brain.js.map +1 -0
- package/dist/tools/batch.d.ts +10 -10
- package/dist/tools/batch.js +3 -3
- package/dist/tools/batch.js.map +1 -1
- package/dist/tools/brain-info.d.ts +180 -0
- package/dist/tools/brain-info.d.ts.map +1 -0
- package/dist/tools/brain-info.js +108 -0
- package/dist/tools/brain-info.js.map +1 -0
- package/dist/tools/build-brain.d.ts +120 -0
- package/dist/tools/build-brain.d.ts.map +1 -0
- package/dist/tools/build-brain.js +123 -0
- package/dist/tools/build-brain.js.map +1 -0
- package/dist/tools/check-health.d.ts +2 -0
- package/dist/tools/check-health.d.ts.map +1 -1
- package/dist/tools/check-health.js +9 -0
- package/dist/tools/check-health.js.map +1 -1
- package/dist/tools/clips.d.ts +13 -45
- package/dist/tools/clips.d.ts.map +1 -1
- package/dist/tools/clips.js +52 -128
- package/dist/tools/clips.js.map +1 -1
- package/dist/tools/fetch-channel-thumbnails.d.ts +179 -0
- package/dist/tools/fetch-channel-thumbnails.d.ts.map +1 -0
- package/dist/tools/fetch-channel-thumbnails.js +123 -0
- package/dist/tools/fetch-channel-thumbnails.js.map +1 -0
- package/dist/tools/fetch-videos.d.ts +11 -8
- package/dist/tools/fetch-videos.d.ts.map +1 -1
- package/dist/tools/fetch-videos.js +3 -0
- package/dist/tools/fetch-videos.js.map +1 -1
- package/dist/tools/frames-subtitles.d.ts +44 -0
- package/dist/tools/frames-subtitles.d.ts.map +1 -0
- package/dist/tools/frames-subtitles.js +104 -0
- package/dist/tools/frames-subtitles.js.map +1 -0
- package/dist/tools/get-channel-info.d.ts +2 -0
- package/dist/tools/get-channel-info.d.ts.map +1 -1
- package/dist/tools/get-channel-info.js +8 -1
- package/dist/tools/get-channel-info.js.map +1 -1
- package/dist/tools/get-chapters.d.ts +2 -2
- package/dist/tools/get-comments.d.ts +2 -2
- package/dist/tools/get-playlist-info.d.ts.map +1 -1
- package/dist/tools/get-playlist-info.js +1 -0
- package/dist/tools/get-playlist-info.js.map +1 -1
- package/dist/tools/get-thumbnail.d.ts +38 -0
- package/dist/tools/get-thumbnail.d.ts.map +1 -0
- package/dist/tools/get-thumbnail.js +152 -0
- package/dist/tools/get-thumbnail.js.map +1 -0
- package/dist/tools/get-transcript.d.ts +2 -2
- package/dist/tools/get-transcript.d.ts.map +1 -1
- package/dist/tools/get-transcript.js +2 -14
- package/dist/tools/get-transcript.js.map +1 -1
- package/dist/tools/library.d.ts +9 -7
- package/dist/tools/library.d.ts.map +1 -1
- package/dist/tools/library.js +23 -7
- package/dist/tools/library.js.map +1 -1
- package/dist/tools/list-channel-thumbnails.d.ts +235 -0
- package/dist/tools/list-channel-thumbnails.d.ts.map +1 -0
- package/dist/tools/list-channel-thumbnails.js +79 -0
- package/dist/tools/list-channel-thumbnails.js.map +1 -0
- package/dist/tools/list-library.d.ts +4 -4
- package/dist/tools/manage-brain.d.ts +39 -0
- package/dist/tools/manage-brain.d.ts.map +1 -0
- package/dist/tools/manage-brain.js +53 -0
- package/dist/tools/manage-brain.js.map +1 -0
- package/dist/tools/save-to-library.d.ts.map +1 -1
- package/dist/tools/save-to-library.js +5 -1
- package/dist/tools/save-to-library.js.map +1 -1
- package/dist/tools/search-channels.d.ts +10 -4
- package/dist/tools/search-channels.d.ts.map +1 -1
- package/dist/tools/search-transcript.d.ts +2 -2
- package/dist/tools/search-transcript.d.ts.map +1 -1
- package/dist/tools/search-transcript.js +6 -13
- package/dist/tools/search-transcript.js.map +1 -1
- package/dist/tools/search-videos.d.ts +11 -8
- package/dist/tools/search-videos.d.ts.map +1 -1
- package/dist/utils/batches.d.ts +15 -0
- package/dist/utils/batches.d.ts.map +1 -0
- package/dist/utils/batches.js +31 -0
- package/dist/utils/batches.js.map +1 -0
- package/dist/utils/brain-build.d.ts +40 -0
- package/dist/utils/brain-build.d.ts.map +1 -0
- package/dist/utils/brain-build.js +200 -0
- package/dist/utils/brain-build.js.map +1 -0
- package/dist/utils/brain-chunks.d.ts +33 -0
- package/dist/utils/brain-chunks.d.ts.map +1 -0
- package/dist/utils/brain-chunks.js +87 -0
- package/dist/utils/brain-chunks.js.map +1 -0
- package/dist/utils/brain-index.d.ts +27 -0
- package/dist/utils/brain-index.d.ts.map +1 -0
- package/dist/utils/brain-index.js +101 -0
- package/dist/utils/brain-index.js.map +1 -0
- package/dist/utils/brain-ingest.d.ts +57 -0
- package/dist/utils/brain-ingest.d.ts.map +1 -0
- package/dist/utils/brain-ingest.js +127 -0
- package/dist/utils/brain-ingest.js.map +1 -0
- package/dist/utils/brain-lock.d.ts +4 -0
- package/dist/utils/brain-lock.d.ts.map +1 -0
- package/dist/utils/brain-lock.js +17 -0
- package/dist/utils/brain-lock.js.map +1 -0
- package/dist/utils/brain-lookup.d.ts +11 -0
- package/dist/utils/brain-lookup.d.ts.map +1 -0
- package/dist/utils/brain-lookup.js +36 -0
- package/dist/utils/brain-lookup.js.map +1 -0
- package/dist/utils/brain-paths.d.ts +19 -0
- package/dist/utils/brain-paths.d.ts.map +1 -0
- package/dist/utils/brain-paths.js +34 -0
- package/dist/utils/brain-paths.js.map +1 -0
- package/dist/utils/brain-phrases.d.ts +31 -0
- package/dist/utils/brain-phrases.d.ts.map +1 -0
- package/dist/utils/brain-phrases.js +116 -0
- package/dist/utils/brain-phrases.js.map +1 -0
- package/dist/utils/brain-stats.d.ts +25 -0
- package/dist/utils/brain-stats.d.ts.map +1 -0
- package/dist/utils/brain-stats.js +64 -0
- package/dist/utils/brain-stats.js.map +1 -0
- package/dist/utils/brain-storage.d.ts +28 -0
- package/dist/utils/brain-storage.d.ts.map +1 -0
- package/dist/utils/brain-storage.js +87 -0
- package/dist/utils/brain-storage.js.map +1 -0
- package/dist/utils/caption-probe.d.ts +7 -0
- package/dist/utils/caption-probe.d.ts.map +1 -0
- package/dist/utils/caption-probe.js +36 -0
- package/dist/utils/caption-probe.js.map +1 -0
- package/dist/utils/channel-images.d.ts +16 -0
- package/dist/utils/channel-images.d.ts.map +1 -0
- package/dist/utils/channel-images.js +35 -0
- package/dist/utils/channel-images.js.map +1 -0
- package/dist/utils/channel-lookup.d.ts +5 -0
- package/dist/utils/channel-lookup.d.ts.map +1 -0
- package/dist/utils/channel-lookup.js +37 -0
- package/dist/utils/channel-lookup.js.map +1 -0
- package/dist/utils/chapters.d.ts +11 -0
- package/dist/utils/chapters.d.ts.map +1 -0
- package/dist/utils/chapters.js +24 -0
- package/dist/utils/chapters.js.map +1 -0
- package/dist/utils/clips.d.ts.map +1 -1
- package/dist/utils/clips.js +22 -30
- package/dist/utils/clips.js.map +1 -1
- package/dist/utils/env.d.ts +26 -0
- package/dist/utils/env.d.ts.map +1 -0
- package/dist/utils/env.js +72 -0
- package/dist/utils/env.js.map +1 -0
- package/dist/utils/errors.d.ts +1 -1
- package/dist/utils/errors.d.ts.map +1 -1
- package/dist/utils/errors.js +20 -2
- package/dist/utils/errors.js.map +1 -1
- package/dist/utils/file-lock.d.ts +34 -0
- package/dist/utils/file-lock.d.ts.map +1 -0
- package/dist/utils/file-lock.js +91 -0
- package/dist/utils/file-lock.js.map +1 -0
- package/dist/utils/flat-listing.d.ts +89 -0
- package/dist/utils/flat-listing.d.ts.map +1 -0
- package/dist/utils/flat-listing.js +68 -0
- package/dist/utils/flat-listing.js.map +1 -0
- package/dist/utils/format.d.ts +1 -3
- package/dist/utils/format.d.ts.map +1 -1
- package/dist/utils/format.js +1 -5
- package/dist/utils/format.js.map +1 -1
- package/dist/utils/guard.d.ts +21 -0
- package/dist/utils/guard.d.ts.map +1 -0
- package/dist/utils/guard.js +105 -0
- package/dist/utils/guard.js.map +1 -0
- package/dist/utils/image-dimensions.d.ts +19 -0
- package/dist/utils/image-dimensions.d.ts.map +1 -0
- package/dist/utils/image-dimensions.js +93 -0
- package/dist/utils/image-dimensions.js.map +1 -0
- package/dist/utils/image-fetch.d.ts +31 -0
- package/dist/utils/image-fetch.d.ts.map +1 -0
- package/dist/utils/image-fetch.js +141 -0
- package/dist/utils/image-fetch.js.map +1 -0
- package/dist/utils/json-file.d.ts +45 -0
- package/dist/utils/json-file.d.ts.map +1 -0
- package/dist/utils/json-file.js +60 -0
- package/dist/utils/json-file.js.map +1 -0
- package/dist/utils/paths.d.ts +19 -0
- package/dist/utils/paths.d.ts.map +1 -0
- package/dist/utils/paths.js +27 -0
- package/dist/utils/paths.js.map +1 -0
- package/dist/utils/pattern.d.ts +30 -0
- package/dist/utils/pattern.d.ts.map +1 -0
- package/dist/utils/pattern.js +130 -0
- package/dist/utils/pattern.js.map +1 -0
- package/dist/utils/search-index.d.ts +22 -7
- package/dist/utils/search-index.d.ts.map +1 -1
- package/dist/utils/search-index.js +26 -8
- package/dist/utils/search-index.js.map +1 -1
- package/dist/utils/storage.d.ts +14 -44
- package/dist/utils/storage.d.ts.map +1 -1
- package/dist/utils/storage.js +47 -84
- package/dist/utils/storage.js.map +1 -1
- package/dist/utils/subtitles.d.ts +7 -0
- package/dist/utils/subtitles.d.ts.map +1 -0
- package/dist/utils/subtitles.js +30 -0
- package/dist/utils/subtitles.js.map +1 -0
- package/dist/utils/thumbnail-entry.d.ts +19 -0
- package/dist/utils/thumbnail-entry.d.ts.map +1 -0
- package/dist/utils/thumbnail-entry.js +119 -0
- package/dist/utils/thumbnail-entry.js.map +1 -0
- package/dist/utils/thumbnail-fetch.d.ts +37 -0
- package/dist/utils/thumbnail-fetch.d.ts.map +1 -0
- package/dist/utils/thumbnail-fetch.js +89 -0
- package/dist/utils/thumbnail-fetch.js.map +1 -0
- package/dist/utils/thumbnail-ladder.d.ts +44 -0
- package/dist/utils/thumbnail-ladder.d.ts.map +1 -0
- package/dist/utils/thumbnail-ladder.js +68 -0
- package/dist/utils/thumbnail-ladder.js.map +1 -0
- package/dist/utils/thumbnail-listing.d.ts +16 -0
- package/dist/utils/thumbnail-listing.d.ts.map +1 -0
- package/dist/utils/thumbnail-listing.js +26 -0
- package/dist/utils/thumbnail-listing.js.map +1 -0
- package/dist/utils/thumbnail-paths.d.ts +20 -0
- package/dist/utils/thumbnail-paths.d.ts.map +1 -0
- package/dist/utils/thumbnail-paths.js +35 -0
- package/dist/utils/thumbnail-paths.js.map +1 -0
- package/dist/utils/thumbnail-store.d.ts +19 -0
- package/dist/utils/thumbnail-store.d.ts.map +1 -0
- package/dist/utils/thumbnail-store.js +125 -0
- package/dist/utils/thumbnail-store.js.map +1 -0
- package/dist/utils/transcript-cache.d.ts +20 -0
- package/dist/utils/transcript-cache.d.ts.map +1 -0
- package/dist/utils/transcript-cache.js +127 -0
- package/dist/utils/transcript-cache.js.map +1 -0
- package/dist/utils/transcript-search.d.ts +20 -0
- package/dist/utils/transcript-search.d.ts.map +1 -0
- package/dist/utils/transcript-search.js +35 -0
- package/dist/utils/transcript-search.js.map +1 -0
- package/dist/utils/transcript.d.ts +14 -34
- package/dist/utils/transcript.d.ts.map +1 -1
- package/dist/utils/transcript.js +5 -64
- package/dist/utils/transcript.js.map +1 -1
- package/dist/utils/validate-youtube.d.ts +35 -0
- package/dist/utils/validate-youtube.d.ts.map +1 -0
- package/dist/utils/validate-youtube.js +87 -0
- package/dist/utils/validate-youtube.js.map +1 -0
- package/dist/utils/validate.d.ts +11 -3
- package/dist/utils/validate.d.ts.map +1 -1
- package/dist/utils/validate.js +43 -18
- package/dist/utils/validate.js.map +1 -1
- package/dist/utils/version.d.ts +2 -0
- package/dist/utils/version.d.ts.map +1 -0
- package/dist/utils/version.js +19 -0
- package/dist/utils/version.js.map +1 -0
- package/dist/utils/youtube-channel.d.ts +44 -0
- package/dist/utils/youtube-channel.d.ts.map +1 -0
- package/dist/utils/youtube-channel.js +61 -0
- package/dist/utils/youtube-channel.js.map +1 -0
- package/dist/utils/youtube-download.d.ts +27 -0
- package/dist/utils/youtube-download.d.ts.map +1 -0
- package/dist/utils/youtube-download.js +118 -0
- package/dist/utils/youtube-download.js.map +1 -0
- package/dist/utils/youtube-schemas.d.ts +394 -0
- package/dist/utils/youtube-schemas.d.ts.map +1 -0
- package/dist/utils/youtube-schemas.js +118 -0
- package/dist/utils/youtube-schemas.js.map +1 -0
- package/dist/utils/youtube-search.d.ts +14 -0
- package/dist/utils/youtube-search.d.ts.map +1 -0
- package/dist/utils/youtube-search.js +39 -0
- package/dist/utils/youtube-search.js.map +1 -0
- package/dist/utils/youtube-url.d.ts +25 -0
- package/dist/utils/youtube-url.d.ts.map +1 -0
- package/dist/utils/youtube-url.js +75 -0
- package/dist/utils/youtube-url.js.map +1 -0
- package/dist/utils/youtube-video.d.ts +47 -0
- package/dist/utils/youtube-video.d.ts.map +1 -0
- package/dist/utils/youtube-video.js +98 -0
- package/dist/utils/youtube-video.js.map +1 -0
- package/dist/utils/youtube.d.ts +13 -111
- package/dist/utils/youtube.d.ts.map +1 -1
- package/dist/utils/youtube.js +11 -480
- package/dist/utils/youtube.js.map +1 -1
- package/dist/utils/ytdlp-env.d.ts +33 -0
- package/dist/utils/ytdlp-env.d.ts.map +1 -0
- package/dist/utils/ytdlp-env.js +121 -0
- package/dist/utils/ytdlp-env.js.map +1 -0
- package/dist/utils/ytdlp-limiter.d.ts +24 -0
- package/dist/utils/ytdlp-limiter.d.ts.map +1 -0
- package/dist/utils/ytdlp-limiter.js +69 -0
- package/dist/utils/ytdlp-limiter.js.map +1 -0
- package/dist/utils/ytdlp-parse.d.ts +13 -0
- package/dist/utils/ytdlp-parse.d.ts.map +1 -0
- package/dist/utils/ytdlp-parse.js +48 -0
- package/dist/utils/ytdlp-parse.js.map +1 -0
- package/dist/utils/ytdlp.d.ts +13 -18
- package/dist/utils/ytdlp.d.ts.map +1 -1
- package/dist/utils/ytdlp.js +21 -110
- package/dist/utils/ytdlp.js.map +1 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -18,6 +18,7 @@ Supports both **local** (stdio) and **remote** (Streamable HTTP) transports.
|
|
|
18
18
|
- **Search** videos and channels by keyword
|
|
19
19
|
- **Fetch** videos from a playlist or channel
|
|
20
20
|
- **Video, channel and playlist metadata**, chapters, and top comments
|
|
21
|
+
- **Thumbnails**: look at any video's thumbnail or a channel's avatar or banner as an image, or save every thumbnail of a channel to disk
|
|
21
22
|
- **Transcripts with timestamps**, sliced by time range or chapter, and capped so a
|
|
22
23
|
three-hour video cannot flood your context
|
|
23
24
|
- **Search inside a transcript** and get back `?t=` links that open the video at
|
|
@@ -39,6 +40,21 @@ Supports both **local** (stdio) and **remote** (Streamable HTTP) transports.
|
|
|
39
40
|
- **Read them back**, and **search across all of them** with full-text ranking
|
|
40
41
|
- **Tag, retag and delete**
|
|
41
42
|
|
|
43
|
+
**Build a brain for a channel** (local mode)
|
|
44
|
+
|
|
45
|
+
- **Read a whole channel** into a searchable corpus of timestamped passages, in
|
|
46
|
+
any caption language, resumable and safe to interrupt — a second run continues
|
|
47
|
+
where it stopped and picks up new uploads
|
|
48
|
+
- **Ask what a creator has said** about anything, across every video, and get
|
|
49
|
+
back the moments themselves with links that open the video there
|
|
50
|
+
- **Measure the channel**: how much was readable, its upload rhythm, its
|
|
51
|
+
speaking rate, and the phrases it repeats across videos
|
|
52
|
+
- **Keep a written profile** beside the corpus, grounded in passages you can cite
|
|
53
|
+
|
|
54
|
+
**Study a channel's thumbnails** (local mode)
|
|
55
|
+
|
|
56
|
+
- **Save every thumbnail** of a channel, plus its avatar and banner, resumably, at the largest size YouTube serves, with each image's real pixel size recorded
|
|
57
|
+
|
|
42
58
|
**Built to stay working**
|
|
43
59
|
|
|
44
60
|
- WebVTT parsed by the W3C reference implementation, not a hand-written matcher
|
|
@@ -46,7 +62,9 @@ Supports both **local** (stdio) and **remote** (Streamable HTTP) transports.
|
|
|
46
62
|
wall of yt-dlp stderr
|
|
47
63
|
- Timeouts, retry with backoff, and a concurrency limit on every yt-dlp call
|
|
48
64
|
- `check_health` diagnoses missing or outdated yt-dlp and ffmpeg
|
|
65
|
+
- Bearer auth, a loopback default bind, an allowlist on every URL and image host, and typed error codes on every failure
|
|
49
66
|
- Structured output on every tool, plus MCP resources, prompts and completions
|
|
67
|
+
- An end-to-end suite runs the built server against real yt-dlp over both transports every week
|
|
50
68
|
|
|
51
69
|
## Prerequisites
|
|
52
70
|
|
|
@@ -143,7 +161,11 @@ npm run build
|
|
|
143
161
|
npm run start:http
|
|
144
162
|
```
|
|
145
163
|
|
|
146
|
-
The server listens on `PORT` (default 3000).
|
|
164
|
+
The server listens on `127.0.0.1:PORT` (default 3000). To reach it from another
|
|
165
|
+
machine set `MCP_BIND_HOST=0.0.0.0` together with `MCP_AUTH_TOKEN`; the server
|
|
166
|
+
refuses to start exposed and unauthenticated unless you also set
|
|
167
|
+
`MCP_ALLOW_UNAUTHENTICATED=true`. Behind a reverse proxy, set `MCP_TRUST_PROXY`
|
|
168
|
+
to the number of hops and `MCP_PUBLIC_URL` to the address clients use.
|
|
147
169
|
|
|
148
170
|
#### Docker
|
|
149
171
|
|
|
@@ -199,7 +221,7 @@ a cold start. Any paid plan removes that.
|
|
|
199
221
|
|
|
200
222
|
## MCP Tools
|
|
201
223
|
|
|
202
|
-
|
|
224
|
+
37 tools. The 15 read-only ones work over both transports; the 22 that touch
|
|
203
225
|
your filesystem are registered only in local (stdio) mode, so a remote
|
|
204
226
|
deployment cannot reach the host's disk.
|
|
205
227
|
|
|
@@ -209,18 +231,19 @@ available for this video. Call get_transcript again with one of: fr, es, de.`
|
|
|
209
231
|
|
|
210
232
|
### Discovery — remote + local
|
|
211
233
|
|
|
212
|
-
| Tool | Key parameters
|
|
213
|
-
| ------------------- |
|
|
214
|
-
| `search_videos` | `query`, `limit`
|
|
215
|
-
| `search_channels` | `query`, `limit`
|
|
216
|
-
| `fetch_videos` | `url`, `limit`
|
|
217
|
-
| `get_video_info` | `video`
|
|
218
|
-
| `get_channel_info` | `channel`
|
|
219
|
-
| `get_playlist_info` | `url`
|
|
220
|
-
| `get_chapters` | `video`
|
|
221
|
-
| `get_comments` | `video`, `limit`
|
|
222
|
-
| `list_formats` | `video`
|
|
223
|
-
| `
|
|
234
|
+
| Tool | Key parameters | Returns |
|
|
235
|
+
| ------------------- | -------------------------------------- | ----------------------------------------------------------------------------------------- |
|
|
236
|
+
| `search_videos` | `query`, `limit` | Matching videos with durations, channels and view counts |
|
|
237
|
+
| `search_channels` | `query`, `limit` | Matching channels with subscriber counts |
|
|
238
|
+
| `fetch_videos` | `url`, `limit` | Videos in a playlist or channel, with thumbnail URLs |
|
|
239
|
+
| `get_video_info` | `video` | Title, channel, duration, views, likes, description, tags |
|
|
240
|
+
| `get_channel_info` | `channel` | Name, handle, subscriber count, description, avatar and banner |
|
|
241
|
+
| `get_playlist_info` | `url` | Title, channel, video count, last updated |
|
|
242
|
+
| `get_chapters` | `video` | Chapter titles with start/end times and deep links |
|
|
243
|
+
| `get_comments` | `video`, `limit` | Top-level comments by popularity |
|
|
244
|
+
| `list_formats` | `video` | Available formats grouped by video+audio, video-only, audio-only |
|
|
245
|
+
| `get_thumbnail` | `video`, `channel`, `image`, `quality` | A video thumbnail, channel avatar or banner as an image, with its real size |
|
|
246
|
+
| `check_health` | — | yt-dlp and ffmpeg status, versions, staleness warnings, and which session options are set |
|
|
224
247
|
|
|
225
248
|
### Transcripts — remote + local
|
|
226
249
|
|
|
@@ -258,22 +281,76 @@ keyframe-aligned cut. All of these require ffmpeg.
|
|
|
258
281
|
| `save_to_library` | `videoId`, `title`, `content`, `contentType`, `channel`, `tags` | Path to the saved note |
|
|
259
282
|
| `list_library` | `tag` | Saved items, newest first |
|
|
260
283
|
| `get_library_item` | `videoId`, `contentType` | The saved markdown and its metadata |
|
|
261
|
-
| `search_library` | `query`, `limit`
|
|
284
|
+
| `search_library` | `query`, `limit`, `offset` | Ranked matches with excerpts |
|
|
262
285
|
| `update_library_tags` | `videoId`, `add`, `remove`, `replace` | The updated tags |
|
|
263
286
|
| `delete_library_item` | `videoId`, `contentType` | What was deleted |
|
|
264
287
|
| `rebuild_library_index` | — | Number of notes reindexed |
|
|
265
288
|
|
|
289
|
+
### Channel brains — local only
|
|
290
|
+
|
|
291
|
+
| Tool | Key parameters | Returns |
|
|
292
|
+
| -------------------- | ----------------------------------------------------------------- | ------------------------------------------------ |
|
|
293
|
+
| `build_brain` | `channel`, `maxVideos`, `language`, `since`, `minDurationSeconds` | What was read, what was ruled out, and the stats |
|
|
294
|
+
| `ask_brain` | `channel`, `query`, `limit`, `offset` | Passages with timestamps and `?t=` links |
|
|
295
|
+
| `list_brains` | — | Every brain built locally |
|
|
296
|
+
| `get_brain_info` | `channel`, `includeVideos` | Coverage, statistics and repeated phrases |
|
|
297
|
+
| `save_brain_profile` | `channel`, `content` | Path to the saved profile |
|
|
298
|
+
| `delete_brain` | `channel` | What was removed |
|
|
299
|
+
|
|
300
|
+
`build_brain` is the only one that touches the network. The rest resolve a
|
|
301
|
+
channel from what is already on disk, so they work offline and cost nothing to
|
|
302
|
+
call.
|
|
303
|
+
|
|
304
|
+
### Channel thumbnails — local only
|
|
305
|
+
|
|
306
|
+
| Tool | Key parameters | Returns |
|
|
307
|
+
| --------------------------- | -------------------------------------------- | --------------------------------------------------------- |
|
|
308
|
+
| `fetch_channel_thumbnails` | `channel`, `maxVideos`, `tabs`, `quality` | Every thumbnail saved to disk, plus the avatar and banner |
|
|
309
|
+
| `list_channel_thumbnails` | `channel`, `tab`, `state`, `limit`, `offset` | Saved entries with paths and decoded sizes |
|
|
310
|
+
| `delete_channel_thumbnails` | `channel` | What was removed |
|
|
311
|
+
|
|
312
|
+
One yt-dlp listing per tab, then the images from YouTube's image hosts
|
|
313
|
+
directly, so a five-hundred-video channel costs a handful of listings and not
|
|
314
|
+
five hundred extractions. For each video the fetch tries the largest image
|
|
315
|
+
YouTube serves (`maxresdefault`, 1280 wide where it exists) and keeps it only if
|
|
316
|
+
it decodes wider than the image the listing offered; otherwise it keeps the
|
|
317
|
+
listed image, and failing that the small `hqdefault`. Every width and height in
|
|
318
|
+
the manifest was decoded from the saved bytes, never read off a URL. Shorts are
|
|
319
|
+
listed with portrait thumbnails and saved under `shorts/`. The run is resumable:
|
|
320
|
+
interrupt it and call again, and only what is missing or truncated is fetched.
|
|
321
|
+
|
|
322
|
+
A brain holds one caption language; pass `language` to read another, and build a
|
|
323
|
+
separate brain per language.
|
|
324
|
+
|
|
325
|
+
`since` and `minDurationSeconds` describe the brain, not just the call that
|
|
326
|
+
passed them. They are re-applied every time, so narrowing one drops the passages
|
|
327
|
+
of the videos it excludes and widening it reads them back — which is why
|
|
328
|
+
`build_brain` is annotated as destructive. Whether a video qualifies is decided
|
|
329
|
+
from the date and length already recorded, so changing your mind costs no
|
|
330
|
+
requests until there is something new to fetch. Those values come from each
|
|
331
|
+
video's own metadata, never from a guess: a flat channel listing does not carry
|
|
332
|
+
a publication date at all.
|
|
333
|
+
|
|
334
|
+
`build_brain` also repairs. If the passage file is lost or truncated, the videos
|
|
335
|
+
it can no longer account for are read again on the next call rather than being
|
|
336
|
+
skipped forever as already done.
|
|
337
|
+
|
|
266
338
|
## Prompts
|
|
267
339
|
|
|
268
340
|
Reusable workflows your client can invoke directly: `summarize_video`,
|
|
269
341
|
`extract_skill`, `compare_videos`, `research_topic`, `channel_deep_dive`,
|
|
270
|
-
`clip_from_quote` (find a phrase, then cut the clip around it),
|
|
271
|
-
`
|
|
342
|
+
`clip_from_quote` (find a phrase, then cut the clip around it),
|
|
343
|
+
`study_thumbnails` (save a channel's thumbnails, look at a sample, describe
|
|
344
|
+
what recurs), and — local only — `review_library`, `create_brain` (build a
|
|
345
|
+
channel's corpus, then write its profile from it) and `ask_creator` (answer a
|
|
346
|
+
question strictly from a brain, with citations).
|
|
272
347
|
|
|
273
348
|
## Resources
|
|
274
349
|
|
|
275
350
|
- `youtube://transcript/{videoId}` — a timestamped transcript, fetched and cached on first read
|
|
276
351
|
- `youtube://library/{videoId}/{summary|skill}` — a saved note (local only, and enumerable)
|
|
352
|
+
- `youtube://brain/{channelId}/{manifest|profile}` — what a channel brain covers, or the profile written from it (local only, and enumerable)
|
|
353
|
+
- `youtube://thumbnails/{channelId}/manifest` — what `fetch_channel_thumbnails` saved for a channel (local only, and enumerable)
|
|
277
354
|
|
|
278
355
|
## Error codes
|
|
279
356
|
|
|
@@ -289,25 +366,50 @@ them, each prefixed with a code and followed by a next step.
|
|
|
289
366
|
| `RATE_LIMITED`, `TIMEOUT` | Transient; retried automatically with backoff before surfacing |
|
|
290
367
|
| `YTDLP_MISSING`, `FFMPEG_MISSING`, `YTDLP_FAILED` | A tooling problem; the message says how to fix it |
|
|
291
368
|
| `INVALID_INPUT` | A bad argument, caught before any network call |
|
|
369
|
+
| `BOT_CHECK` | YouTube asked this address to sign in; set the cookie settings below |
|
|
370
|
+
| `FETCH_FAILED` | An image could not be downloaded from YouTube's image hosts |
|
|
292
371
|
| `CANCELLED` | The client cancelled the request |
|
|
293
372
|
|
|
294
373
|
## Environment variables
|
|
295
374
|
|
|
296
375
|
All optional.
|
|
297
376
|
|
|
298
|
-
| Variable
|
|
299
|
-
|
|
|
300
|
-
| `MCP_AUTH_TOKEN`
|
|
301
|
-
| `MCP_ALLOWED_HOSTS`
|
|
302
|
-
| `MCP_ALLOWED_ORIGINS`
|
|
303
|
-
| `MCP_BIND_HOST`
|
|
304
|
-
| `
|
|
305
|
-
| `
|
|
306
|
-
| `
|
|
307
|
-
| `
|
|
308
|
-
| `
|
|
309
|
-
| `
|
|
310
|
-
| `
|
|
377
|
+
| Variable | Default | Purpose |
|
|
378
|
+
| ---------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
379
|
+
| `MCP_AUTH_TOKEN` | unset | Require this bearer token on the HTTP transport. **Set this if you expose the server beyond localhost.** |
|
|
380
|
+
| `MCP_ALLOWED_HOSTS` | unset | Comma-separated Host allowlist; enables DNS-rebinding protection |
|
|
381
|
+
| `MCP_ALLOWED_ORIGINS` | unset | Comma-separated Origin allowlist |
|
|
382
|
+
| `MCP_BIND_HOST` | `127.0.0.1` | Interface to bind. The Docker image sets `0.0.0.0`. A non-loopback bind refuses to start without `MCP_AUTH_TOKEN` unless `MCP_ALLOW_UNAUTHENTICATED=true` |
|
|
383
|
+
| `MCP_ALLOW_UNAUTHENTICATED` | `false` | Explicit consent to listen on a network interface with no token |
|
|
384
|
+
| `MCP_TRUST_PROXY` | `false` | `true`, `false`, or the number of reverse-proxy hops whose `X-Forwarded-*` headers to believe. Off, forwarded headers are ignored for rate limiting and URLs |
|
|
385
|
+
| `MCP_PUBLIC_URL` | unset | The URL clients reach the server at; used in the OAuth metadata it publishes instead of the request's Host |
|
|
386
|
+
| `MCP_MAX_BODY_BYTES` | `1048576` | Largest request body accepted |
|
|
387
|
+
| `MCP_MODE` | unset | `http` selects the HTTP transport when no `--http` flag is given |
|
|
388
|
+
| `PORT` | `3000` | HTTP port. The Docker image sets `10000`; Render and similar platforms inject their own |
|
|
389
|
+
| `MCP_RATE_LIMIT` | `60` | Requests per window, per client |
|
|
390
|
+
| `MCP_RATE_WINDOW_MS` | `60000` | Rate-limit window |
|
|
391
|
+
| `MCP_SESSION_IDLE_MS` | `1800000` | Close HTTP sessions idle this long |
|
|
392
|
+
| `MCP_MAX_SESSIONS` | `1000` | Reject new sessions past this many |
|
|
393
|
+
| `YOUTUBE_MCP_MAX_CONCURRENCY` | `3` | Concurrent yt-dlp processes |
|
|
394
|
+
| `YOUTUBE_MCP_TRANSCRIPT_TTL_MS` | 30 days | Transcript cache lifetime |
|
|
395
|
+
| `YOUTUBE_MCP_COOKIES_FROM_BROWSER` | unset | Browser whose cookies yt-dlp should read: `brave`, `chrome`, `chromium`, `edge`, `firefox`, `opera`, `safari`, `vivaldi` or `whale`. See Signed-in content |
|
|
396
|
+
| `YOUTUBE_MCP_COOKIES_FILE` | unset | A Netscape-format cookies file inside your home directory, as an alternative to a browser |
|
|
397
|
+
| `YOUTUBE_MCP_PROXY` | unset | An `http`, `https`, `socks4` or `socks5` proxy URL for yt-dlp |
|
|
398
|
+
| `YOUTUBE_MCP_SLEEP_REQUESTS_S` | unset | Seconds yt-dlp sleeps between its own requests, to stay under YouTube's limits |
|
|
399
|
+
|
|
400
|
+
### Signed-in content
|
|
401
|
+
|
|
402
|
+
Some videos need a signed-in session — age-restricted, members-only, private
|
|
403
|
+
ones you have access to — and YouTube sometimes asks an address to prove it is
|
|
404
|
+
not a bot before serving any video at all. Those failures arrive as
|
|
405
|
+
`LOGIN_REQUIRED`, `AGE_GATED` or `BOT_CHECK`, and each names the fix: set
|
|
406
|
+
`YOUTUBE_MCP_COOKIES_FROM_BROWSER` to a browser you are signed in with, or
|
|
407
|
+
`YOUTUBE_MCP_COOKIES_FILE` to a cookies file, and restart the server.
|
|
408
|
+
|
|
409
|
+
Cookies are your account. Use them in local (stdio) mode, keep a cookies file
|
|
410
|
+
readable by you alone, and know that content read this way may be personal.
|
|
411
|
+
The server validates both settings at boot, never logs the file's path or
|
|
412
|
+
contents, and never surfaces yt-dlp's output.
|
|
311
413
|
|
|
312
414
|
## Library Storage
|
|
313
415
|
|
|
@@ -322,6 +424,18 @@ Content is stored in `~/.youtube-knowledge/`:
|
|
|
322
424
|
│ ├── metadata.json
|
|
323
425
|
│ ├── summary.md
|
|
324
426
|
│ └── skill.md
|
|
427
|
+
├── brains/ # Channel brains
|
|
428
|
+
│ └── {channel_id}/
|
|
429
|
+
│ ├── manifest.json # What the brain covers, and where a build stopped
|
|
430
|
+
│ ├── chunks.json # The timestamped passages
|
|
431
|
+
│ └── profile.md # The written account, if one was saved
|
|
432
|
+
├── thumbnails/ # Saved channel thumbnails
|
|
433
|
+
│ └── {channel_id}/
|
|
434
|
+
│ ├── manifest.json # Every image, its decoded size, where it is
|
|
435
|
+
│ ├── channel/ # avatar.* and banner.*
|
|
436
|
+
│ ├── videos/ # {video_id}.jpg (or .png / .webp)
|
|
437
|
+
│ ├── shorts/
|
|
438
|
+
│ └── streams/
|
|
325
439
|
├── downloads/ # Full downloads
|
|
326
440
|
├── clips/ # Extracted clips
|
|
327
441
|
├── frames/ # Captured stills
|
|
@@ -394,6 +508,18 @@ editor can import.
|
|
|
394
508
|
`save_to_library` stores it; `search_library` searches across everything saved
|
|
395
509
|
with full-text ranking.
|
|
396
510
|
|
|
511
|
+
### Build a brain for a creator
|
|
512
|
+
|
|
513
|
+
```
|
|
514
|
+
"Build a brain for @Fireship, then tell me everything they've said about Rust"
|
|
515
|
+
```
|
|
516
|
+
|
|
517
|
+
`build_brain` reads the channel into timestamped passages — interrupt it and
|
|
518
|
+
call it again to continue. `ask_brain` then answers from what was actually
|
|
519
|
+
said, returning the moments themselves so every claim can be checked against
|
|
520
|
+
the video. Run `build_brain` again a month later and it reads only the new
|
|
521
|
+
uploads.
|
|
522
|
+
|
|
397
523
|
## Testing
|
|
398
524
|
|
|
399
525
|
```bash
|
|
@@ -407,6 +533,11 @@ client over an in-memory transport, exercises the library against a real
|
|
|
407
533
|
temporary filesystem, and snapshots the tool manifest so any change to the
|
|
408
534
|
public surface shows up as a reviewable diff.
|
|
409
535
|
|
|
536
|
+
An end-to-end lane (`E2E=1 npm run test:e2e`) drives the built server through
|
|
537
|
+
real MCP clients over both transports against real yt-dlp and the real network,
|
|
538
|
+
in an isolated temporary home. It runs weekly in CI and on every release before
|
|
539
|
+
anything is published; see CONTRIBUTING.md.
|
|
540
|
+
|
|
410
541
|
## Development
|
|
411
542
|
|
|
412
543
|
```bash
|
|
@@ -428,9 +559,11 @@ project layout, coding standards, and how to add a tool.
|
|
|
428
559
|
|
|
429
560
|
## Security
|
|
430
561
|
|
|
431
|
-
The HTTP transport
|
|
432
|
-
|
|
433
|
-
|
|
562
|
+
The HTTP transport binds loopback and refuses to listen on a network interface
|
|
563
|
+
without `MCP_AUTH_TOKEN`. Caller-supplied URLs must be on a YouTube host before
|
|
564
|
+
anything is handed to yt-dlp, every yt-dlp target follows a `--` terminator, and
|
|
565
|
+
ids are validated before they become paths. See [SECURITY.md](SECURITY.md) for
|
|
566
|
+
the deployment checklist and how to report a vulnerability.
|
|
434
567
|
|
|
435
568
|
## License
|
|
436
569
|
|