@roomi-fields/notebooklm-mcp 1.5.7 → 1.5.9

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 (295) hide show
  1. package/LICENSE +22 -22
  2. package/README.md +219 -219
  3. package/deployment/INDEX.md +0 -0
  4. package/deployment/PACKAGE-FILES.txt +180 -180
  5. package/deployment/QUICK-START.md +0 -0
  6. package/deployment/docs/01-INSTALL.md +21 -1
  7. package/deployment/docs/02-CONFIGURATION.md +0 -0
  8. package/deployment/docs/03-API.md +16 -10
  9. package/deployment/docs/04-N8N-INTEGRATION.md +0 -0
  10. package/deployment/docs/05-TROUBLESHOOTING.md +19 -1
  11. package/deployment/docs/06-NOTEBOOK-LIBRARY.md +9 -9
  12. package/deployment/docs/07-AUTO-DISCOVERY.md +6 -15
  13. package/deployment/docs/08-DOCKER.md +0 -0
  14. package/deployment/docs/08-WSL-USAGE.md +7 -7
  15. package/deployment/docs/09-MULTI-INTERFACE.md +6 -6
  16. package/deployment/docs/10-CONTENT-MANAGEMENT.md +15 -19
  17. package/deployment/docs/11-MULTI-ACCOUNT.md +1 -1
  18. package/deployment/docs/README.md +4 -50
  19. package/deployment/scripts/README.md +0 -0
  20. package/deployment/scripts/install.ps1 +114 -114
  21. package/deployment/scripts/setup-auth.ps1 +217 -217
  22. package/deployment/scripts/start-server.ps1 +72 -72
  23. package/deployment/scripts/stop-server.ps1 +51 -51
  24. package/deployment/scripts/test-api.ps1 +651 -651
  25. package/deployment/scripts/test-auth.ps1 +0 -0
  26. package/deployment/scripts/test-auto-discovery.ps1 +295 -295
  27. package/deployment/scripts/test-cors.ps1 +398 -398
  28. package/deployment/scripts/test-errors.ps1 +581 -581
  29. package/deployment/scripts/test-server.ps1 +140 -140
  30. package/deployment/scripts/test-sessions.ps1 +426 -426
  31. package/deployment/scripts/test-validation.ps1 +299 -299
  32. package/dist/accounts/account-manager.d.ts +0 -0
  33. package/dist/accounts/account-manager.d.ts.map +0 -0
  34. package/dist/accounts/account-manager.js +0 -0
  35. package/dist/accounts/account-manager.js.map +0 -0
  36. package/dist/accounts/auto-login-manager.d.ts +0 -0
  37. package/dist/accounts/auto-login-manager.d.ts.map +0 -0
  38. package/dist/accounts/auto-login-manager.js +0 -0
  39. package/dist/accounts/auto-login-manager.js.map +0 -0
  40. package/dist/accounts/crypto.d.ts +0 -0
  41. package/dist/accounts/crypto.d.ts.map +0 -0
  42. package/dist/accounts/crypto.js +0 -0
  43. package/dist/accounts/crypto.js.map +0 -0
  44. package/dist/accounts/index.d.ts +0 -0
  45. package/dist/accounts/index.d.ts.map +0 -0
  46. package/dist/accounts/index.js +0 -0
  47. package/dist/accounts/index.js.map +0 -0
  48. package/dist/accounts/types.d.ts +0 -0
  49. package/dist/accounts/types.d.ts.map +0 -0
  50. package/dist/accounts/types.js +0 -0
  51. package/dist/accounts/types.js.map +0 -0
  52. package/dist/auth/auth-manager.d.ts +0 -0
  53. package/dist/auth/auth-manager.d.ts.map +0 -0
  54. package/dist/auth/auth-manager.js +0 -0
  55. package/dist/auth/auth-manager.js.map +0 -0
  56. package/dist/auto-discovery/auto-discovery.d.ts +0 -0
  57. package/dist/auto-discovery/auto-discovery.d.ts.map +0 -0
  58. package/dist/auto-discovery/auto-discovery.js +0 -0
  59. package/dist/auto-discovery/auto-discovery.js.map +0 -0
  60. package/dist/cli/accounts.d.ts +0 -0
  61. package/dist/cli/accounts.d.ts.map +0 -0
  62. package/dist/cli/accounts.js +0 -0
  63. package/dist/cli/accounts.js.map +0 -0
  64. package/dist/cli/de-auth.d.ts +0 -0
  65. package/dist/cli/de-auth.d.ts.map +0 -0
  66. package/dist/cli/de-auth.js +0 -0
  67. package/dist/cli/de-auth.js.map +0 -0
  68. package/dist/cli/help.d.ts +0 -0
  69. package/dist/cli/help.d.ts.map +0 -0
  70. package/dist/cli/help.js +5 -0
  71. package/dist/cli/help.js.map +1 -1
  72. package/dist/cli/setup-auth.d.ts +0 -0
  73. package/dist/cli/setup-auth.d.ts.map +0 -0
  74. package/dist/cli/setup-auth.js +0 -0
  75. package/dist/cli/setup-auth.js.map +0 -0
  76. package/dist/config.d.ts +0 -0
  77. package/dist/config.d.ts.map +0 -0
  78. package/dist/config.js +0 -0
  79. package/dist/config.js.map +0 -0
  80. package/dist/content/content-generator.d.ts +0 -0
  81. package/dist/content/content-generator.d.ts.map +0 -0
  82. package/dist/content/content-generator.js +0 -0
  83. package/dist/content/content-generator.js.map +0 -0
  84. package/dist/content/content-manager.d.ts +8 -0
  85. package/dist/content/content-manager.d.ts.map +1 -1
  86. package/dist/content/content-manager.js +411 -67
  87. package/dist/content/content-manager.js.map +1 -1
  88. package/dist/content/content-templates.d.ts +0 -0
  89. package/dist/content/content-templates.d.ts.map +0 -0
  90. package/dist/content/content-templates.js +0 -0
  91. package/dist/content/content-templates.js.map +0 -0
  92. package/dist/content/index.d.ts +0 -0
  93. package/dist/content/index.d.ts.map +0 -0
  94. package/dist/content/index.js +0 -0
  95. package/dist/content/index.js.map +0 -0
  96. package/dist/content/types.d.ts +0 -0
  97. package/dist/content/types.d.ts.map +0 -0
  98. package/dist/content/types.js +0 -0
  99. package/dist/content/types.js.map +0 -0
  100. package/dist/errors.d.ts +0 -0
  101. package/dist/errors.d.ts.map +0 -0
  102. package/dist/errors.js +0 -0
  103. package/dist/errors.js.map +0 -0
  104. package/dist/http-wrapper.d.ts +0 -0
  105. package/dist/http-wrapper.d.ts.map +0 -0
  106. package/dist/http-wrapper.js +0 -0
  107. package/dist/http-wrapper.js.map +0 -0
  108. package/dist/i18n/en.json +0 -0
  109. package/dist/i18n/fr.json +0 -0
  110. package/dist/i18n/index.d.ts +0 -0
  111. package/dist/i18n/index.d.ts.map +0 -0
  112. package/dist/i18n/index.js +0 -0
  113. package/dist/i18n/index.js.map +0 -0
  114. package/dist/index.d.ts +0 -0
  115. package/dist/index.d.ts.map +0 -0
  116. package/dist/index.js +8 -3
  117. package/dist/index.js.map +1 -1
  118. package/dist/library/notebook-library.d.ts +0 -0
  119. package/dist/library/notebook-library.d.ts.map +0 -0
  120. package/dist/library/notebook-library.js +0 -0
  121. package/dist/library/notebook-library.js.map +0 -0
  122. package/dist/library/types.d.ts +0 -0
  123. package/dist/library/types.d.ts.map +0 -0
  124. package/dist/library/types.js +0 -0
  125. package/dist/library/types.js.map +0 -0
  126. package/dist/session/browser-session.d.ts +12 -0
  127. package/dist/session/browser-session.d.ts.map +1 -1
  128. package/dist/session/browser-session.js +156 -32
  129. package/dist/session/browser-session.js.map +1 -1
  130. package/dist/session/session-manager.d.ts +0 -0
  131. package/dist/session/session-manager.d.ts.map +0 -0
  132. package/dist/session/session-manager.js +0 -0
  133. package/dist/session/session-manager.js.map +0 -0
  134. package/dist/session/shared-context-manager.d.ts +0 -0
  135. package/dist/session/shared-context-manager.d.ts.map +0 -0
  136. package/dist/session/shared-context-manager.js +0 -0
  137. package/dist/session/shared-context-manager.js.map +0 -0
  138. package/dist/startup/startup-manager.d.ts +0 -0
  139. package/dist/startup/startup-manager.d.ts.map +0 -0
  140. package/dist/startup/startup-manager.js +0 -0
  141. package/dist/startup/startup-manager.js.map +0 -0
  142. package/dist/stdio-http-proxy.d.ts +0 -0
  143. package/dist/stdio-http-proxy.d.ts.map +0 -0
  144. package/dist/stdio-http-proxy.js +7 -2
  145. package/dist/stdio-http-proxy.js.map +1 -1
  146. package/dist/tools/index.d.ts +0 -0
  147. package/dist/tools/index.d.ts.map +0 -0
  148. package/dist/tools/index.js +0 -0
  149. package/dist/tools/index.js.map +0 -0
  150. package/dist/types.d.ts +0 -0
  151. package/dist/types.d.ts.map +0 -0
  152. package/dist/types.js +0 -0
  153. package/dist/types.js.map +0 -0
  154. package/dist/utils/citation-extractor.d.ts +0 -0
  155. package/dist/utils/citation-extractor.d.ts.map +0 -0
  156. package/dist/utils/citation-extractor.js +67 -67
  157. package/dist/utils/citation-extractor.js.map +0 -0
  158. package/dist/utils/cleanup-manager.d.ts +0 -0
  159. package/dist/utils/cleanup-manager.d.ts.map +0 -0
  160. package/dist/utils/cleanup-manager.js +0 -0
  161. package/dist/utils/cleanup-manager.js.map +0 -0
  162. package/dist/utils/logger.d.ts +0 -0
  163. package/dist/utils/logger.d.ts.map +0 -0
  164. package/dist/utils/logger.js +0 -0
  165. package/dist/utils/logger.js.map +0 -0
  166. package/dist/utils/page-utils.d.ts +5 -0
  167. package/dist/utils/page-utils.d.ts.map +1 -1
  168. package/dist/utils/page-utils.js +73 -15
  169. package/dist/utils/page-utils.js.map +1 -1
  170. package/dist/utils/stealth-utils.d.ts +0 -0
  171. package/dist/utils/stealth-utils.d.ts.map +0 -0
  172. package/dist/utils/stealth-utils.js +0 -0
  173. package/dist/utils/stealth-utils.js.map +0 -0
  174. package/docs/ADDING_A_LANGUAGE.md +0 -0
  175. package/docs/ARCHITECTURE_MIGRATION_STUDY.md +0 -0
  176. package/docs/CHROME_PROFILE_LIMITATION.md +0 -0
  177. package/docs/MULTI_ACCOUNT_SYSTEM.md +0 -0
  178. package/package.json +5 -2
  179. package/scripts/archive/add-and-activate-notebook.ps1 +4 -4
  180. package/scripts/archive/add-new-notebook.ps1 +4 -4
  181. package/scripts/archive/add-rom1pey.ps1 +2 -2
  182. package/scripts/archive/add-rpmonster.ps1 +2 -2
  183. package/scripts/archive/add-source-debug.ps1 +1 -1
  184. package/scripts/archive/add-source-e2e.ps1 +1 -1
  185. package/scripts/archive/add-source-visible.ps1 +1 -1
  186. package/scripts/archive/add-test-notebook.ps1 +1 -1
  187. package/scripts/archive/add-test-source.ps1 +1 -1
  188. package/scripts/archive/capture-screen.ps1 +1 -1
  189. package/scripts/archive/change-language.mjs +4 -3
  190. package/scripts/archive/change-language.ts +5 -3
  191. package/scripts/archive/check-account.ps1 +0 -0
  192. package/scripts/archive/check-notebook-2.ps1 +0 -0
  193. package/scripts/archive/check-test-notebook.ps1 +0 -0
  194. package/scripts/archive/create-notebook-auto.ps1 +0 -0
  195. package/scripts/archive/create-notebook.ps1 +2 -2
  196. package/scripts/archive/create-rom1pey-notebook.ps1 +2 -2
  197. package/scripts/archive/create-rom1pey.ps1 +2 -2
  198. package/scripts/archive/create-test-notebook-fresh.ps1 +0 -0
  199. package/scripts/archive/create-test-notebook.ps1 +0 -0
  200. package/scripts/archive/debug-add-source-auto.ps1 +0 -0
  201. package/scripts/archive/debug-add-source.ps1 +0 -0
  202. package/scripts/archive/debug-add-text-source.ps1 +4 -4
  203. package/scripts/archive/debug-home.ps1 +0 -0
  204. package/scripts/archive/debug-selectors.ps1 +1 -1
  205. package/scripts/archive/debug-sources-panel.ps1 +0 -0
  206. package/scripts/archive/debug-ui.ps1 +0 -0
  207. package/scripts/archive/discover-home.ps1 +2 -2
  208. package/scripts/archive/kill-automation-chrome.ps1 +0 -0
  209. package/scripts/archive/list-my-notebooks.ps1 +0 -0
  210. package/scripts/archive/navigate-home-visible.ps1 +1 -1
  211. package/scripts/archive/navigate-home.ps1 +1 -1
  212. package/scripts/archive/run-e2e-english.ps1 +3 -3
  213. package/scripts/archive/run-e2e-rom1pey-v2.ps1 +4 -4
  214. package/scripts/archive/run-e2e-rom1pey.ps1 +4 -4
  215. package/scripts/archive/setup-english-test.ps1 +6 -6
  216. package/scripts/archive/setup-test-notebook.ps1 +1 -1
  217. package/scripts/archive/simple-add-source.ps1 +1 -1
  218. package/scripts/archive/t10.ps1 +1 -1
  219. package/scripts/archive/t20.ps1 +1 -1
  220. package/scripts/archive/t30.ps1 +1 -1
  221. package/scripts/archive/t31.ps1 +1 -1
  222. package/scripts/archive/t32.ps1 +1 -1
  223. package/scripts/archive/t39.ps1 +0 -0
  224. package/scripts/archive/t40.ps1 +0 -0
  225. package/scripts/archive/t53.ps1 +1 -1
  226. package/scripts/archive/t54.ps1 +0 -0
  227. package/scripts/archive/t55.ps1 +0 -0
  228. package/scripts/archive/t9.ps1 +0 -0
  229. package/scripts/archive/test-access.ps1 +1 -1
  230. package/scripts/archive/test-add-delete-source.ps1 +4 -4
  231. package/scripts/archive/test-add-source-visible.ps1 +1 -1
  232. package/scripts/archive/test-add-source.ps1 +1 -1
  233. package/scripts/archive/test-add-text-debug.ps1 +2 -2
  234. package/scripts/archive/test-add-text-source.ps1 +0 -0
  235. package/scripts/archive/test-add-url-source.ps1 +0 -0
  236. package/scripts/archive/test-ask-ascii.ps1 +0 -0
  237. package/scripts/archive/test-ask-cnv.ps1 +0 -0
  238. package/scripts/archive/test-ask-headed.ps1 +1 -1
  239. package/scripts/archive/test-ask-ifs.ps1 +0 -0
  240. package/scripts/archive/test-ask-now.ps1 +0 -0
  241. package/scripts/archive/test-ask-real.ps1 +0 -0
  242. package/scripts/archive/test-ask-visible.ps1 +0 -0
  243. package/scripts/archive/test-create-notebook.ps1 +0 -0
  244. package/scripts/archive/test-create-then-add.ps1 +0 -0
  245. package/scripts/archive/test-delete-source.ps1 +4 -4
  246. package/scripts/archive/test-e2e-notebook.ps1 +2 -2
  247. package/scripts/archive/test-english-notebook.ps1 +4 -4
  248. package/scripts/archive/test-english.ps1 +1 -1
  249. package/scripts/archive/test-full-custom-instructions.ps1 +1 -1
  250. package/scripts/archive/test-full-infographic.ps1 +1 -1
  251. package/scripts/archive/test-full-language.ps1 +1 -1
  252. package/scripts/archive/test-full-presentation.ps1 +1 -1
  253. package/scripts/archive/test-full-report.ps1 +1 -1
  254. package/scripts/archive/test-full-source-selection.ps1 +1 -1
  255. package/scripts/archive/test-full-video-brief.ps1 +1 -1
  256. package/scripts/archive/test-full-video-explainer.ps1 +1 -1
  257. package/scripts/archive/test-full-video-styles.ps1 +1 -1
  258. package/scripts/archive/test-generate-report.ps1 +0 -0
  259. package/scripts/archive/test-generate-study-guide.ps1 +0 -0
  260. package/scripts/archive/test-headed-ask.ps1 +1 -1
  261. package/scripts/archive/test-headed-now.ps1 +2 -2
  262. package/scripts/archive/test-headed.ps1 +2 -2
  263. package/scripts/archive/test-hello.ps1 +1 -1
  264. package/scripts/archive/test-i18n-studio.ps1 +0 -0
  265. package/scripts/archive/test-i18n.ps1 +0 -0
  266. package/scripts/archive/test-manual-headed.ps1 +1 -1
  267. package/scripts/archive/test-mathieu-quota.ps1 +1 -1
  268. package/scripts/archive/test-notebook-1.ps1 +0 -0
  269. package/scripts/archive/test-notebook-2-sources.ps1 +0 -0
  270. package/scripts/archive/test-notebook1.ps1 +0 -0
  271. package/scripts/archive/test-personal-notebook.ps1 +1 -1
  272. package/scripts/archive/test-rate-limit.ps1 +1 -1
  273. package/scripts/archive/test-real-ask.ps1 +1 -1
  274. package/scripts/archive/test-real-ask2.ps1 +1 -1
  275. package/scripts/archive/test-rom1pey.ps1 +1 -1
  276. package/scripts/archive/test-rotation-complete.ps1 +1 -1
  277. package/scripts/archive/test-rotation.ps1 +2 -2
  278. package/scripts/archive/test-show-browser.ps1 +1 -1
  279. package/scripts/archive/test-update-notebook.ps1 +1 -1
  280. package/scripts/archive/verify-language-slow.ps1 +1 -1
  281. package/scripts/archive/verify-language.ps1 +1 -1
  282. package/scripts/check-server.ps1 +0 -0
  283. package/scripts/docker-entrypoint.sh +25 -25
  284. package/scripts/doctor.mjs +257 -0
  285. package/scripts/mcp-proxy-hidden.ps1 +0 -0
  286. package/scripts/mcp-wsl-helper.sh +146 -146
  287. package/scripts/start-server-hidden.vbs +13 -10
  288. package/scripts/start-server.ps1 +1 -1
  289. package/scripts/start-vnc.sh +0 -0
  290. package/scripts/stop-server.bat +0 -0
  291. package/scripts/stop-server.ps1 +0 -0
  292. package/scripts/switch-account-language.sh +87 -128
  293. package/scripts/test-account.ps1 +0 -0
  294. package/docs/archive/auto-discovery-complet.md +0 -906
  295. package/scripts/add-totp.ts +0 -110
@@ -1,146 +1,146 @@
1
- #!/bin/bash
2
- # NotebookLM MCP HTTP Server - WSL Helper Script
3
- # This script helps interact with the Windows-hosted MCP server from WSL
4
- #
5
- # Usage:
6
- # ./mcp-wsl-helper.sh start Start the server (Windows)
7
- # ./mcp-wsl-helper.sh stop Stop the server
8
- # ./mcp-wsl-helper.sh status Check if server is running
9
- # ./mcp-wsl-helper.sh health Get health status
10
- # ./mcp-wsl-helper.sh ask "question" Ask a question to the active notebook
11
- # ./mcp-wsl-helper.sh auth Launch authentication (opens Chrome)
12
-
13
- set -e
14
-
15
- MCP_PORT=3000
16
- MCP_DIR="D:/Claude/notebooklm-mcp-http"
17
-
18
- # Helper function to call the API via PowerShell (bypasses WSL network issues)
19
- call_api() {
20
- local method="$1"
21
- local endpoint="$2"
22
- local body="$3"
23
-
24
- if [ -n "$body" ]; then
25
- powershell.exe -Command "Invoke-RestMethod -Uri 'http://localhost:${MCP_PORT}${endpoint}' -Method ${method} -ContentType 'application/json' -Body '${body}' | ConvertTo-Json -Depth 10" 2>&1
26
- else
27
- powershell.exe -Command "Invoke-RestMethod -Uri 'http://localhost:${MCP_PORT}${endpoint}' -Method ${method} | ConvertTo-Json -Depth 10" 2>&1
28
- fi
29
- }
30
-
31
- # Check if server is running
32
- is_running() {
33
- cmd.exe /c "netstat -ano | findstr :${MCP_PORT} | findstr LISTENING" >/dev/null 2>&1
34
- }
35
-
36
- # Get server PID
37
- get_pid() {
38
- cmd.exe /c "netstat -ano | findstr :${MCP_PORT} | findstr LISTENING" 2>/dev/null | awk '{print $5}' | tr -d '\r'
39
- }
40
-
41
- case "$1" in
42
- start)
43
- if is_running; then
44
- echo "Server already running (PID: $(get_pid))"
45
- exit 0
46
- fi
47
- echo "Starting NotebookLM MCP HTTP Server..."
48
- powershell.exe -Command "Start-Process -NoNewWindow -FilePath 'node' -ArgumentList '${MCP_DIR}/dist/http-wrapper.js' -WorkingDirectory '${MCP_DIR}'" 2>&1
49
- sleep 3
50
- if is_running; then
51
- echo "Server started successfully (PID: $(get_pid))"
52
- echo "Health: http://localhost:${MCP_PORT}/health"
53
- else
54
- echo "Failed to start server"
55
- exit 1
56
- fi
57
- ;;
58
-
59
- stop)
60
- if ! is_running; then
61
- echo "Server not running"
62
- exit 0
63
- fi
64
- PID=$(get_pid)
65
- echo "Stopping server (PID: ${PID})..."
66
- cmd.exe /c "taskkill /PID ${PID} /F" 2>&1
67
- echo "Server stopped"
68
- ;;
69
-
70
- status)
71
- if is_running; then
72
- echo "Server is RUNNING (PID: $(get_pid))"
73
- echo ""
74
- call_api "GET" "/health"
75
- else
76
- echo "Server is STOPPED"
77
- exit 1
78
- fi
79
- ;;
80
-
81
- health)
82
- if ! is_running; then
83
- echo '{"success":false,"error":"Server not running"}'
84
- exit 1
85
- fi
86
- call_api "GET" "/health"
87
- ;;
88
-
89
- auth)
90
- if ! is_running; then
91
- echo "Server not running. Start it first with: $0 start"
92
- exit 1
93
- fi
94
- echo "Launching authentication (Chrome will open)..."
95
- call_api "POST" "/setup-auth" '{"show_browser": true}'
96
- ;;
97
-
98
- ask)
99
- if [ -z "$2" ]; then
100
- echo "Usage: $0 ask \"your question here\" [notebook_id]"
101
- exit 1
102
- fi
103
- if ! is_running; then
104
- echo '{"success":false,"error":"Server not running"}'
105
- exit 1
106
- fi
107
- QUESTION="$2"
108
- NOTEBOOK_ID="${3:-}"
109
-
110
- if [ -n "$NOTEBOOK_ID" ]; then
111
- BODY="{\"question\": \"${QUESTION}\", \"notebook_id\": \"${NOTEBOOK_ID}\"}"
112
- else
113
- BODY="{\"question\": \"${QUESTION}\"}"
114
- fi
115
-
116
- call_api "POST" "/ask" "$BODY"
117
- ;;
118
-
119
- notebooks)
120
- if ! is_running; then
121
- echo '{"success":false,"error":"Server not running"}'
122
- exit 1
123
- fi
124
- call_api "GET" "/notebooks"
125
- ;;
126
-
127
- *)
128
- echo "NotebookLM MCP HTTP Server - WSL Helper"
129
- echo ""
130
- echo "Usage: $0 <command> [args]"
131
- echo ""
132
- echo "Commands:"
133
- echo " start Start the server (Windows background process)"
134
- echo " stop Stop the server"
135
- echo " status Check server status and health"
136
- echo " health Get health status (JSON)"
137
- echo " auth Launch authentication (opens Chrome)"
138
- echo " ask \"question\" Ask a question to the active notebook"
139
- echo " notebooks List available notebooks"
140
- echo ""
141
- echo "Examples:"
142
- echo " $0 start"
143
- echo " $0 ask \"What is the main topic?\" my-notebook"
144
- echo " $0 status"
145
- ;;
146
- esac
1
+ #!/bin/bash
2
+ # NotebookLM MCP HTTP Server - WSL Helper Script
3
+ # This script helps interact with the Windows-hosted MCP server from WSL
4
+ #
5
+ # Usage:
6
+ # ./mcp-wsl-helper.sh start Start the server (Windows)
7
+ # ./mcp-wsl-helper.sh stop Stop the server
8
+ # ./mcp-wsl-helper.sh status Check if server is running
9
+ # ./mcp-wsl-helper.sh health Get health status
10
+ # ./mcp-wsl-helper.sh ask "question" Ask a question to the active notebook
11
+ # ./mcp-wsl-helper.sh auth Launch authentication (opens Chrome)
12
+
13
+ set -e
14
+
15
+ MCP_PORT=3000
16
+ MCP_DIR="D:/path/to/notebooklm-mcp"
17
+
18
+ # Helper function to call the API via PowerShell (bypasses WSL network issues)
19
+ call_api() {
20
+ local method="$1"
21
+ local endpoint="$2"
22
+ local body="$3"
23
+
24
+ if [ -n "$body" ]; then
25
+ powershell.exe -Command "Invoke-RestMethod -Uri 'http://localhost:${MCP_PORT}${endpoint}' -Method ${method} -ContentType 'application/json' -Body '${body}' | ConvertTo-Json -Depth 10" 2>&1
26
+ else
27
+ powershell.exe -Command "Invoke-RestMethod -Uri 'http://localhost:${MCP_PORT}${endpoint}' -Method ${method} | ConvertTo-Json -Depth 10" 2>&1
28
+ fi
29
+ }
30
+
31
+ # Check if server is running
32
+ is_running() {
33
+ cmd.exe /c "netstat -ano | findstr :${MCP_PORT} | findstr LISTENING" >/dev/null 2>&1
34
+ }
35
+
36
+ # Get server PID
37
+ get_pid() {
38
+ cmd.exe /c "netstat -ano | findstr :${MCP_PORT} | findstr LISTENING" 2>/dev/null | awk '{print $5}' | tr -d '\r'
39
+ }
40
+
41
+ case "$1" in
42
+ start)
43
+ if is_running; then
44
+ echo "Server already running (PID: $(get_pid))"
45
+ exit 0
46
+ fi
47
+ echo "Starting NotebookLM MCP HTTP Server..."
48
+ powershell.exe -Command "Start-Process -NoNewWindow -FilePath 'node' -ArgumentList '${MCP_DIR}/dist/http-wrapper.js' -WorkingDirectory '${MCP_DIR}'" 2>&1
49
+ sleep 3
50
+ if is_running; then
51
+ echo "Server started successfully (PID: $(get_pid))"
52
+ echo "Health: http://localhost:${MCP_PORT}/health"
53
+ else
54
+ echo "Failed to start server"
55
+ exit 1
56
+ fi
57
+ ;;
58
+
59
+ stop)
60
+ if ! is_running; then
61
+ echo "Server not running"
62
+ exit 0
63
+ fi
64
+ PID=$(get_pid)
65
+ echo "Stopping server (PID: ${PID})..."
66
+ cmd.exe /c "taskkill /PID ${PID} /F" 2>&1
67
+ echo "Server stopped"
68
+ ;;
69
+
70
+ status)
71
+ if is_running; then
72
+ echo "Server is RUNNING (PID: $(get_pid))"
73
+ echo ""
74
+ call_api "GET" "/health"
75
+ else
76
+ echo "Server is STOPPED"
77
+ exit 1
78
+ fi
79
+ ;;
80
+
81
+ health)
82
+ if ! is_running; then
83
+ echo '{"success":false,"error":"Server not running"}'
84
+ exit 1
85
+ fi
86
+ call_api "GET" "/health"
87
+ ;;
88
+
89
+ auth)
90
+ if ! is_running; then
91
+ echo "Server not running. Start it first with: $0 start"
92
+ exit 1
93
+ fi
94
+ echo "Launching authentication (Chrome will open)..."
95
+ call_api "POST" "/setup-auth" '{"show_browser": true}'
96
+ ;;
97
+
98
+ ask)
99
+ if [ -z "$2" ]; then
100
+ echo "Usage: $0 ask \"your question here\" [notebook_id]"
101
+ exit 1
102
+ fi
103
+ if ! is_running; then
104
+ echo '{"success":false,"error":"Server not running"}'
105
+ exit 1
106
+ fi
107
+ QUESTION="$2"
108
+ NOTEBOOK_ID="${3:-}"
109
+
110
+ if [ -n "$NOTEBOOK_ID" ]; then
111
+ BODY="{\"question\": \"${QUESTION}\", \"notebook_id\": \"${NOTEBOOK_ID}\"}"
112
+ else
113
+ BODY="{\"question\": \"${QUESTION}\"}"
114
+ fi
115
+
116
+ call_api "POST" "/ask" "$BODY"
117
+ ;;
118
+
119
+ notebooks)
120
+ if ! is_running; then
121
+ echo '{"success":false,"error":"Server not running"}'
122
+ exit 1
123
+ fi
124
+ call_api "GET" "/notebooks"
125
+ ;;
126
+
127
+ *)
128
+ echo "NotebookLM MCP HTTP Server - WSL Helper"
129
+ echo ""
130
+ echo "Usage: $0 <command> [args]"
131
+ echo ""
132
+ echo "Commands:"
133
+ echo " start Start the server (Windows background process)"
134
+ echo " stop Stop the server"
135
+ echo " status Check server status and health"
136
+ echo " health Get health status (JSON)"
137
+ echo " auth Launch authentication (opens Chrome)"
138
+ echo " ask \"question\" Ask a question to the active notebook"
139
+ echo " notebooks List available notebooks"
140
+ echo ""
141
+ echo "Examples:"
142
+ echo " $0 start"
143
+ echo " $0 ask \"What is the main topic?\" my-notebook"
144
+ echo " $0 status"
145
+ ;;
146
+ esac
@@ -1,13 +1,16 @@
1
- ' NotebookLM MCP Server - Démarrage silencieux
2
- ' Lance le serveur HTTP sans fenêtre visible
3
- ' Pour démarrage automatique : ajouter au dossier Démarrage Windows
1
+ ' NotebookLM MCP Server - hidden startup helper
2
+ ' Starts the HTTP server without opening a visible console window.
4
3
 
5
- Set WshShell = CreateObject("WScript.Shell")
6
- WshShell.CurrentDirectory = "D:\Claude\notebooklm-mcp-http"
4
+ Dim fso
5
+ Dim shell
6
+ Dim scriptDir
7
+ Dim projectDir
7
8
 
8
- ' Définir les variables d'environnement
9
- Set WshEnv = WshShell.Environment("Process")
10
- WshEnv("DATA_DIR") = "C:\Users\romai\AppData\Local\notebooklm-mcp\Data"
9
+ Set fso = CreateObject("Scripting.FileSystemObject")
10
+ Set shell = CreateObject("WScript.Shell")
11
11
 
12
- ' Lancer le serveur en mode caché (0 = hidden)
13
- WshShell.Run "node dist/http-wrapper.js", 0, False
12
+ scriptDir = fso.GetParentFolderName(WScript.ScriptFullName)
13
+ projectDir = fso.GetParentFolderName(scriptDir)
14
+
15
+ shell.CurrentDirectory = projectDir
16
+ shell.Run "node dist/http-wrapper.js", 0, False
@@ -11,7 +11,7 @@
11
11
 
12
12
  .EXAMPLE
13
13
  # Run in background (hidden window)
14
- Start-Process powershell -ArgumentList "-ExecutionPolicy Bypass -File D:\Claude\notebooklm-mcp-http\scripts\start-server.ps1" -WindowStyle Hidden
14
+ Start-Process powershell -ArgumentList "-ExecutionPolicy Bypass -File D:\path\to\notebooklm-mcp\scripts\start-server.ps1" -WindowStyle Hidden
15
15
  #>
16
16
 
17
17
  param(
File without changes
File without changes
File without changes
@@ -1,191 +1,150 @@
1
1
  #!/bin/bash
2
2
  # Switch Account Language Script
3
3
  #
4
- # This script automates the process of switching an account to a new language.
5
- # It deletes the Chrome profile cache and re-authenticates to get a fresh profile
6
- # with the new language settings from Google Account.
7
- #
8
- # PREREQUISITE: You must first change the language in Google Account settings:
9
- # https://myaccount.google.com/language
10
- #
11
- # Usage:
12
- # ./switch-account-language.sh --account=rom1pey --lang=en
13
- # ./switch-account-language.sh --account=mathieu --lang=fr
14
- # ./switch-account-language.sh --account=rpmonster --lang=en --show
4
+ # Refreshes one account profile after the user changes the Google Account
5
+ # language. This script is intentionally generic: you provide the account ID,
6
+ # repo root, and optionally the NotebookLM data directory.
15
7
 
16
- set -e
8
+ set -euo pipefail
17
9
 
18
- # Default values
19
- ACCOUNT=""
10
+ ACCOUNT_ID=""
20
11
  LANG=""
21
12
  SHOW_BROWSER=""
13
+ REPO_ROOT=""
14
+ DATA_PATH="${NOTEBOOKLM_DATA_PATH:-}"
15
+
16
+ usage() {
17
+ echo "Switch Account Language Script"
18
+ echo ""
19
+ echo "Prerequisite:"
20
+ echo " Change the Google Account language first:"
21
+ echo " https://myaccount.google.com/language"
22
+ echo ""
23
+ echo "Usage:"
24
+ echo " ./scripts/switch-account-language.sh --account-id=account-0000000000001 --lang=en --repo-root=/absolute/path/to/notebooklm-mcp"
25
+ echo ""
26
+ echo "Options:"
27
+ echo " --account-id=ID Account directory ID under Data/accounts/ (required)"
28
+ echo " --lang=LANG Target UI locale: en|fr (required)"
29
+ echo " --repo-root=PATH Repo root containing package.json (required unless run there)"
30
+ echo " --data-path=PATH NotebookLM data directory override"
31
+ echo " --show Show browser during re-authentication"
32
+ echo " --help Show this help"
33
+ }
22
34
 
23
- # Account configurations
24
- declare -A ACCOUNT_IDS=(
25
- ["mathieu"]="account-1766565732376"
26
- ["rpmonster"]="account-1767078713573"
27
- ["rom1pey"]="account-1767079146601"
28
- )
29
-
30
- declare -A ACCOUNT_EMAILS=(
31
- ["mathieu"]="mathieudumont31@gmail.com"
32
- ["rpmonster"]="rpmonster@gmail.com"
33
- ["rom1pey"]="rom1pey@gmail.com"
34
- )
35
-
36
- # Data path
37
- DATA_PATH="/mnt/c/Users/romai/AppData/Local/notebooklm-mcp/Data"
38
-
39
- # Parse arguments
40
35
  for arg in "$@"; do
41
36
  case $arg in
42
- --account=*)
43
- ACCOUNT="${arg#*=}"
37
+ --account-id=*)
38
+ ACCOUNT_ID="${arg#*=}"
44
39
  ;;
45
40
  --lang=*)
46
41
  LANG="${arg#*=}"
47
42
  ;;
43
+ --repo-root=*)
44
+ REPO_ROOT="${arg#*=}"
45
+ ;;
46
+ --data-path=*)
47
+ DATA_PATH="${arg#*=}"
48
+ ;;
48
49
  --show)
49
50
  SHOW_BROWSER="--show"
50
51
  ;;
51
52
  --help)
52
- echo "Switch Account Language Script"
53
- echo ""
54
- echo "PREREQUISITE: Change language in Google Account first:"
55
- echo " https://myaccount.google.com/language"
56
- echo ""
57
- echo "Usage: ./switch-account-language.sh [options]"
58
- echo ""
59
- echo "Options:"
60
- echo " --account=NAME Account: mathieu|rpmonster|rom1pey (required)"
61
- echo " --lang=LANG Target language: en|fr (required)"
62
- echo " --show Show browser during re-authentication"
63
- echo " --help Show this help"
64
- echo ""
65
- echo "Examples:"
66
- echo " ./switch-account-language.sh --account=rom1pey --lang=en"
67
- echo " ./switch-account-language.sh --account=mathieu --lang=fr --show"
53
+ usage
68
54
  exit 0
69
55
  ;;
56
+ *)
57
+ echo "ERROR: Unknown argument: $arg"
58
+ usage
59
+ exit 1
60
+ ;;
70
61
  esac
71
62
  done
72
63
 
73
- # Validate arguments
74
- if [ -z "$ACCOUNT" ]; then
75
- echo "ERROR: --account is required"
76
- echo "Use --help for usage information"
64
+ if [ -z "$ACCOUNT_ID" ]; then
65
+ echo "ERROR: --account-id is required"
66
+ usage
77
67
  exit 1
78
68
  fi
79
69
 
80
70
  if [ -z "$LANG" ]; then
81
71
  echo "ERROR: --lang is required"
82
- echo "Use --help for usage information"
72
+ usage
83
73
  exit 1
84
74
  fi
85
75
 
86
- if [ -z "${ACCOUNT_IDS[$ACCOUNT]}" ]; then
87
- echo "ERROR: Unknown account '$ACCOUNT'"
88
- echo "Valid accounts: mathieu, rpmonster, rom1pey"
76
+ if [ "$LANG" != "en" ] && [ "$LANG" != "fr" ]; then
77
+ echo "ERROR: --lang must be en or fr"
89
78
  exit 1
90
79
  fi
91
80
 
92
- if [ "$LANG" != "en" ] && [ "$LANG" != "fr" ]; then
93
- echo "ERROR: Invalid language '$LANG'"
94
- echo "Valid languages: en, fr"
81
+ if [ -z "$REPO_ROOT" ]; then
82
+ if [ -f "./package.json" ]; then
83
+ REPO_ROOT="$(pwd)"
84
+ else
85
+ echo "ERROR: --repo-root is required unless you run the script from the repo root"
86
+ exit 1
87
+ fi
88
+ fi
89
+
90
+ if [ ! -f "$REPO_ROOT/package.json" ]; then
91
+ echo "ERROR: package.json not found in repo root: $REPO_ROOT"
95
92
  exit 1
96
93
  fi
97
94
 
98
- ACCOUNT_ID="${ACCOUNT_IDS[$ACCOUNT]}"
99
- ACCOUNT_EMAIL="${ACCOUNT_EMAILS[$ACCOUNT]}"
95
+ if [ -z "$DATA_PATH" ]; then
96
+ if [ -n "${LOCALAPPDATA:-}" ]; then
97
+ DATA_PATH="${LOCALAPPDATA}/notebooklm-mcp/Data"
98
+ else
99
+ echo "ERROR: data path not set. Use --data-path or NOTEBOOKLM_DATA_PATH."
100
+ exit 1
101
+ fi
102
+ fi
100
103
 
101
- echo "╔════════════════════════════════════════════════════════════╗"
102
- echo " Switch Account Language ║"
103
- echo "╠════════════════════════════════════════════════════════════╣"
104
- echo " Account: $ACCOUNT ($ACCOUNT_EMAIL)"
105
- echo " Target: $LANG"
106
- echo "╚════════════════════════════════════════════════════════════╝"
104
+ echo "Switching account language"
105
+ echo " account-id: $ACCOUNT_ID"
106
+ echo " locale: $LANG"
107
+ echo " repo-root: $REPO_ROOT"
108
+ echo " data-path: $DATA_PATH"
107
109
  echo ""
108
110
 
109
- # Step 1: Stop server and Chrome
110
- echo "Step 1/5: Stopping server and Chrome..."
111
+ echo "Step 1/5: Stopping repo-related Node processes..."
111
112
  cmd.exe /c "taskkill /F /IM node.exe" 2>/dev/null || true
112
113
  sleep 1
113
- # Only kill Chrome if profile is locked (don't kill user's personal browser)
114
- if [ -f "$DATA_PATH/chrome_profile/lockfile" ] 2>/dev/null; then
115
- echo " Chrome profile locked, killing Chrome..."
116
- cmd.exe /c "taskkill /F /IM chrome.exe" 2>/dev/null || true
117
- sleep 2
118
- fi
119
- echo " Done."
120
114
 
121
- # Step 2: Delete account's Chrome profile (to clear language cache)
122
- echo ""
123
- echo "Step 2/5: Deleting Chrome profile cache for $ACCOUNT..."
115
+ echo "Step 2/5: Removing cached profile for the selected account..."
124
116
  ACCOUNT_PROFILE="$DATA_PATH/accounts/$ACCOUNT_ID/profile"
125
117
  if [ -d "$ACCOUNT_PROFILE" ]; then
126
118
  rm -rf "$ACCOUNT_PROFILE"
127
- echo " Deleted: $ACCOUNT_PROFILE"
119
+ echo " Removed $ACCOUNT_PROFILE"
128
120
  else
129
- echo " Profile not found (already clean)"
121
+ echo " No account profile found to remove"
130
122
  fi
131
- echo " Done."
132
-
133
- # Step 3: Re-authenticate to create fresh profile
134
- echo ""
135
- echo "Step 3/5: Re-authenticating $ACCOUNT..."
136
- echo " This will open a browser to log in with the new language settings."
137
- echo ""
138
123
 
139
- cd /mnt/d/Claude/notebooklm-mcp-http
140
- cmd.exe /c "cd /d D:\\Claude\\notebooklm-mcp-http && npm run accounts test $ACCOUNT_ID -- $SHOW_BROWSER"
141
-
142
- echo " Done."
143
-
144
- # Step 4: Sync new profile to main
145
- echo ""
146
- echo "Step 4/5: Syncing new profile to main..."
124
+ echo "Step 3/5: Re-authenticating the selected account..."
125
+ cmd.exe /c "cd /d $REPO_ROOT && npm run accounts test $ACCOUNT_ID -- $SHOW_BROWSER"
147
126
 
148
- # Sync state.json
127
+ echo "Step 4/5: Syncing the refreshed profile into the active data path..."
149
128
  if [ -f "$DATA_PATH/accounts/$ACCOUNT_ID/browser_state/state.json" ]; then
150
- cp "$DATA_PATH/accounts/$ACCOUNT_ID/browser_state/state.json" "$DATA_PATH/browser_state/"
151
- echo " Synced state.json"
129
+ mkdir -p "$DATA_PATH/browser_state"
130
+ cp "$DATA_PATH/accounts/$ACCOUNT_ID/browser_state/state.json" "$DATA_PATH/browser_state/state.json"
131
+ echo " Synced browser_state/state.json"
152
132
  else
153
- echo " WARNING: state.json not found"
133
+ echo " WARNING: browser_state/state.json not found for $ACCOUNT_ID"
154
134
  fi
155
135
 
156
- # Sync Chrome profile
157
136
  rm -rf "$DATA_PATH/chrome_profile" 2>/dev/null || true
158
137
  if [ -d "$DATA_PATH/accounts/$ACCOUNT_ID/profile" ]; then
159
138
  cp -r "$DATA_PATH/accounts/$ACCOUNT_ID/profile" "$DATA_PATH/chrome_profile"
160
- echo " Synced Chrome profile"
139
+ echo " Synced chrome_profile/"
161
140
  else
162
- echo " WARNING: Chrome profile not found"
141
+ echo " WARNING: refreshed profile not found for $ACCOUNT_ID"
163
142
  fi
164
- echo " Done."
165
143
 
166
- # Step 5: Restart server with correct locale
167
- echo ""
168
- echo "Step 5/5: Starting server with UI locale '$LANG'..."
169
-
170
- # Convert lang to uppercase for display
171
- LANG_UPPER=$(echo "$LANG" | tr '[:lower:]' '[:upper:]')
172
-
173
- cmd.exe /c "cd /d D:\\Claude\\notebooklm-mcp-http && set NOTEBOOKLM_UI_LOCALE=$LANG&& start /B node dist/http-wrapper.js" &
144
+ echo "Step 5/5: Restarting the HTTP server with the requested locale..."
145
+ cmd.exe /c "cd /d $REPO_ROOT && set NOTEBOOKLM_UI_LOCALE=$LANG&& start /B node dist/http-wrapper.js" >/dev/null
174
146
  sleep 4
175
147
 
176
- # Verify
177
- echo ""
178
- echo "Verifying server..."
179
- HEALTH=$(cmd.exe /c "curl -s http://localhost:3000/health" 2>/dev/null || echo '{"error":"failed"}')
180
- echo "$HEALTH" | head -c 200
181
-
182
- echo ""
183
148
  echo ""
184
- echo "╔════════════════════════════════════════════════════════════╗"
185
- echo "║ COMPLETED ║"
186
- echo "╠════════════════════════════════════════════════════════════╣"
187
- echo "║ Account '$ACCOUNT' is now configured for '$LANG_UPPER'."
188
- echo "║ ║"
189
- echo "║ IMPORTANT: Verify visually that NotebookLM UI is in $LANG_UPPER ║"
190
- echo "║ by running a test with show_browser:true ║"
191
- echo "╚════════════════════════════════════════════════════════════╝"
149
+ echo "Health check:"
150
+ cmd.exe /c "curl -s http://127.0.0.1:3000/health" || true
File without changes