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.
Files changed (390) hide show
  1. package/README.md +166 -33
  2. package/dist/brain-schemas.d.ts +502 -0
  3. package/dist/brain-schemas.d.ts.map +1 -0
  4. package/dist/brain-schemas.js +109 -0
  5. package/dist/brain-schemas.js.map +1 -0
  6. package/dist/http/app.d.ts +16 -0
  7. package/dist/http/app.d.ts.map +1 -0
  8. package/dist/http/app.js +176 -0
  9. package/dist/http/app.js.map +1 -0
  10. package/dist/http/auth.d.ts +38 -0
  11. package/dist/http/auth.d.ts.map +1 -0
  12. package/dist/http/auth.js +79 -0
  13. package/dist/http/auth.js.map +1 -0
  14. package/dist/http/config.d.ts +41 -0
  15. package/dist/http/config.d.ts.map +1 -0
  16. package/dist/http/config.js +65 -0
  17. package/dist/http/config.js.map +1 -0
  18. package/dist/http/rate-limiter.d.ts +24 -0
  19. package/dist/http/rate-limiter.d.ts.map +1 -0
  20. package/dist/http/rate-limiter.js +55 -0
  21. package/dist/http/rate-limiter.js.map +1 -0
  22. package/dist/http/sessions.d.ts +34 -0
  23. package/dist/http/sessions.d.ts.map +1 -0
  24. package/dist/http/sessions.js +62 -0
  25. package/dist/http/sessions.js.map +1 -0
  26. package/dist/http.d.ts +6 -48
  27. package/dist/http.d.ts.map +1 -1
  28. package/dist/http.js +35 -252
  29. package/dist/http.js.map +1 -1
  30. package/dist/index.d.ts.map +1 -1
  31. package/dist/index.js +11 -431
  32. package/dist/index.js.map +1 -1
  33. package/dist/prompts-brain.d.ts +4 -0
  34. package/dist/prompts-brain.d.ts.map +1 -0
  35. package/dist/prompts-brain.js +48 -0
  36. package/dist/prompts-brain.js.map +1 -0
  37. package/dist/prompts-research.d.ts +4 -0
  38. package/dist/prompts-research.d.ts.map +1 -0
  39. package/dist/prompts-research.js +74 -0
  40. package/dist/prompts-research.js.map +1 -0
  41. package/dist/prompts-shared.d.ts +13 -0
  42. package/dist/prompts-shared.d.ts.map +1 -0
  43. package/dist/prompts-shared.js +7 -0
  44. package/dist/prompts-shared.js.map +1 -0
  45. package/dist/prompts.d.ts.map +1 -1
  46. package/dist/prompts.js +5 -58
  47. package/dist/prompts.js.map +1 -1
  48. package/dist/registry/brain-tools.d.ts +4 -0
  49. package/dist/registry/brain-tools.d.ts.map +1 -0
  50. package/dist/registry/brain-tools.js +104 -0
  51. package/dist/registry/brain-tools.js.map +1 -0
  52. package/dist/registry/channel-tools.d.ts +4 -0
  53. package/dist/registry/channel-tools.d.ts.map +1 -0
  54. package/dist/registry/channel-tools.js +53 -0
  55. package/dist/registry/channel-tools.js.map +1 -0
  56. package/dist/registry/health-tools.d.ts +4 -0
  57. package/dist/registry/health-tools.d.ts.map +1 -0
  58. package/dist/registry/health-tools.js +21 -0
  59. package/dist/registry/health-tools.js.map +1 -0
  60. package/dist/registry/index.d.ts +8 -0
  61. package/dist/registry/index.d.ts.map +1 -0
  62. package/dist/registry/index.js +27 -0
  63. package/dist/registry/index.js.map +1 -0
  64. package/dist/registry/library-tools.d.ts +4 -0
  65. package/dist/registry/library-tools.d.ts.map +1 -0
  66. package/dist/registry/library-tools.js +116 -0
  67. package/dist/registry/library-tools.js.map +1 -0
  68. package/dist/registry/media-tools.d.ts +4 -0
  69. package/dist/registry/media-tools.d.ts.map +1 -0
  70. package/dist/registry/media-tools.js +100 -0
  71. package/dist/registry/media-tools.js.map +1 -0
  72. package/dist/registry/thumbnail-tools.d.ts +7 -0
  73. package/dist/registry/thumbnail-tools.d.ts.map +1 -0
  74. package/dist/registry/thumbnail-tools.js +72 -0
  75. package/dist/registry/thumbnail-tools.js.map +1 -0
  76. package/dist/registry/transcript-tools.d.ts +4 -0
  77. package/dist/registry/transcript-tools.d.ts.map +1 -0
  78. package/dist/registry/transcript-tools.js +68 -0
  79. package/dist/registry/transcript-tools.js.map +1 -0
  80. package/dist/registry/types.d.ts +41 -0
  81. package/dist/registry/types.d.ts.map +1 -0
  82. package/dist/registry/types.js +17 -0
  83. package/dist/registry/types.js.map +1 -0
  84. package/dist/registry/video-tools.d.ts +4 -0
  85. package/dist/registry/video-tools.d.ts.map +1 -0
  86. package/dist/registry/video-tools.js +101 -0
  87. package/dist/registry/video-tools.js.map +1 -0
  88. package/dist/resources.d.ts.map +1 -1
  89. package/dist/resources.js +75 -6
  90. package/dist/resources.js.map +1 -1
  91. package/dist/schemas.d.ts +74 -54
  92. package/dist/schemas.d.ts.map +1 -1
  93. package/dist/schemas.js +30 -4
  94. package/dist/schemas.js.map +1 -1
  95. package/dist/thumbnail-resource.d.ts +8 -0
  96. package/dist/thumbnail-resource.d.ts.map +1 -0
  97. package/dist/thumbnail-resource.js +38 -0
  98. package/dist/thumbnail-resource.js.map +1 -0
  99. package/dist/thumbnail-schemas.d.ts +512 -0
  100. package/dist/thumbnail-schemas.d.ts.map +1 -0
  101. package/dist/thumbnail-schemas.js +95 -0
  102. package/dist/thumbnail-schemas.js.map +1 -0
  103. package/dist/tools/ask-brain.d.ts +62 -0
  104. package/dist/tools/ask-brain.d.ts.map +1 -0
  105. package/dist/tools/ask-brain.js +70 -0
  106. package/dist/tools/ask-brain.js.map +1 -0
  107. package/dist/tools/batch.d.ts +10 -10
  108. package/dist/tools/batch.js +3 -3
  109. package/dist/tools/batch.js.map +1 -1
  110. package/dist/tools/brain-info.d.ts +180 -0
  111. package/dist/tools/brain-info.d.ts.map +1 -0
  112. package/dist/tools/brain-info.js +108 -0
  113. package/dist/tools/brain-info.js.map +1 -0
  114. package/dist/tools/build-brain.d.ts +120 -0
  115. package/dist/tools/build-brain.d.ts.map +1 -0
  116. package/dist/tools/build-brain.js +123 -0
  117. package/dist/tools/build-brain.js.map +1 -0
  118. package/dist/tools/check-health.d.ts +2 -0
  119. package/dist/tools/check-health.d.ts.map +1 -1
  120. package/dist/tools/check-health.js +9 -0
  121. package/dist/tools/check-health.js.map +1 -1
  122. package/dist/tools/clips.d.ts +13 -45
  123. package/dist/tools/clips.d.ts.map +1 -1
  124. package/dist/tools/clips.js +52 -128
  125. package/dist/tools/clips.js.map +1 -1
  126. package/dist/tools/fetch-channel-thumbnails.d.ts +179 -0
  127. package/dist/tools/fetch-channel-thumbnails.d.ts.map +1 -0
  128. package/dist/tools/fetch-channel-thumbnails.js +123 -0
  129. package/dist/tools/fetch-channel-thumbnails.js.map +1 -0
  130. package/dist/tools/fetch-videos.d.ts +11 -8
  131. package/dist/tools/fetch-videos.d.ts.map +1 -1
  132. package/dist/tools/fetch-videos.js +3 -0
  133. package/dist/tools/fetch-videos.js.map +1 -1
  134. package/dist/tools/frames-subtitles.d.ts +44 -0
  135. package/dist/tools/frames-subtitles.d.ts.map +1 -0
  136. package/dist/tools/frames-subtitles.js +104 -0
  137. package/dist/tools/frames-subtitles.js.map +1 -0
  138. package/dist/tools/get-channel-info.d.ts +2 -0
  139. package/dist/tools/get-channel-info.d.ts.map +1 -1
  140. package/dist/tools/get-channel-info.js +8 -1
  141. package/dist/tools/get-channel-info.js.map +1 -1
  142. package/dist/tools/get-chapters.d.ts +2 -2
  143. package/dist/tools/get-comments.d.ts +2 -2
  144. package/dist/tools/get-playlist-info.d.ts.map +1 -1
  145. package/dist/tools/get-playlist-info.js +1 -0
  146. package/dist/tools/get-playlist-info.js.map +1 -1
  147. package/dist/tools/get-thumbnail.d.ts +38 -0
  148. package/dist/tools/get-thumbnail.d.ts.map +1 -0
  149. package/dist/tools/get-thumbnail.js +152 -0
  150. package/dist/tools/get-thumbnail.js.map +1 -0
  151. package/dist/tools/get-transcript.d.ts +2 -2
  152. package/dist/tools/get-transcript.d.ts.map +1 -1
  153. package/dist/tools/get-transcript.js +2 -14
  154. package/dist/tools/get-transcript.js.map +1 -1
  155. package/dist/tools/library.d.ts +9 -7
  156. package/dist/tools/library.d.ts.map +1 -1
  157. package/dist/tools/library.js +23 -7
  158. package/dist/tools/library.js.map +1 -1
  159. package/dist/tools/list-channel-thumbnails.d.ts +235 -0
  160. package/dist/tools/list-channel-thumbnails.d.ts.map +1 -0
  161. package/dist/tools/list-channel-thumbnails.js +79 -0
  162. package/dist/tools/list-channel-thumbnails.js.map +1 -0
  163. package/dist/tools/list-library.d.ts +4 -4
  164. package/dist/tools/manage-brain.d.ts +39 -0
  165. package/dist/tools/manage-brain.d.ts.map +1 -0
  166. package/dist/tools/manage-brain.js +53 -0
  167. package/dist/tools/manage-brain.js.map +1 -0
  168. package/dist/tools/save-to-library.d.ts.map +1 -1
  169. package/dist/tools/save-to-library.js +5 -1
  170. package/dist/tools/save-to-library.js.map +1 -1
  171. package/dist/tools/search-channels.d.ts +10 -4
  172. package/dist/tools/search-channels.d.ts.map +1 -1
  173. package/dist/tools/search-transcript.d.ts +2 -2
  174. package/dist/tools/search-transcript.d.ts.map +1 -1
  175. package/dist/tools/search-transcript.js +6 -13
  176. package/dist/tools/search-transcript.js.map +1 -1
  177. package/dist/tools/search-videos.d.ts +11 -8
  178. package/dist/tools/search-videos.d.ts.map +1 -1
  179. package/dist/utils/batches.d.ts +15 -0
  180. package/dist/utils/batches.d.ts.map +1 -0
  181. package/dist/utils/batches.js +31 -0
  182. package/dist/utils/batches.js.map +1 -0
  183. package/dist/utils/brain-build.d.ts +40 -0
  184. package/dist/utils/brain-build.d.ts.map +1 -0
  185. package/dist/utils/brain-build.js +200 -0
  186. package/dist/utils/brain-build.js.map +1 -0
  187. package/dist/utils/brain-chunks.d.ts +33 -0
  188. package/dist/utils/brain-chunks.d.ts.map +1 -0
  189. package/dist/utils/brain-chunks.js +87 -0
  190. package/dist/utils/brain-chunks.js.map +1 -0
  191. package/dist/utils/brain-index.d.ts +27 -0
  192. package/dist/utils/brain-index.d.ts.map +1 -0
  193. package/dist/utils/brain-index.js +101 -0
  194. package/dist/utils/brain-index.js.map +1 -0
  195. package/dist/utils/brain-ingest.d.ts +57 -0
  196. package/dist/utils/brain-ingest.d.ts.map +1 -0
  197. package/dist/utils/brain-ingest.js +127 -0
  198. package/dist/utils/brain-ingest.js.map +1 -0
  199. package/dist/utils/brain-lock.d.ts +4 -0
  200. package/dist/utils/brain-lock.d.ts.map +1 -0
  201. package/dist/utils/brain-lock.js +17 -0
  202. package/dist/utils/brain-lock.js.map +1 -0
  203. package/dist/utils/brain-lookup.d.ts +11 -0
  204. package/dist/utils/brain-lookup.d.ts.map +1 -0
  205. package/dist/utils/brain-lookup.js +36 -0
  206. package/dist/utils/brain-lookup.js.map +1 -0
  207. package/dist/utils/brain-paths.d.ts +19 -0
  208. package/dist/utils/brain-paths.d.ts.map +1 -0
  209. package/dist/utils/brain-paths.js +34 -0
  210. package/dist/utils/brain-paths.js.map +1 -0
  211. package/dist/utils/brain-phrases.d.ts +31 -0
  212. package/dist/utils/brain-phrases.d.ts.map +1 -0
  213. package/dist/utils/brain-phrases.js +116 -0
  214. package/dist/utils/brain-phrases.js.map +1 -0
  215. package/dist/utils/brain-stats.d.ts +25 -0
  216. package/dist/utils/brain-stats.d.ts.map +1 -0
  217. package/dist/utils/brain-stats.js +64 -0
  218. package/dist/utils/brain-stats.js.map +1 -0
  219. package/dist/utils/brain-storage.d.ts +28 -0
  220. package/dist/utils/brain-storage.d.ts.map +1 -0
  221. package/dist/utils/brain-storage.js +87 -0
  222. package/dist/utils/brain-storage.js.map +1 -0
  223. package/dist/utils/caption-probe.d.ts +7 -0
  224. package/dist/utils/caption-probe.d.ts.map +1 -0
  225. package/dist/utils/caption-probe.js +36 -0
  226. package/dist/utils/caption-probe.js.map +1 -0
  227. package/dist/utils/channel-images.d.ts +16 -0
  228. package/dist/utils/channel-images.d.ts.map +1 -0
  229. package/dist/utils/channel-images.js +35 -0
  230. package/dist/utils/channel-images.js.map +1 -0
  231. package/dist/utils/channel-lookup.d.ts +5 -0
  232. package/dist/utils/channel-lookup.d.ts.map +1 -0
  233. package/dist/utils/channel-lookup.js +37 -0
  234. package/dist/utils/channel-lookup.js.map +1 -0
  235. package/dist/utils/chapters.d.ts +11 -0
  236. package/dist/utils/chapters.d.ts.map +1 -0
  237. package/dist/utils/chapters.js +24 -0
  238. package/dist/utils/chapters.js.map +1 -0
  239. package/dist/utils/clips.d.ts.map +1 -1
  240. package/dist/utils/clips.js +22 -30
  241. package/dist/utils/clips.js.map +1 -1
  242. package/dist/utils/env.d.ts +26 -0
  243. package/dist/utils/env.d.ts.map +1 -0
  244. package/dist/utils/env.js +72 -0
  245. package/dist/utils/env.js.map +1 -0
  246. package/dist/utils/errors.d.ts +1 -1
  247. package/dist/utils/errors.d.ts.map +1 -1
  248. package/dist/utils/errors.js +20 -2
  249. package/dist/utils/errors.js.map +1 -1
  250. package/dist/utils/file-lock.d.ts +34 -0
  251. package/dist/utils/file-lock.d.ts.map +1 -0
  252. package/dist/utils/file-lock.js +91 -0
  253. package/dist/utils/file-lock.js.map +1 -0
  254. package/dist/utils/flat-listing.d.ts +89 -0
  255. package/dist/utils/flat-listing.d.ts.map +1 -0
  256. package/dist/utils/flat-listing.js +68 -0
  257. package/dist/utils/flat-listing.js.map +1 -0
  258. package/dist/utils/format.d.ts +1 -3
  259. package/dist/utils/format.d.ts.map +1 -1
  260. package/dist/utils/format.js +1 -5
  261. package/dist/utils/format.js.map +1 -1
  262. package/dist/utils/guard.d.ts +21 -0
  263. package/dist/utils/guard.d.ts.map +1 -0
  264. package/dist/utils/guard.js +105 -0
  265. package/dist/utils/guard.js.map +1 -0
  266. package/dist/utils/image-dimensions.d.ts +19 -0
  267. package/dist/utils/image-dimensions.d.ts.map +1 -0
  268. package/dist/utils/image-dimensions.js +93 -0
  269. package/dist/utils/image-dimensions.js.map +1 -0
  270. package/dist/utils/image-fetch.d.ts +31 -0
  271. package/dist/utils/image-fetch.d.ts.map +1 -0
  272. package/dist/utils/image-fetch.js +141 -0
  273. package/dist/utils/image-fetch.js.map +1 -0
  274. package/dist/utils/json-file.d.ts +45 -0
  275. package/dist/utils/json-file.d.ts.map +1 -0
  276. package/dist/utils/json-file.js +60 -0
  277. package/dist/utils/json-file.js.map +1 -0
  278. package/dist/utils/paths.d.ts +19 -0
  279. package/dist/utils/paths.d.ts.map +1 -0
  280. package/dist/utils/paths.js +27 -0
  281. package/dist/utils/paths.js.map +1 -0
  282. package/dist/utils/pattern.d.ts +30 -0
  283. package/dist/utils/pattern.d.ts.map +1 -0
  284. package/dist/utils/pattern.js +130 -0
  285. package/dist/utils/pattern.js.map +1 -0
  286. package/dist/utils/search-index.d.ts +22 -7
  287. package/dist/utils/search-index.d.ts.map +1 -1
  288. package/dist/utils/search-index.js +26 -8
  289. package/dist/utils/search-index.js.map +1 -1
  290. package/dist/utils/storage.d.ts +14 -44
  291. package/dist/utils/storage.d.ts.map +1 -1
  292. package/dist/utils/storage.js +47 -84
  293. package/dist/utils/storage.js.map +1 -1
  294. package/dist/utils/subtitles.d.ts +7 -0
  295. package/dist/utils/subtitles.d.ts.map +1 -0
  296. package/dist/utils/subtitles.js +30 -0
  297. package/dist/utils/subtitles.js.map +1 -0
  298. package/dist/utils/thumbnail-entry.d.ts +19 -0
  299. package/dist/utils/thumbnail-entry.d.ts.map +1 -0
  300. package/dist/utils/thumbnail-entry.js +119 -0
  301. package/dist/utils/thumbnail-entry.js.map +1 -0
  302. package/dist/utils/thumbnail-fetch.d.ts +37 -0
  303. package/dist/utils/thumbnail-fetch.d.ts.map +1 -0
  304. package/dist/utils/thumbnail-fetch.js +89 -0
  305. package/dist/utils/thumbnail-fetch.js.map +1 -0
  306. package/dist/utils/thumbnail-ladder.d.ts +44 -0
  307. package/dist/utils/thumbnail-ladder.d.ts.map +1 -0
  308. package/dist/utils/thumbnail-ladder.js +68 -0
  309. package/dist/utils/thumbnail-ladder.js.map +1 -0
  310. package/dist/utils/thumbnail-listing.d.ts +16 -0
  311. package/dist/utils/thumbnail-listing.d.ts.map +1 -0
  312. package/dist/utils/thumbnail-listing.js +26 -0
  313. package/dist/utils/thumbnail-listing.js.map +1 -0
  314. package/dist/utils/thumbnail-paths.d.ts +20 -0
  315. package/dist/utils/thumbnail-paths.d.ts.map +1 -0
  316. package/dist/utils/thumbnail-paths.js +35 -0
  317. package/dist/utils/thumbnail-paths.js.map +1 -0
  318. package/dist/utils/thumbnail-store.d.ts +19 -0
  319. package/dist/utils/thumbnail-store.d.ts.map +1 -0
  320. package/dist/utils/thumbnail-store.js +125 -0
  321. package/dist/utils/thumbnail-store.js.map +1 -0
  322. package/dist/utils/transcript-cache.d.ts +20 -0
  323. package/dist/utils/transcript-cache.d.ts.map +1 -0
  324. package/dist/utils/transcript-cache.js +127 -0
  325. package/dist/utils/transcript-cache.js.map +1 -0
  326. package/dist/utils/transcript-search.d.ts +20 -0
  327. package/dist/utils/transcript-search.d.ts.map +1 -0
  328. package/dist/utils/transcript-search.js +35 -0
  329. package/dist/utils/transcript-search.js.map +1 -0
  330. package/dist/utils/transcript.d.ts +14 -34
  331. package/dist/utils/transcript.d.ts.map +1 -1
  332. package/dist/utils/transcript.js +5 -64
  333. package/dist/utils/transcript.js.map +1 -1
  334. package/dist/utils/validate-youtube.d.ts +35 -0
  335. package/dist/utils/validate-youtube.d.ts.map +1 -0
  336. package/dist/utils/validate-youtube.js +87 -0
  337. package/dist/utils/validate-youtube.js.map +1 -0
  338. package/dist/utils/validate.d.ts +11 -3
  339. package/dist/utils/validate.d.ts.map +1 -1
  340. package/dist/utils/validate.js +43 -18
  341. package/dist/utils/validate.js.map +1 -1
  342. package/dist/utils/version.d.ts +2 -0
  343. package/dist/utils/version.d.ts.map +1 -0
  344. package/dist/utils/version.js +19 -0
  345. package/dist/utils/version.js.map +1 -0
  346. package/dist/utils/youtube-channel.d.ts +44 -0
  347. package/dist/utils/youtube-channel.d.ts.map +1 -0
  348. package/dist/utils/youtube-channel.js +61 -0
  349. package/dist/utils/youtube-channel.js.map +1 -0
  350. package/dist/utils/youtube-download.d.ts +27 -0
  351. package/dist/utils/youtube-download.d.ts.map +1 -0
  352. package/dist/utils/youtube-download.js +118 -0
  353. package/dist/utils/youtube-download.js.map +1 -0
  354. package/dist/utils/youtube-schemas.d.ts +394 -0
  355. package/dist/utils/youtube-schemas.d.ts.map +1 -0
  356. package/dist/utils/youtube-schemas.js +118 -0
  357. package/dist/utils/youtube-schemas.js.map +1 -0
  358. package/dist/utils/youtube-search.d.ts +14 -0
  359. package/dist/utils/youtube-search.d.ts.map +1 -0
  360. package/dist/utils/youtube-search.js +39 -0
  361. package/dist/utils/youtube-search.js.map +1 -0
  362. package/dist/utils/youtube-url.d.ts +25 -0
  363. package/dist/utils/youtube-url.d.ts.map +1 -0
  364. package/dist/utils/youtube-url.js +75 -0
  365. package/dist/utils/youtube-url.js.map +1 -0
  366. package/dist/utils/youtube-video.d.ts +47 -0
  367. package/dist/utils/youtube-video.d.ts.map +1 -0
  368. package/dist/utils/youtube-video.js +98 -0
  369. package/dist/utils/youtube-video.js.map +1 -0
  370. package/dist/utils/youtube.d.ts +13 -111
  371. package/dist/utils/youtube.d.ts.map +1 -1
  372. package/dist/utils/youtube.js +11 -480
  373. package/dist/utils/youtube.js.map +1 -1
  374. package/dist/utils/ytdlp-env.d.ts +33 -0
  375. package/dist/utils/ytdlp-env.d.ts.map +1 -0
  376. package/dist/utils/ytdlp-env.js +121 -0
  377. package/dist/utils/ytdlp-env.js.map +1 -0
  378. package/dist/utils/ytdlp-limiter.d.ts +24 -0
  379. package/dist/utils/ytdlp-limiter.d.ts.map +1 -0
  380. package/dist/utils/ytdlp-limiter.js +69 -0
  381. package/dist/utils/ytdlp-limiter.js.map +1 -0
  382. package/dist/utils/ytdlp-parse.d.ts +13 -0
  383. package/dist/utils/ytdlp-parse.d.ts.map +1 -0
  384. package/dist/utils/ytdlp-parse.js +48 -0
  385. package/dist/utils/ytdlp-parse.js.map +1 -0
  386. package/dist/utils/ytdlp.d.ts +13 -18
  387. package/dist/utils/ytdlp.d.ts.map +1 -1
  388. package/dist/utils/ytdlp.js +21 -110
  389. package/dist/utils/ytdlp.js.map +1 -1
  390. 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). Set `PORT` environment variable to change.
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
- 27 tools. The 14 read-only ones work over both transports; the 13 that touch
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 | Returns |
213
- | ------------------- | ---------------- | ---------------------------------------------------------------- |
214
- | `search_videos` | `query`, `limit` | Matching videos with durations, channels and view counts |
215
- | `search_channels` | `query`, `limit` | Matching channels with subscriber counts |
216
- | `fetch_videos` | `url`, `limit` | Videos in a playlist or channel |
217
- | `get_video_info` | `video` | Title, channel, duration, views, likes, description, tags |
218
- | `get_channel_info` | `channel` | Name, handle, subscriber count, description |
219
- | `get_playlist_info` | `url` | Title, channel, video count, last updated |
220
- | `get_chapters` | `video` | Chapter titles with start/end times and deep links |
221
- | `get_comments` | `video`, `limit` | Top-level comments by popularity |
222
- | `list_formats` | `video` | Available formats grouped by video+audio, video-only, audio-only |
223
- | `check_health` | — | yt-dlp and ffmpeg status, versions, and staleness warnings |
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` | Ranked matches with excerpts |
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), and
271
- `review_library` (local only).
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 | Default | Purpose |
299
- | ------------------------------- | --------- | -------------------------------------------------------------------------------------------------------- |
300
- | `MCP_AUTH_TOKEN` | unset | Require this bearer token on the HTTP transport. **Set this if you expose the server beyond localhost.** |
301
- | `MCP_ALLOWED_HOSTS` | unset | Comma-separated Host allowlist; enables DNS-rebinding protection |
302
- | `MCP_ALLOWED_ORIGINS` | unset | Comma-separated Origin allowlist |
303
- | `MCP_BIND_HOST` | `0.0.0.0` | Interface to bind |
304
- | `PORT` | `3000` | HTTP port. The Docker image sets `10000`; Render and similar platforms inject their own |
305
- | `MCP_RATE_LIMIT` | `60` | Requests per window, per client |
306
- | `MCP_RATE_WINDOW_MS` | `60000` | Rate-limit window |
307
- | `MCP_SESSION_IDLE_MS` | `1800000` | Close HTTP sessions idle this long |
308
- | `MCP_MAX_SESSIONS` | `1000` | Reject new sessions past this many |
309
- | `YOUTUBE_MCP_MAX_CONCURRENCY` | `3` | Concurrent yt-dlp processes |
310
- | `YOUTUBE_MCP_TRANSCRIPT_TTL_MS` | 30 days | Transcript cache lifetime |
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 is unauthenticated unless you set `MCP_AUTH_TOKEN`. See
432
- [SECURITY.md](SECURITY.md) before exposing it beyond localhost, and to report a
433
- vulnerability.
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