youtube-knowledge-mcp 1.0.2 → 1.1.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 (64) hide show
  1. package/README.md +174 -80
  2. package/dist/index.js +314 -48
  3. package/dist/index.js.map +1 -1
  4. package/dist/tools/download-video.d.ts +4 -11
  5. package/dist/tools/download-video.d.ts.map +1 -1
  6. package/dist/tools/download-video.js +11 -45
  7. package/dist/tools/download-video.js.map +1 -1
  8. package/dist/tools/fetch-videos.d.ts +2 -2
  9. package/dist/tools/fetch-videos.d.ts.map +1 -1
  10. package/dist/tools/fetch-videos.js +11 -10
  11. package/dist/tools/fetch-videos.js.map +1 -1
  12. package/dist/tools/get-channel-info.d.ts +13 -0
  13. package/dist/tools/get-channel-info.d.ts.map +1 -0
  14. package/dist/tools/get-channel-info.js +21 -0
  15. package/dist/tools/get-channel-info.js.map +1 -0
  16. package/dist/tools/get-chapters.d.ts +13 -0
  17. package/dist/tools/get-chapters.d.ts.map +1 -0
  18. package/dist/tools/get-chapters.js +18 -0
  19. package/dist/tools/get-chapters.js.map +1 -0
  20. package/dist/tools/get-comments.d.ts +15 -0
  21. package/dist/tools/get-comments.d.ts.map +1 -0
  22. package/dist/tools/get-comments.js +28 -0
  23. package/dist/tools/get-comments.js.map +1 -0
  24. package/dist/tools/get-playlist-info.d.ts +13 -0
  25. package/dist/tools/get-playlist-info.d.ts.map +1 -0
  26. package/dist/tools/get-playlist-info.js +25 -0
  27. package/dist/tools/get-playlist-info.js.map +1 -0
  28. package/dist/tools/get-transcript.d.ts +2 -2
  29. package/dist/tools/get-transcript.d.ts.map +1 -1
  30. package/dist/tools/get-transcript.js +7 -10
  31. package/dist/tools/get-transcript.js.map +1 -1
  32. package/dist/tools/get-video-info.d.ts +2 -2
  33. package/dist/tools/get-video-info.d.ts.map +1 -1
  34. package/dist/tools/get-video-info.js +11 -9
  35. package/dist/tools/get-video-info.js.map +1 -1
  36. package/dist/tools/list-library.d.ts +2 -2
  37. package/dist/tools/list-library.d.ts.map +1 -1
  38. package/dist/tools/list-library.js +6 -9
  39. package/dist/tools/list-library.js.map +1 -1
  40. package/dist/tools/save-to-library.d.ts +2 -2
  41. package/dist/tools/save-to-library.d.ts.map +1 -1
  42. package/dist/tools/save-to-library.js +13 -14
  43. package/dist/tools/save-to-library.js.map +1 -1
  44. package/dist/tools/search-channels.d.ts +15 -0
  45. package/dist/tools/search-channels.d.ts.map +1 -0
  46. package/dist/tools/search-channels.js +35 -0
  47. package/dist/tools/search-channels.js.map +1 -0
  48. package/dist/tools/search-videos.d.ts +15 -0
  49. package/dist/tools/search-videos.d.ts.map +1 -0
  50. package/dist/tools/search-videos.js +30 -0
  51. package/dist/tools/search-videos.js.map +1 -0
  52. package/dist/utils/format.d.ts +10 -0
  53. package/dist/utils/format.d.ts.map +1 -0
  54. package/dist/utils/format.js +31 -0
  55. package/dist/utils/format.js.map +1 -0
  56. package/dist/utils/storage.d.ts +0 -6
  57. package/dist/utils/storage.d.ts.map +1 -1
  58. package/dist/utils/storage.js +0 -33
  59. package/dist/utils/storage.js.map +1 -1
  60. package/dist/utils/youtube.d.ts +50 -0
  61. package/dist/utils/youtube.d.ts.map +1 -1
  62. package/dist/utils/youtube.js +137 -9
  63. package/dist/utils/youtube.js.map +1 -1
  64. package/package.json +3 -1
package/README.md CHANGED
@@ -5,18 +5,25 @@
5
5
  [![Node.js](https://img.shields.io/badge/Node.js-20%2B-green.svg)](https://nodejs.org/)
6
6
  [![GitHub stars](https://img.shields.io/github/stars/teobouancheau/youtube-knowledge-mcp?style=social)](https://github.com/teobouancheau/youtube-knowledge-mcp)
7
7
 
8
- A Model Context Protocol (MCP) server that gives AI assistants the ability to extract knowledge from YouTube videos. Works with Claude Desktop, Claude Code, Cursor and any MCP-compatible client. Fetch video metadata, extract transcripts, download videos, and build a personal knowledge library from YouTube content.
8
+ A Model Context Protocol (MCP) server that gives AI assistants the ability to search, analyze, and extract knowledge from YouTube videos. Works with Claude Desktop, Claude Code, Claude.ai, Cursor and any MCP-compatible client.
9
+
10
+ Supports both **local** (stdio) and **remote** (Streamable HTTP) transports.
9
11
 
10
12
  ![YouTube Knowledge MCP](https://raw.githubusercontent.com/teobouancheau/youtube-knowledge-mcp/main/thumbnail.png)
11
13
 
12
14
  ## Features
13
15
 
16
+ - **Search videos** by keyword or phrase
14
17
  - **Fetch videos** from playlists or channels
15
- - **Get video info** (title, channel, duration, description, tags)
18
+ - **Get video info** (title, channel, duration, views, likes, comments, description, tags)
16
19
  - **Extract transcripts** (auto-generated or manual captions)
17
- - **Download videos** with quality selection and format options
18
- - **Save to library** (summaries, notes, skills)
19
- - **List library** with tag filtering
20
+ - **Get chapters** (timestamps and structure)
21
+ - **Get comments** (top comments sorted by popularity)
22
+ - **Get channel info** (name, handle, subscriber count, description)
23
+ - **List formats** (available download resolutions and codecs)
24
+ - **Download videos** with quality selection (local mode only)
25
+ - **Save to library** (summaries, notes, skills) (local mode only)
26
+ - **List library** with tag filtering (local mode only)
20
27
 
21
28
  ## Prerequisites
22
29
 
@@ -46,9 +53,9 @@ npm run build
46
53
 
47
54
  ## Configuration
48
55
 
49
- ### Quick Start with npx (Recommended)
56
+ ### Local (stdio) -- Claude Desktop, Claude Code, Cursor
50
57
 
51
- No installation needed! Add to your MCP configuration:
58
+ #### Quick Start with npx
52
59
 
53
60
  ```json
54
61
  {
@@ -61,7 +68,7 @@ No installation needed! Add to your MCP configuration:
61
68
  }
62
69
  ```
63
70
 
64
- ### With Global Installation
71
+ #### With Global Installation
65
72
 
66
73
  ```bash
67
74
  npm install -g youtube-knowledge-mcp
@@ -77,7 +84,7 @@ npm install -g youtube-knowledge-mcp
77
84
  }
78
85
  ```
79
86
 
80
- ### Configuration File Locations
87
+ #### Configuration File Locations
81
88
 
82
89
  | Client | Path |
83
90
  | ---------------------------- | ----------------------------------------------------------------- |
@@ -89,77 +96,183 @@ npm install -g youtube-knowledge-mcp
89
96
 
90
97
  Restart your client after updating configuration.
91
98
 
99
+ ### Remote (HTTP) -- Claude.ai, Claude Mobile, Custom Connectors
100
+
101
+ The server supports Streamable HTTP transport for remote access via Claude's official connectors.
102
+
103
+ #### Self-hosted
104
+
105
+ ```bash
106
+ npm run build
107
+ npm run start:http
108
+ ```
109
+
110
+ The server listens on `PORT` (default 3000). Set `PORT` environment variable to change.
111
+
112
+ #### Docker
113
+
114
+ ```bash
115
+ npm run build
116
+ docker build -t youtube-knowledge-mcp .
117
+ docker run -p 3000:10000 youtube-knowledge-mcp
118
+ ```
119
+
120
+ #### Deploy to Render
121
+
122
+ 1. Push to GitHub
123
+ 2. Create a **Web Service** on Render with **Docker** runtime
124
+ 3. Render sets `PORT` automatically
125
+ 4. Add the Render URL as a custom connector in Claude.ai > Settings > Connectors
126
+
127
+ #### Connect via Claude.ai
128
+
129
+ 1. Go to **Settings > Connectors**
130
+ 2. Click **Add custom connector**
131
+ 3. Enter your server URL (e.g., `https://your-app.onrender.com/mcp`)
132
+ 4. Click **Add**
133
+
92
134
  ## MCP Tools
93
135
 
94
- ### youtube_fetch_videos
136
+ ### Remote + Local (10 tools)
137
+
138
+ #### search_videos
139
+
140
+ Search YouTube for videos by keyword or phrase.
141
+
142
+ | Parameter | Type | Default | Description |
143
+ | --------- | ------ | -------- | -------------------------------- |
144
+ | `query` | string | required | Search query |
145
+ | `limit` | number | 5 | Maximum results to return (1-20) |
146
+
147
+ **Returns:** video IDs, titles, durations, channels, view counts, URLs
148
+
149
+ #### fetch_videos
95
150
 
96
151
  List videos from a YouTube playlist or channel.
97
152
 
98
- | Parameter | Type | Default | Description |
99
- | --------- | ------ | -------- | ------------------------------- |
100
- | `url` | string | required | YouTube playlist or channel URL |
101
- | `limit` | number | 20 | Maximum videos to fetch |
153
+ | Parameter | Type | Default | Description |
154
+ | --------- | ------ | -------- | ------------------------------------ |
155
+ | `url` | string | required | Playlist URL, channel URL, or handle |
156
+ | `limit` | number | 20 | Maximum videos to return (1-100) |
102
157
 
103
- ### youtube_get_video_info
158
+ #### get_video_info
104
159
 
105
- Get detailed metadata for a YouTube video.
160
+ Get detailed metadata for a single YouTube video.
106
161
 
107
162
  | Parameter | Type | Description |
108
163
  | --------- | ------ | --------------- |
109
164
  | `video` | string | Video ID or URL |
110
165
 
111
- **Returns:** title, channel, duration, description, tags, thumbnail
166
+ **Returns:** title, channel, duration, upload date, view count, like count, comment count, description, tags, thumbnail URL
167
+
168
+ #### get_transcript
112
169
 
113
- ### youtube_get_transcript
170
+ Extract the full transcript from a YouTube video.
114
171
 
115
- Extract transcript/subtitles from a YouTube video.
172
+ | Parameter | Type | Default | Description |
173
+ | ---------- | ------ | -------- | ------------------------------ |
174
+ | `video` | string | required | Video ID or URL |
175
+ | `language` | string | "en" | Preferred language (ISO 639-1) |
116
176
 
117
- | Parameter | Type | Default | Description |
118
- | ---------- | ------ | -------- | ----------------------- |
119
- | `video` | string | required | Video ID or URL |
120
- | `language` | string | "en" | Preferred language code |
177
+ **Returns:** plain text transcript with word count and detected language
121
178
 
122
- ### youtube_list_formats
179
+ #### get_chapters
123
180
 
124
- List available download formats for a YouTube video.
181
+ Extract chapter markers and timestamps from a YouTube video.
125
182
 
126
183
  | Parameter | Type | Description |
127
184
  | --------- | ------ | --------------- |
128
185
  | `video` | string | Video ID or URL |
129
186
 
130
- **Returns:** format IDs, resolutions, codecs, file sizes
187
+ **Returns:** chapter titles with start and end times. Empty list if no chapters found.
188
+
189
+ #### get_comments
190
+
191
+ Get top comments from a YouTube video sorted by popularity.
192
+
193
+ | Parameter | Type | Default | Description |
194
+ | --------- | ------ | -------- | ------------------------------------------- |
195
+ | `video` | string | required | Video ID or URL |
196
+ | `limit` | number | 20 | Maximum top-level comments to return (1-50) |
197
+
198
+ **Returns:** author, text, like count, pinned status
199
+
200
+ #### get_channel_info
131
201
 
132
- ### youtube_download_video
202
+ Get metadata for a YouTube channel.
133
203
 
134
- Download a YouTube video with quality selection.
204
+ | Parameter | Type | Description |
205
+ | --------- | ------ | ---------------------------------------------- |
206
+ | `channel` | string | Channel URL, handle (e.g., @Fireship), or name |
207
+
208
+ **Returns:** channel name, handle, subscriber count, description, channel URL
209
+
210
+ #### search_channels
211
+
212
+ Search YouTube for channels by keyword or phrase.
213
+
214
+ | Parameter | Type | Default | Description |
215
+ | --------- | ------ | -------- | --------------------------------- |
216
+ | `query` | string | required | Search query for channels |
217
+ | `limit` | number | 5 | Maximum channels to return (1-20) |
218
+
219
+ **Returns:** channel names, handles, subscriber counts, descriptions, URLs
220
+
221
+ #### get_playlist_info
222
+
223
+ Get metadata for a YouTube playlist.
224
+
225
+ | Parameter | Type | Description |
226
+ | --------- | ------ | -------------------- |
227
+ | `url` | string | YouTube playlist URL |
228
+
229
+ **Returns:** title, channel, video count, last updated date, description
230
+
231
+ #### list_formats
232
+
233
+ List all available download formats for a YouTube video.
234
+
235
+ | Parameter | Type | Description |
236
+ | --------- | ------ | --------------- |
237
+ | `video` | string | Video ID or URL |
238
+
239
+ **Returns:** format IDs, extensions, resolutions, FPS, codecs, file sizes
240
+
241
+ ### Local Only (3 tools, stdio mode)
242
+
243
+ These tools operate on the local filesystem and are only available in stdio mode.
244
+
245
+ #### download_video
246
+
247
+ Download a YouTube video to local disk.
135
248
 
136
249
  | Parameter | Type | Default | Description |
137
250
  | ----------- | ------ | -------- | ------------------------------------------------------------------- |
138
251
  | `video` | string | required | Video ID or URL |
139
252
  | `quality` | string | "best" | Quality preset (best, 2160p, 1440p, 1080p, 720p, 480p, 360p, audio) |
140
- | `formatId` | string | - | Specific format code from youtube_list_formats |
253
+ | `formatId` | string | - | Specific format code from list_formats |
141
254
  | `outputDir` | string | - | Custom output directory |
142
255
 
143
- ### youtube_save_to_library
256
+ #### save_to_library
144
257
 
145
- Save content to your personal YouTube knowledge library.
258
+ Save a summary or skill note to your local YouTube knowledge library.
146
259
 
147
- | Parameter | Type | Description |
148
- | -------------- | -------- | --------------------- |
149
- | `video_id` | string | YouTube video ID |
150
- | `title` | string | Video title |
151
- | `content` | string | Content to save |
152
- | `content_type` | string | "summary" or "skill" |
153
- | `tags` | string[] | Optional tags |
154
- | `channel` | string | Optional channel name |
260
+ | Parameter | Type | Description |
261
+ | -------------- | -------- | ---------------------------------- |
262
+ | `video_id` | string | YouTube video ID |
263
+ | `title` | string | Video title |
264
+ | `content` | string | Content to save (markdown format) |
265
+ | `content_type` | string | "summary" or "skill" |
266
+ | `tags` | string[] | Tags for categorization (optional) |
267
+ | `channel` | string | Channel name (optional) |
155
268
 
156
- ### youtube_list_library
269
+ #### list_library
157
270
 
158
- List all saved items in your library.
271
+ List all saved items in your local knowledge library.
159
272
 
160
- | Parameter | Type | Description |
161
- | --------- | ------ | ---------------------- |
162
- | `tag` | string | Optional filter by tag |
273
+ | Parameter | Type | Description |
274
+ | --------- | ------ | --------------------------------------- |
275
+ | `tag` | string | Filter by tag (optional, partial match) |
163
276
 
164
277
  ## Library Storage
165
278
 
@@ -181,34 +294,34 @@ Content is stored in `~/.youtube-knowledge/`:
181
294
 
182
295
  ## Usage Examples
183
296
 
184
- ### Quick summary
297
+ ### Search and analyze
185
298
 
186
299
  ```
187
- "Summarize this video: https://youtube.com/watch?v=ABC123"
300
+ "Search YouTube for 'transformer architecture explained' and summarize the top result"
188
301
  ```
189
302
 
190
303
  ### Explore a channel
191
304
 
192
305
  ```
193
- "Show me the latest videos from @ThePrimeagen"
306
+ "Show me the latest videos from @ThePrimeagen and get the chapters for the most recent one"
194
307
  ```
195
308
 
196
- ### Download a video
309
+ ### Deep content analysis
197
310
 
198
311
  ```
199
- "Download this video in 1080p: https://youtube.com/watch?v=ABC123"
312
+ "Get the transcript and chapters for this video, then create a structured summary"
200
313
  ```
201
314
 
202
- ### Save to library
315
+ ### Audience sentiment
203
316
 
204
317
  ```
205
- "Save this summary with tags: programming, productivity"
318
+ "What are the top comments on this video? What does the audience think?"
206
319
  ```
207
320
 
208
- ### Create a skill
321
+ ### Download a video (local only)
209
322
 
210
323
  ```
211
- "Create a Claude Code skill from this video's content"
324
+ "Download this video in 1080p: https://youtube.com/watch?v=ABC123"
212
325
  ```
213
326
 
214
327
  ## Testing
@@ -219,19 +332,15 @@ npm run test:watch # Watch mode
219
332
  npm run test:coverage # Coverage report
220
333
  ```
221
334
 
222
- **Test Suite:**
223
-
224
- - ✅ **11 tests** passing
225
- - ⚡ **Execution time:** ~100ms
226
- - 🧰 **Framework:** Vitest
227
-
228
335
  ## Development
229
336
 
230
337
  ```bash
231
- npm run dev # Watch mode
232
- npm run build # Build for production
233
- npm run rebuild # Clean and rebuild
234
- npm start # Run the server
338
+ npm run dev # Watch mode
339
+ npm run build # Build for production
340
+ npm run rebuild # Clean and rebuild
341
+ npm start # Run server (stdio)
342
+ npm run start:http # Run server (HTTP)
343
+ npm run validate # Typecheck + lint + test
235
344
  ```
236
345
 
237
346
  ## Contributing
@@ -240,29 +349,14 @@ Contributions are welcome! Please:
240
349
 
241
350
  1. Fork the repository
242
351
  2. Create a feature branch
243
- 3. Run tests (`npm test`)
352
+ 3. Run tests (`npm run validate`)
244
353
  4. Submit a pull request
245
354
 
246
355
  ## License
247
356
 
248
357
  MIT License - see [LICENSE](LICENSE) for details.
249
358
 
250
- **Attribution appreciated!** If you use YouTube Knowledge MCP, consider:
251
-
252
- - ⭐ Starring this repository
253
- - 💬 Mentioning it in your project
254
- - 🔗 Linking back to this repo
255
-
256
359
  ## Acknowledgments
257
360
 
258
- - [yt-dlp](https://github.com/yt-dlp/yt-dlp) for the powerful YouTube extraction
361
+ - [yt-dlp](https://github.com/yt-dlp/yt-dlp) for YouTube extraction
259
362
  - [Anthropic](https://anthropic.com) for the Model Context Protocol
260
- - All contributors and users of this project
261
-
262
- ---
263
-
264
- <div align="center">
265
- <strong>Built with ❤️ by <a href="https://github.com/teobouancheau">teobouancheau</a> for the YouTube community</strong>
266
- <br>
267
- <sub>AI + YouTube knowledge to supercharge content creation</sub>
268
- </div>