@roomi-fields/notebooklm-mcp 1.5.0 → 1.5.1

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 (161) hide show
  1. package/LICENSE +22 -22
  2. package/README.md +2 -0
  3. package/deployment/INDEX.md +292 -0
  4. package/deployment/PACKAGE-FILES.txt +180 -0
  5. package/deployment/QUICK-START.md +100 -0
  6. package/deployment/docs/01-INSTALL.md +611 -0
  7. package/deployment/docs/02-CONFIGURATION.md +404 -0
  8. package/deployment/docs/03-API.md +1691 -0
  9. package/deployment/docs/04-N8N-INTEGRATION.md +373 -0
  10. package/deployment/docs/05-TROUBLESHOOTING.md +429 -0
  11. package/deployment/docs/06-NOTEBOOK-LIBRARY.md +692 -0
  12. package/deployment/docs/07-AUTO-DISCOVERY.md +236 -0
  13. package/deployment/docs/08-WSL-USAGE.md +363 -0
  14. package/deployment/docs/09-MULTI-INTERFACE.md +293 -0
  15. package/deployment/docs/10-CONTENT-MANAGEMENT.md +421 -0
  16. package/deployment/docs/11-MULTI-ACCOUNT.md +295 -0
  17. package/deployment/docs/README.md +207 -0
  18. package/deployment/scripts/README.md +564 -0
  19. package/deployment/scripts/install.ps1 +114 -0
  20. package/deployment/scripts/setup-auth.ps1 +217 -0
  21. package/deployment/scripts/start-server.ps1 +72 -0
  22. package/deployment/scripts/stop-server.ps1 +51 -0
  23. package/deployment/scripts/test-api.ps1 +651 -0
  24. package/deployment/scripts/test-auth.ps1 +323 -0
  25. package/deployment/scripts/test-auto-discovery.ps1 +295 -0
  26. package/deployment/scripts/test-cors.ps1 +398 -0
  27. package/deployment/scripts/test-errors.ps1 +581 -0
  28. package/deployment/scripts/test-server.ps1 +140 -0
  29. package/deployment/scripts/test-sessions.ps1 +426 -0
  30. package/deployment/scripts/test-validation.ps1 +299 -0
  31. package/dist/cli/accounts.js.map +1 -1
  32. package/dist/config.d.ts +1 -0
  33. package/dist/config.d.ts.map +1 -1
  34. package/dist/config.js +15 -0
  35. package/dist/config.js.map +1 -1
  36. package/dist/content/content-manager.d.ts.map +1 -1
  37. package/dist/content/content-manager.js +113 -118
  38. package/dist/content/content-manager.js.map +1 -1
  39. package/dist/i18n/en.json +120 -0
  40. package/dist/i18n/fr.json +120 -0
  41. package/dist/i18n/index.d.ts +168 -0
  42. package/dist/i18n/index.d.ts.map +1 -0
  43. package/dist/i18n/index.js +213 -0
  44. package/dist/i18n/index.js.map +1 -0
  45. package/dist/session/browser-session.d.ts.map +1 -1
  46. package/dist/session/browser-session.js +1 -0
  47. package/dist/session/browser-session.js.map +1 -1
  48. package/dist/session/shared-context-manager.d.ts.map +1 -1
  49. package/dist/session/shared-context-manager.js +2 -0
  50. package/dist/session/shared-context-manager.js.map +1 -1
  51. package/docs/ADDING_A_LANGUAGE.md +209 -0
  52. package/package.json +6 -3
  53. package/scripts/archive/add-and-activate-notebook.ps1 +31 -0
  54. package/scripts/archive/add-new-notebook.ps1 +25 -0
  55. package/scripts/archive/add-rom1pey.ps1 +2 -0
  56. package/scripts/archive/add-rpmonster.ps1 +2 -0
  57. package/scripts/archive/add-source-debug.ps1 +11 -0
  58. package/scripts/archive/add-source-e2e.ps1 +28 -0
  59. package/scripts/archive/add-source-visible.ps1 +11 -0
  60. package/scripts/archive/add-test-notebook.ps1 +13 -0
  61. package/scripts/archive/add-test-source.ps1 +50 -0
  62. package/scripts/archive/capture-screen.ps1 +11 -0
  63. package/scripts/archive/change-language.mjs +45 -0
  64. package/scripts/archive/change-language.ts +44 -0
  65. package/scripts/archive/check-account.ps1 +19 -0
  66. package/scripts/archive/check-notebook-2.ps1 +8 -0
  67. package/scripts/archive/check-test-notebook.ps1 +11 -0
  68. package/scripts/archive/create-notebook-auto.ps1 +31 -0
  69. package/scripts/archive/create-notebook.ps1 +8 -0
  70. package/scripts/archive/create-rom1pey-notebook.ps1 +19 -0
  71. package/scripts/archive/create-rom1pey.ps1 +8 -0
  72. package/scripts/archive/create-test-notebook-fresh.ps1 +21 -0
  73. package/scripts/archive/create-test-notebook.ps1 +16 -0
  74. package/scripts/archive/debug-add-source-auto.ps1 +29 -0
  75. package/scripts/archive/debug-add-source.ps1 +19 -0
  76. package/scripts/archive/debug-add-text-source.ps1 +47 -0
  77. package/scripts/archive/debug-home.ps1 +10 -0
  78. package/scripts/archive/debug-selectors.ps1 +55 -0
  79. package/scripts/archive/debug-sources-panel.ps1 +22 -0
  80. package/scripts/archive/debug-ui.ps1 +17 -0
  81. package/scripts/archive/discover-home.ps1 +26 -0
  82. package/scripts/archive/kill-automation-chrome.ps1 +37 -0
  83. package/scripts/archive/list-my-notebooks.ps1 +27 -0
  84. package/scripts/archive/navigate-home-visible.ps1 +23 -0
  85. package/scripts/archive/navigate-home.ps1 +15 -0
  86. package/scripts/archive/run-e2e-english.ps1 +111 -0
  87. package/scripts/archive/run-e2e-rom1pey-v2.ps1 +122 -0
  88. package/scripts/archive/run-e2e-rom1pey.ps1 +117 -0
  89. package/scripts/archive/setup-english-test.ps1 +36 -0
  90. package/scripts/archive/setup-test-notebook.ps1 +71 -0
  91. package/scripts/archive/simple-add-source.ps1 +14 -0
  92. package/scripts/archive/t10.ps1 +2 -0
  93. package/scripts/archive/t20.ps1 +4 -0
  94. package/scripts/archive/t30.ps1 +9 -0
  95. package/scripts/archive/t31.ps1 +11 -0
  96. package/scripts/archive/t32.ps1 +6 -0
  97. package/scripts/archive/t39.ps1 +5 -0
  98. package/scripts/archive/t40.ps1 +5 -0
  99. package/scripts/archive/t53.ps1 +12 -0
  100. package/scripts/archive/t54.ps1 +12 -0
  101. package/scripts/archive/t55.ps1 +11 -0
  102. package/scripts/archive/t9.ps1 +1 -0
  103. package/scripts/archive/test-access.ps1 +28 -0
  104. package/scripts/archive/test-add-delete-source.ps1 +64 -0
  105. package/scripts/archive/test-add-source-visible.ps1 +16 -0
  106. package/scripts/archive/test-add-source.ps1 +19 -0
  107. package/scripts/archive/test-add-text-debug.ps1 +28 -0
  108. package/scripts/archive/test-add-text-source.ps1 +8 -0
  109. package/scripts/archive/test-add-url-source.ps1 +7 -0
  110. package/scripts/archive/test-ask-ascii.ps1 +20 -0
  111. package/scripts/archive/test-ask-cnv.ps1 +20 -0
  112. package/scripts/archive/test-ask-headed.ps1 +51 -0
  113. package/scripts/archive/test-ask-ifs.ps1 +16 -0
  114. package/scripts/archive/test-ask-now.ps1 +24 -0
  115. package/scripts/archive/test-ask-real.ps1 +19 -0
  116. package/scripts/archive/test-ask-visible.ps1 +20 -0
  117. package/scripts/archive/test-create-notebook.ps1 +8 -0
  118. package/scripts/archive/test-create-then-add.ps1 +17 -0
  119. package/scripts/archive/test-delete-source.ps1 +41 -0
  120. package/scripts/archive/test-e2e-notebook.ps1 +21 -0
  121. package/scripts/archive/test-english-notebook.ps1 +20 -0
  122. package/scripts/archive/test-english.ps1 +7 -0
  123. package/scripts/archive/test-full-custom-instructions.ps1 +40 -0
  124. package/scripts/archive/test-full-infographic.ps1 +34 -0
  125. package/scripts/archive/test-full-language.ps1 +21 -0
  126. package/scripts/archive/test-full-presentation.ps1 +85 -0
  127. package/scripts/archive/test-full-report.ps1 +34 -0
  128. package/scripts/archive/test-full-source-selection.ps1 +35 -0
  129. package/scripts/archive/test-full-video-brief.ps1 +22 -0
  130. package/scripts/archive/test-full-video-explainer.ps1 +22 -0
  131. package/scripts/archive/test-full-video-styles.ps1 +37 -0
  132. package/scripts/archive/test-generate-report.ps1 +15 -0
  133. package/scripts/archive/test-generate-study-guide.ps1 +11 -0
  134. package/scripts/archive/test-headed-ask.ps1 +13 -0
  135. package/scripts/archive/test-headed-now.ps1 +9 -0
  136. package/scripts/archive/test-headed.ps1 +9 -0
  137. package/scripts/archive/test-hello.ps1 +7 -0
  138. package/scripts/archive/test-i18n-studio.ps1 +8 -0
  139. package/scripts/archive/test-i18n.ps1 +7 -0
  140. package/scripts/archive/test-manual-headed.ps1 +26 -0
  141. package/scripts/archive/test-mathieu-quota.ps1 +8 -0
  142. package/scripts/archive/test-notebook-1.ps1 +10 -0
  143. package/scripts/archive/test-notebook-2-sources.ps1 +12 -0
  144. package/scripts/archive/test-notebook1.ps1 +14 -0
  145. package/scripts/archive/test-personal-notebook.ps1 +14 -0
  146. package/scripts/archive/test-rate-limit.ps1 +19 -0
  147. package/scripts/archive/test-real-ask.ps1 +50 -0
  148. package/scripts/archive/test-real-ask2.ps1 +30 -0
  149. package/scripts/archive/test-rom1pey.ps1 +7 -0
  150. package/scripts/archive/test-rotation-complete.ps1 +14 -0
  151. package/scripts/archive/test-rotation.ps1 +8 -0
  152. package/scripts/archive/test-show-browser.ps1 +39 -0
  153. package/scripts/archive/test-update-notebook.ps1 +4 -0
  154. package/scripts/archive/verify-language-slow.ps1 +21 -0
  155. package/scripts/archive/verify-language.ps1 +15 -0
  156. package/scripts/check-server.ps1 +46 -0
  157. package/scripts/mcp-wsl-helper.sh +146 -0
  158. package/scripts/start-server.ps1 +94 -0
  159. package/scripts/stop-server.ps1 +30 -0
  160. package/scripts/switch-account-language.sh +191 -0
  161. package/scripts/test-account.ps1 +58 -0
@@ -0,0 +1,692 @@
1
+ # Managing the Notebook Library
2
+
3
+ > Complete guide to the multi-notebook library system
4
+
5
+ ---
6
+
7
+ ## 📚 Overview
8
+
9
+ The **NotebookLM MCP HTTP Server** integrates a library system that allows you to manage multiple NotebookLM notebooks and easily switch between them.
10
+
11
+ **Key features:**
12
+
13
+ - ✅ Add multiple notebooks with automatic validation
14
+ - ✅ Switch between notebooks in a single request
15
+ - ✅ Live validation (verifies that the notebook actually exists)
16
+ - ✅ Duplicate protection
17
+ - ✅ Usage statistics per notebook
18
+ - ✅ Library search
19
+
20
+ ---
21
+
22
+ ## 🗂️ Library Structure
23
+
24
+ ### library.json File
25
+
26
+ Location: `%LOCALAPPDATA%\notebooklm-mcp\Data\library.json`
27
+
28
+ ```json
29
+ {
30
+ "notebooks": [
31
+ {
32
+ "id": "parents-numerique",
33
+ "url": "https://notebooklm.google.com/notebook/505ee4b1-ad05-4673-a06b-1ec106c2b940",
34
+ "name": "Parents et Numérique",
35
+ "description": "Conseils pour parents à l'ère du numérique",
36
+ "topics": ["parentalité", "numérique", "éducation"],
37
+ "content_types": ["documentation", "examples"],
38
+ "use_cases": [
39
+ "Conseils éducatifs à l'ère du numérique",
40
+ "Questions sur la parentalité et les écrans"
41
+ ],
42
+ "added_at": "2025-11-22T08:49:16.735Z",
43
+ "last_used": "2025-11-22T09:30:45.123Z",
44
+ "use_count": 15,
45
+ "tags": ["psychology", "french"]
46
+ },
47
+ {
48
+ "id": "shakespeare",
49
+ "url": "https://notebooklm.google.com/notebook/19bde485-a9c1-4809-8884-e872b2b67b44",
50
+ "name": "Shakespeare",
51
+ "description": "William Shakespeare - L'intégrale des pièces",
52
+ "topics": ["littérature", "théâtre", "Shakespeare"],
53
+ "content_types": ["documentation", "examples"],
54
+ "use_cases": ["Recherche sur les œuvres de Shakespeare", "Analyse littéraire et citations"],
55
+ "added_at": "2025-11-22T08:54:33.592Z",
56
+ "last_used": "2025-11-22T08:54:39.064Z",
57
+ "use_count": 3,
58
+ "tags": ["psychology"]
59
+ }
60
+ ],
61
+ "active_notebook_id": "parents-numerique",
62
+ "last_modified": "2025-11-22T09:36:04.837Z",
63
+ "version": "1.0.0"
64
+ }
65
+ ```
66
+
67
+ ### NotebookEntry Fields
68
+
69
+ | Field | Type | Description |
70
+ | --------------- | -------- | ------------------------------------ |
71
+ | `id` | string | Unique ID (slug generated from name) |
72
+ | `url` | string | NotebookLM URL (validated) |
73
+ | `name` | string | Notebook name (unique) |
74
+ | `description` | string | Complete description |
75
+ | `topics` | string[] | List of covered topics |
76
+ | `content_types` | string[] | Content types (docs, examples, etc.) |
77
+ | `use_cases` | string[] | Recommended use cases |
78
+ | `added_at` | ISO date | Date added |
79
+ | `last_used` | ISO date | Last used |
80
+ | `use_count` | number | Number of requests |
81
+ | `tags` | string[] | Custom tags |
82
+
83
+ ---
84
+
85
+ ## 🚀 Getting Started Guide
86
+
87
+ ### 1. Automatic Initialization
88
+
89
+ On first startup, the library is empty:
90
+
91
+ ```json
92
+ {
93
+ "notebooks": [],
94
+ "active_notebook_id": null,
95
+ "last_modified": "2025-11-22T08:00:00.000Z",
96
+ "version": "1.0.0"
97
+ }
98
+ ```
99
+
100
+ ### 2. Add Your First Notebook
101
+
102
+ **Step 1: Get the NotebookLM URL**
103
+
104
+ 1. Open https://notebooklm.google.com
105
+ 2. Open your notebook
106
+ 3. Copy the URL from the address bar
107
+
108
+ Expected format: `https://notebooklm.google.com/notebook/[id]`
109
+
110
+ **Step 2: Add the notebook**
111
+
112
+ ```bash
113
+ curl -X POST http://localhost:3000/notebooks \
114
+ -H "Content-Type: application/json" \
115
+ -d '{
116
+ "url": "https://notebooklm.google.com/notebook/505ee4b1-ad05-4673-a06b-1ec106c2b940",
117
+ "name": "Parents et Numérique",
118
+ "description": "Conseils pour parents à l'ère du numérique",
119
+ "topics": ["parentalité", "numérique", "éducation"]
120
+ }'
121
+ ```
122
+
123
+ **PowerShell:**
124
+
125
+ ```powershell
126
+ $body = @{
127
+ url = "https://notebooklm.google.com/notebook/505ee4b1-ad05-4673-a06b-1ec106c2b940"
128
+ name = "Parents et Numérique"
129
+ description = "Conseils pour parents à l'ère du numérique"
130
+ topics = @("parentalité", "numérique", "éducation")
131
+ } | ConvertTo-Json
132
+
133
+ Invoke-RestMethod -Uri "http://localhost:3000/notebooks" `
134
+ -Method Post `
135
+ -Body $body `
136
+ -ContentType "application/json"
137
+ ```
138
+
139
+ **⏱️ Warning:** Adding takes 15-30 seconds because the server validates that the notebook actually exists.
140
+
141
+ ### 3. Add Other Notebooks
142
+
143
+ Repeat the operation for each notebook:
144
+
145
+ ```powershell
146
+ # Shakespeare Notebook
147
+ $body = @{
148
+ url = "https://notebooklm.google.com/notebook/19bde485-a9c1-4809-8884-e872b2b67b44"
149
+ name = "Shakespeare"
150
+ description = "William Shakespeare - L'intégrale des pièces"
151
+ topics = @("littérature", "théâtre", "Shakespeare")
152
+ tags = @("literature", "theater")
153
+ } | ConvertTo-Json
154
+
155
+ Invoke-RestMethod -Uri "http://localhost:3000/notebooks" `
156
+ -Method Post `
157
+ -Body $body `
158
+ -ContentType "application/json"
159
+ ```
160
+
161
+ ### 4. List Your Notebooks
162
+
163
+ ```bash
164
+ curl http://localhost:3000/notebooks
165
+ ```
166
+
167
+ **PowerShell:**
168
+
169
+ ```powershell
170
+ Invoke-RestMethod -Uri "http://localhost:3000/notebooks"
171
+ ```
172
+
173
+ ---
174
+
175
+ ## 🎯 Usage
176
+
177
+ ### Using the Active Notebook
178
+
179
+ If a notebook is marked as active (`active_notebook_id`), no need to specify the ID:
180
+
181
+ ```bash
182
+ curl -X POST http://localhost:3000/ask \
183
+ -H "Content-Type: application/json" \
184
+ -d '{
185
+ "question": "Qu'\''est-ce que l'\''empathie?"
186
+ }'
187
+ ```
188
+
189
+ The server will automatically use the active notebook.
190
+
191
+ ### Using a Specific Notebook
192
+
193
+ To use a specific notebook, use `notebook_id`:
194
+
195
+ ```bash
196
+ curl -X POST http://localhost:3000/ask \
197
+ -H "Content-Type: application/json" \
198
+ -d '{
199
+ "question": "Quelles sont les principales pièces de Shakespeare?",
200
+ "notebook_id": "shakespeare"
201
+ }'
202
+ ```
203
+
204
+ ### Change the Active Notebook
205
+
206
+ ```bash
207
+ curl -X PUT http://localhost:3000/notebooks/shakespeare/activate
208
+ ```
209
+
210
+ **PowerShell:**
211
+
212
+ ```powershell
213
+ Invoke-RestMethod -Uri "http://localhost:3000/notebooks/shakespeare/activate" -Method Put
214
+ ```
215
+
216
+ ---
217
+
218
+ ## ✅ Automatic Validations
219
+
220
+ ### 1. URL Format
221
+
222
+ The server verifies that the URL is in NotebookLM format:
223
+
224
+ ✅ **Valid:**
225
+
226
+ ```
227
+ https://notebooklm.google.com/notebook/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
228
+ ```
229
+
230
+ ❌ **Invalid:**
231
+
232
+ ```
233
+ https://example.com/notebook
234
+ https://notebooklm.google.com/
235
+ https://notebooklm.google.com/notebook/
236
+ ```
237
+
238
+ ### 2. Live Validation (Existence)
239
+
240
+ When adding, the server:
241
+
242
+ 1. Creates a temporary session
243
+ 2. Opens the notebook in headless Chrome
244
+ 3. Verifies that the chat interface loads
245
+ 4. Closes the temporary session
246
+
247
+ **Detected errors:**
248
+
249
+ - Non-existent notebook
250
+ - Notebook without access (permissions)
251
+ - Incorrect URL
252
+ - Invalid notebook ID
253
+
254
+ **Error example:**
255
+
256
+ ```json
257
+ {
258
+ "success": false,
259
+ "error": "Invalid or inaccessible notebook.\n\nURL: https://notebooklm.google.com/notebook/invalid-id\n\nThe notebook page loaded but the chat interface was not found.\nThis usually means:\n- The notebook doesn't exist\n- You don't have access to this notebook\n- The notebook ID in the URL is incorrect\n\nPlease verify the URL by:\n1. Go to https://notebooklm.google.com\n2. Open the notebook manually\n3. Copy the exact URL from the address bar"
260
+ }
261
+ ```
262
+
263
+ ### 3. Duplicate Detection
264
+
265
+ The server blocks adding notebooks with the same name (case-insensitive):
266
+
267
+ ```bash
268
+ # First add: OK
269
+ POST /notebooks {"name": "Parents et Numérique", ...} # ✅
270
+
271
+ # Second add with same name: ERROR
272
+ POST /notebooks {"name": "parents et numérique", ...} # ❌ (case-insensitive)
273
+ ```
274
+
275
+ **Returned error:**
276
+
277
+ ```json
278
+ {
279
+ "success": false,
280
+ "error": "A notebook with the name 'Parents et Numérique' already exists.\n\nExisting notebook ID: parents-numerique\nURL: https://notebooklm.google.com/notebook/505ee4b1-ad05-4673-a06b-1ec106c2b940\n\nPlease use a different name, or update the existing notebook instead.\nTo update: PUT /notebooks/parents-numerique with new data\nTo delete: DELETE /notebooks/parents-numerique"
281
+ }
282
+ ```
283
+
284
+ ---
285
+
286
+ ## 📊 Usage Statistics
287
+
288
+ ### Automatic Counters
289
+
290
+ Each request to a notebook automatically increments:
291
+
292
+ - `use_count` - Total number of requests
293
+ - `last_used` - Last used timestamp
294
+
295
+ ### Get Statistics
296
+
297
+ ```bash
298
+ curl http://localhost:3000/notebooks
299
+ ```
300
+
301
+ The response includes metadata for each notebook:
302
+
303
+ ```json
304
+ {
305
+ "success": true,
306
+ "data": {
307
+ "notebooks": [
308
+ {
309
+ "id": "parents-numerique",
310
+ "name": "Parents et Numérique",
311
+ "use_count": 42,
312
+ "last_used": "2025-11-22T10:30:45.123Z",
313
+ ...
314
+ }
315
+ ]
316
+ }
317
+ }
318
+ ```
319
+
320
+ ### Most Used Notebook
321
+
322
+ The notebook with the most `use_count` appears in the health check:
323
+
324
+ ```bash
325
+ curl http://localhost:3000/health
326
+ ```
327
+
328
+ ```json
329
+ {
330
+ "success": true,
331
+ "data": {
332
+ "library_notebooks": 2,
333
+ "most_used": "parents-numerique"
334
+ }
335
+ }
336
+ ```
337
+
338
+ ---
339
+
340
+ ## 🗑️ Notebook Management
341
+
342
+ ### Delete a Notebook
343
+
344
+ ```bash
345
+ curl -X DELETE http://localhost:3000/notebooks/parents-numerique
346
+ ```
347
+
348
+ **Behavior:**
349
+
350
+ - Removes the notebook from library.json
351
+ - If it was the active notebook, automatically selects the first remaining notebook
352
+ - Open sessions on this notebook remain active
353
+
354
+ ### Notebook Details
355
+
356
+ ```bash
357
+ curl http://localhost:3000/notebooks/parents-numerique
358
+ ```
359
+
360
+ Returns all metadata:
361
+
362
+ ```json
363
+ {
364
+ "success": true,
365
+ "data": {
366
+ "notebook": {
367
+ "id": "parents-numerique",
368
+ "url": "https://notebooklm.google.com/notebook/505ee4b1-ad05-4673-a06b-1ec106c2b940",
369
+ "name": "Parents et Numérique",
370
+ "description": "Conseils pour parents à l'ère du numérique",
371
+ "topics": ["parentalité", "numérique", "éducation"],
372
+ "content_types": ["documentation", "examples"],
373
+ "use_cases": ["Conseils éducatifs", "Parentalité numérique", ...],
374
+ "added_at": "2025-11-22T08:49:16.735Z",
375
+ "last_used": "2025-11-22T09:30:45.123Z",
376
+ "use_count": 42,
377
+ "tags": ["psychology", "french"]
378
+ }
379
+ }
380
+ }
381
+ ```
382
+
383
+ ---
384
+
385
+ ## 🔍 Library Search
386
+
387
+ ### Search by Name, Description, Topics
388
+
389
+ Search is not yet exposed via the HTTP API, but it exists in the code:
390
+
391
+ ```typescript
392
+ // In src/library/notebook-library.ts:441
393
+ searchNotebooks(query: string): NotebookEntry[]
394
+ ```
395
+
396
+ Searches in:
397
+
398
+ - Notebook name
399
+ - Description
400
+ - Topics
401
+ - Tags
402
+
403
+ **Coming in a future version:** `GET /notebooks/search?q=empathie`
404
+
405
+ ---
406
+
407
+ ## 💡 Use Cases
408
+
409
+ ### 1. Multi-Project Workspace
410
+
411
+ You work on multiple projects with different notebooks:
412
+
413
+ ```json
414
+ {
415
+ "notebooks": [
416
+ {"id": "projet-a", "name": "Projet A - API Documentation", ...},
417
+ {"id": "projet-b", "name": "Projet B - User Research", ...},
418
+ {"id": "projet-c", "name": "Projet C - Technical Specs", ...}
419
+ ]
420
+ }
421
+ ```
422
+
423
+ Switch easily according to context:
424
+
425
+ ```bash
426
+ # Work on Project A
427
+ curl -X PUT http://localhost:3000/notebooks/projet-a/activate
428
+
429
+ # Ask questions (will use Project A)
430
+ curl -X POST http://localhost:3000/ask -d '{"question": "..."}'
431
+
432
+ # Switch to Project B
433
+ curl -X PUT http://localhost:3000/notebooks/projet-b/activate
434
+ ```
435
+
436
+ ### 2. Multi-Language Documentation
437
+
438
+ Notebooks for different languages:
439
+
440
+ ```json
441
+ {
442
+ "notebooks": [
443
+ {"id": "docs-fr", "name": "Documentation Française", ...},
444
+ {"id": "docs-en", "name": "English Documentation", ...},
445
+ {"id": "docs-es", "name": "Documentación Española", ...}
446
+ ]
447
+ }
448
+ ```
449
+
450
+ ### 3. Knowledge Domains
451
+
452
+ Notebooks by area of expertise:
453
+
454
+ ```json
455
+ {
456
+ "notebooks": [
457
+ {
458
+ "id": "psychology",
459
+ "name": "Psychology Resources",
460
+ "topics": ["mindfulness", "therapy", "CBT"]
461
+ },
462
+ { "id": "tech", "name": "Tech Documentation", "topics": ["React", "Node", "TypeScript"] },
463
+ { "id": "business", "name": "Business Knowledge", "topics": ["marketing", "sales"] }
464
+ ]
465
+ }
466
+ ```
467
+
468
+ ### 4. Environments (Dev/Staging/Prod)
469
+
470
+ Different notebooks for different environments:
471
+
472
+ ```json
473
+ {
474
+ "notebooks": [
475
+ {"id": "dev-kb", "name": "Dev Knowledge Base", ...},
476
+ {"id": "staging-kb", "name": "Staging Knowledge Base", ...},
477
+ {"id": "prod-kb", "name": "Production Knowledge Base", ...}
478
+ ]
479
+ }
480
+ ```
481
+
482
+ ---
483
+
484
+ ## 🔧 Advanced Configuration
485
+
486
+ ### Manually Edit library.json
487
+
488
+ Location: `%LOCALAPPDATA%\notebooklm-mcp\Data\library.json`
489
+
490
+ ```powershell
491
+ # Open in an editor
492
+ code "$env:LOCALAPPDATA\notebooklm-mcp\Data\library.json"
493
+
494
+ # Or notepad
495
+ notepad "$env:LOCALAPPDATA\notebooklm-mcp\Data\library.json"
496
+ ```
497
+
498
+ **⚠️ Warning:**
499
+
500
+ - Respect the JSON format (validate with a linter)
501
+ - Restart the server after manual modification
502
+ - Manual modifications do not go through validations
503
+
504
+ ### Export/Import the Library
505
+
506
+ **Export:**
507
+
508
+ ```powershell
509
+ Copy-Item "$env:LOCALAPPDATA\notebooklm-mcp\Data\library.json" `
510
+ -Destination "D:\backup\library-backup.json"
511
+ ```
512
+
513
+ **Import:**
514
+
515
+ ```powershell
516
+ Copy-Item "D:\backup\library-backup.json" `
517
+ -Destination "$env:LOCALAPPDATA\notebooklm-mcp\Data\library.json"
518
+ ```
519
+
520
+ ### Reset the Library
521
+
522
+ ```powershell
523
+ # Backup first
524
+ Copy-Item "$env:LOCALAPPDATA\notebooklm-mcp\Data\library.json" `
525
+ -Destination "$env:LOCALAPPDATA\notebooklm-mcp\Data\library-backup.json"
526
+
527
+ # Delete
528
+ Remove-Item "$env:LOCALAPPDATA\notebooklm-mcp\Data\library.json"
529
+
530
+ # Restart the server (will create an empty library)
531
+ ```
532
+
533
+ ---
534
+
535
+ ## 🐛 Troubleshooting
536
+
537
+ ### Problem: "Notebook not found in library"
538
+
539
+ **Cause:** No notebook configured or incorrect ID
540
+
541
+ **Solution:**
542
+
543
+ ```bash
544
+ # List available notebooks
545
+ curl http://localhost:3000/notebooks
546
+
547
+ # Verify the exact ID
548
+ # Use notebook_url directly if needed
549
+ curl -X POST http://localhost:3000/ask \
550
+ -d '{
551
+ "question": "...",
552
+ "notebook_url": "https://notebooklm.google.com/notebook/xxx"
553
+ }'
554
+ ```
555
+
556
+ ### Problem: Validation fails during addition
557
+
558
+ **Cause:** Inaccessible notebook or invalid URL
559
+
560
+ **Solution:**
561
+
562
+ 1. Verify that you are authenticated: `npm run setup-auth`
563
+ 2. Test the URL manually in Chrome
564
+ 3. Check notebook permissions (shared with your account?)
565
+ 4. Copy the URL directly from the address bar
566
+
567
+ ### Problem: "A notebook with the name 'X' already exists"
568
+
569
+ **Cause:** Duplicate name
570
+
571
+ **Solutions:**
572
+
573
+ ```bash
574
+ # Option 1: Use a different name
575
+ curl -X POST http://localhost:3000/notebooks \
576
+ -d '{"name": "Parents et Numérique v2", ...}'
577
+
578
+ # Option 2: Delete the old one
579
+ curl -X DELETE http://localhost:3000/notebooks/parents-numerique
580
+
581
+ # Option 3: Update the existing one (coming soon)
582
+ # PUT /notebooks/my-notebook
583
+ ```
584
+
585
+ ### Problem: Corrupted library.json
586
+
587
+ **Symptoms:** JSON errors at startup
588
+
589
+ **Solution:**
590
+
591
+ ```powershell
592
+ # Restore from backup if available
593
+ Copy-Item "$env:LOCALAPPDATA\notebooklm-mcp\Data\library-backup.json" `
594
+ -Destination "$env:LOCALAPPDATA\notebooklm-mcp\Data\library.json"
595
+
596
+ # Or delete and reset
597
+ Remove-Item "$env:LOCALAPPDATA\notebooklm-mcp\Data\library.json"
598
+ # Restart the server
599
+ ```
600
+
601
+ ---
602
+
603
+ ## 📝 Complete Examples
604
+
605
+ ### PowerShell Script: Add Multiple Notebooks
606
+
607
+ ```powershell
608
+ #!/usr/bin/env pwsh
609
+
610
+ # Configuration
611
+ $baseUrl = "http://localhost:3000"
612
+
613
+ # List of notebooks to add
614
+ $notebooks = @(
615
+ @{
616
+ url = "https://notebooklm.google.com/notebook/505ee4b1-ad05-4673-a06b-1ec106c2b940"
617
+ name = "Parents et Numérique"
618
+ description = "Conseils pour parents à l'ère du numérique"
619
+ topics = @("parentalité", "numérique", "éducation")
620
+ },
621
+ @{
622
+ url = "https://notebooklm.google.com/notebook/19bde485-a9c1-4809-8884-e872b2b67b44"
623
+ name = "Shakespeare"
624
+ description = "William Shakespeare - L'intégrale des pièces"
625
+ topics = @("littérature", "théâtre", "Shakespeare")
626
+ }
627
+ )
628
+
629
+ # Add each notebook
630
+ foreach ($notebook in $notebooks) {
631
+ Write-Host "Adding notebook: $($notebook.name)..." -ForegroundColor Cyan
632
+
633
+ $body = $notebook | ConvertTo-Json
634
+
635
+ try {
636
+ $result = Invoke-RestMethod `
637
+ -Uri "$baseUrl/notebooks" `
638
+ -Method Post `
639
+ -Body $body `
640
+ -ContentType "application/json"
641
+
642
+ Write-Host "✅ Added: $($result.data.notebook.id)" -ForegroundColor Green
643
+ }
644
+ catch {
645
+ Write-Host "❌ Error: $_" -ForegroundColor Red
646
+ }
647
+ }
648
+
649
+ # List all notebooks
650
+ Write-Host "`nNotebooks in library:" -ForegroundColor Cyan
651
+ $list = Invoke-RestMethod -Uri "$baseUrl/notebooks"
652
+ $list.data.notebooks | Format-Table id, name, use_count, active
653
+ ```
654
+
655
+ ### n8n Script: Workflow with Notebook Selection
656
+
657
+ ```json
658
+ {
659
+ "nodes": [
660
+ {
661
+ "name": "Select Notebook",
662
+ "type": "n8n-nodes-base.httpRequest",
663
+ "parameters": {
664
+ "method": "PUT",
665
+ "url": "http://localhost:3000/notebooks/{{$json[\"notebook_id\"]}}/activate"
666
+ }
667
+ },
668
+ {
669
+ "name": "Ask Question",
670
+ "type": "n8n-nodes-base.httpRequest",
671
+ "parameters": {
672
+ "method": "POST",
673
+ "url": "http://localhost:3000/ask",
674
+ "jsonParameters": true,
675
+ "bodyParametersJson": {
676
+ "question": "{{$json[\"question\"]}}"
677
+ }
678
+ }
679
+ }
680
+ ]
681
+ }
682
+ ```
683
+
684
+ ---
685
+
686
+ **Complete library guide!** ✅
687
+
688
+ For more information, see:
689
+
690
+ - [03-API.md](./03-API.md) - Complete API reference
691
+ - [01-INSTALL.md](./01-INSTALL.md) - Installation guide
692
+ - [05-TROUBLESHOOTING.md](./05-TROUBLESHOOTING.md) - Troubleshooting