@roomi-fields/notebooklm-mcp 1.3.6 → 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 (284) hide show
  1. package/LICENSE +22 -22
  2. package/README.md +71 -34
  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/accounts/account-manager.d.ts +163 -0
  32. package/dist/accounts/account-manager.d.ts.map +1 -0
  33. package/dist/accounts/account-manager.js +614 -0
  34. package/dist/accounts/account-manager.js.map +1 -0
  35. package/dist/accounts/auto-login-manager.d.ts +62 -0
  36. package/dist/accounts/auto-login-manager.d.ts.map +1 -0
  37. package/dist/accounts/auto-login-manager.js +537 -0
  38. package/dist/accounts/auto-login-manager.js.map +1 -0
  39. package/dist/accounts/crypto.d.ts +45 -0
  40. package/dist/accounts/crypto.d.ts.map +1 -0
  41. package/dist/accounts/crypto.js +138 -0
  42. package/dist/accounts/crypto.js.map +1 -0
  43. package/dist/accounts/index.d.ts +14 -0
  44. package/dist/accounts/index.d.ts.map +1 -0
  45. package/dist/accounts/index.js +14 -0
  46. package/dist/accounts/index.js.map +1 -0
  47. package/dist/accounts/types.d.ts +103 -0
  48. package/dist/accounts/types.d.ts.map +1 -0
  49. package/dist/accounts/types.js +7 -0
  50. package/dist/accounts/types.js.map +1 -0
  51. package/dist/auth/auth-manager.d.ts +9 -2
  52. package/dist/auth/auth-manager.d.ts.map +1 -1
  53. package/dist/auth/auth-manager.js +60 -6
  54. package/dist/auth/auth-manager.js.map +1 -1
  55. package/dist/auto-discovery/auto-discovery.d.ts.map +1 -1
  56. package/dist/auto-discovery/auto-discovery.js +2 -1
  57. package/dist/auto-discovery/auto-discovery.js.map +1 -1
  58. package/dist/cli/accounts.d.ts +13 -0
  59. package/dist/cli/accounts.d.ts.map +1 -0
  60. package/dist/cli/accounts.js +195 -0
  61. package/dist/cli/accounts.js.map +1 -0
  62. package/dist/config.d.ts +1 -0
  63. package/dist/config.d.ts.map +1 -1
  64. package/dist/config.js +24 -0
  65. package/dist/config.js.map +1 -1
  66. package/dist/content/content-generator.d.ts +153 -0
  67. package/dist/content/content-generator.d.ts.map +1 -0
  68. package/dist/content/content-generator.js +637 -0
  69. package/dist/content/content-generator.js.map +1 -0
  70. package/dist/content/content-manager.d.ts +364 -0
  71. package/dist/content/content-manager.d.ts.map +1 -0
  72. package/dist/content/content-manager.js +3841 -0
  73. package/dist/content/content-manager.js.map +1 -0
  74. package/dist/content/content-templates.d.ts +183 -0
  75. package/dist/content/content-templates.d.ts.map +1 -0
  76. package/dist/content/content-templates.js +719 -0
  77. package/dist/content/content-templates.js.map +1 -0
  78. package/dist/content/index.d.ts +14 -0
  79. package/dist/content/index.d.ts.map +1 -0
  80. package/dist/content/index.js +14 -0
  81. package/dist/content/index.js.map +1 -0
  82. package/dist/content/types.d.ts +285 -0
  83. package/dist/content/types.d.ts.map +1 -0
  84. package/dist/content/types.js +10 -0
  85. package/dist/content/types.js.map +1 -0
  86. package/dist/errors.d.ts +1 -1
  87. package/dist/errors.d.ts.map +1 -1
  88. package/dist/errors.js.map +1 -1
  89. package/dist/http-wrapper.d.ts +7 -0
  90. package/dist/http-wrapper.d.ts.map +1 -1
  91. package/dist/http-wrapper.js +449 -29
  92. package/dist/http-wrapper.js.map +1 -1
  93. package/dist/i18n/en.json +120 -0
  94. package/dist/i18n/fr.json +120 -0
  95. package/dist/i18n/index.d.ts +168 -0
  96. package/dist/i18n/index.d.ts.map +1 -0
  97. package/dist/i18n/index.js +213 -0
  98. package/dist/i18n/index.js.map +1 -0
  99. package/dist/index.js +26 -2
  100. package/dist/index.js.map +1 -1
  101. package/dist/library/notebook-library.d.ts +4 -0
  102. package/dist/library/notebook-library.d.ts.map +1 -1
  103. package/dist/library/notebook-library.js +20 -3
  104. package/dist/library/notebook-library.js.map +1 -1
  105. package/dist/session/browser-session.d.ts +35 -8
  106. package/dist/session/browser-session.d.ts.map +1 -1
  107. package/dist/session/browser-session.js +243 -28
  108. package/dist/session/browser-session.js.map +1 -1
  109. package/dist/session/session-manager.d.ts +6 -0
  110. package/dist/session/session-manager.d.ts.map +1 -1
  111. package/dist/session/session-manager.js +46 -14
  112. package/dist/session/session-manager.js.map +1 -1
  113. package/dist/session/shared-context-manager.d.ts +3 -3
  114. package/dist/session/shared-context-manager.d.ts.map +1 -1
  115. package/dist/session/shared-context-manager.js +10 -7
  116. package/dist/session/shared-context-manager.js.map +1 -1
  117. package/dist/stdio-http-proxy.d.ts +24 -0
  118. package/dist/stdio-http-proxy.d.ts.map +1 -0
  119. package/dist/stdio-http-proxy.js +592 -0
  120. package/dist/stdio-http-proxy.js.map +1 -0
  121. package/dist/tools/index.d.ts +106 -1
  122. package/dist/tools/index.d.ts.map +1 -1
  123. package/dist/tools/index.js +1028 -7
  124. package/dist/tools/index.js.map +1 -1
  125. package/dist/types.d.ts +81 -17
  126. package/dist/types.d.ts.map +1 -1
  127. package/dist/utils/citation-extractor.d.ts +66 -0
  128. package/dist/utils/citation-extractor.d.ts.map +1 -0
  129. package/dist/utils/citation-extractor.js +492 -0
  130. package/dist/utils/citation-extractor.js.map +1 -0
  131. package/dist/utils/page-utils.d.ts +8 -0
  132. package/dist/utils/page-utils.d.ts.map +1 -1
  133. package/dist/utils/page-utils.js +112 -8
  134. package/dist/utils/page-utils.js.map +1 -1
  135. package/docs/ADDING_A_LANGUAGE.md +209 -0
  136. package/docs/ARCHITECTURE_MIGRATION_STUDY.md +894 -0
  137. package/docs/CHROME_PROFILE_LIMITATION.md +15 -1
  138. package/docs/MULTI_ACCOUNT_SYSTEM.md +304 -0
  139. package/package.json +15 -12
  140. package/scripts/archive/add-and-activate-notebook.ps1 +31 -0
  141. package/scripts/archive/add-new-notebook.ps1 +25 -0
  142. package/scripts/archive/add-rom1pey.ps1 +2 -0
  143. package/scripts/archive/add-rpmonster.ps1 +2 -0
  144. package/scripts/archive/add-source-debug.ps1 +11 -0
  145. package/scripts/archive/add-source-e2e.ps1 +28 -0
  146. package/scripts/archive/add-source-visible.ps1 +11 -0
  147. package/scripts/archive/add-test-notebook.ps1 +13 -0
  148. package/scripts/archive/add-test-source.ps1 +50 -0
  149. package/scripts/archive/capture-screen.ps1 +11 -0
  150. package/scripts/archive/change-language.mjs +45 -0
  151. package/scripts/archive/change-language.ts +44 -0
  152. package/scripts/archive/check-account.ps1 +19 -0
  153. package/scripts/archive/check-notebook-2.ps1 +8 -0
  154. package/scripts/archive/check-test-notebook.ps1 +11 -0
  155. package/scripts/archive/create-notebook-auto.ps1 +31 -0
  156. package/scripts/archive/create-notebook.ps1 +8 -0
  157. package/scripts/archive/create-rom1pey-notebook.ps1 +19 -0
  158. package/scripts/archive/create-rom1pey.ps1 +8 -0
  159. package/scripts/archive/create-test-notebook-fresh.ps1 +21 -0
  160. package/scripts/archive/create-test-notebook.ps1 +16 -0
  161. package/scripts/archive/debug-add-source-auto.ps1 +29 -0
  162. package/scripts/archive/debug-add-source.ps1 +19 -0
  163. package/scripts/archive/debug-add-text-source.ps1 +47 -0
  164. package/scripts/archive/debug-home.ps1 +10 -0
  165. package/scripts/archive/debug-selectors.ps1 +55 -0
  166. package/scripts/archive/debug-sources-panel.ps1 +22 -0
  167. package/scripts/archive/debug-ui.ps1 +17 -0
  168. package/scripts/archive/discover-home.ps1 +26 -0
  169. package/scripts/archive/kill-automation-chrome.ps1 +37 -0
  170. package/scripts/archive/list-my-notebooks.ps1 +27 -0
  171. package/scripts/archive/navigate-home-visible.ps1 +23 -0
  172. package/scripts/archive/navigate-home.ps1 +15 -0
  173. package/scripts/archive/run-e2e-english.ps1 +111 -0
  174. package/scripts/archive/run-e2e-rom1pey-v2.ps1 +122 -0
  175. package/scripts/archive/run-e2e-rom1pey.ps1 +117 -0
  176. package/scripts/archive/setup-english-test.ps1 +36 -0
  177. package/scripts/archive/setup-test-notebook.ps1 +71 -0
  178. package/scripts/archive/simple-add-source.ps1 +14 -0
  179. package/scripts/archive/t10.ps1 +2 -0
  180. package/scripts/archive/t20.ps1 +4 -0
  181. package/scripts/archive/t30.ps1 +9 -0
  182. package/scripts/archive/t31.ps1 +11 -0
  183. package/scripts/archive/t32.ps1 +6 -0
  184. package/scripts/archive/t39.ps1 +5 -0
  185. package/scripts/archive/t40.ps1 +5 -0
  186. package/scripts/archive/t53.ps1 +12 -0
  187. package/scripts/archive/t54.ps1 +12 -0
  188. package/scripts/archive/t55.ps1 +11 -0
  189. package/scripts/archive/t9.ps1 +1 -0
  190. package/scripts/archive/test-access.ps1 +28 -0
  191. package/scripts/archive/test-add-delete-source.ps1 +64 -0
  192. package/scripts/archive/test-add-source-visible.ps1 +16 -0
  193. package/scripts/archive/test-add-source.ps1 +19 -0
  194. package/scripts/archive/test-add-text-debug.ps1 +28 -0
  195. package/scripts/archive/test-add-text-source.ps1 +8 -0
  196. package/scripts/archive/test-add-url-source.ps1 +7 -0
  197. package/scripts/archive/test-ask-ascii.ps1 +20 -0
  198. package/scripts/archive/test-ask-cnv.ps1 +20 -0
  199. package/scripts/archive/test-ask-headed.ps1 +51 -0
  200. package/scripts/archive/test-ask-ifs.ps1 +16 -0
  201. package/scripts/archive/test-ask-now.ps1 +24 -0
  202. package/scripts/archive/test-ask-real.ps1 +19 -0
  203. package/scripts/archive/test-ask-visible.ps1 +20 -0
  204. package/scripts/archive/test-create-notebook.ps1 +8 -0
  205. package/scripts/archive/test-create-then-add.ps1 +17 -0
  206. package/scripts/archive/test-delete-source.ps1 +41 -0
  207. package/scripts/archive/test-e2e-notebook.ps1 +21 -0
  208. package/scripts/archive/test-english-notebook.ps1 +20 -0
  209. package/scripts/archive/test-english.ps1 +7 -0
  210. package/scripts/archive/test-full-custom-instructions.ps1 +40 -0
  211. package/scripts/archive/test-full-infographic.ps1 +34 -0
  212. package/scripts/archive/test-full-language.ps1 +21 -0
  213. package/scripts/archive/test-full-presentation.ps1 +85 -0
  214. package/scripts/archive/test-full-report.ps1 +34 -0
  215. package/scripts/archive/test-full-source-selection.ps1 +35 -0
  216. package/scripts/archive/test-full-video-brief.ps1 +22 -0
  217. package/scripts/archive/test-full-video-explainer.ps1 +22 -0
  218. package/scripts/archive/test-full-video-styles.ps1 +37 -0
  219. package/scripts/archive/test-generate-report.ps1 +15 -0
  220. package/scripts/archive/test-generate-study-guide.ps1 +11 -0
  221. package/scripts/archive/test-headed-ask.ps1 +13 -0
  222. package/scripts/archive/test-headed-now.ps1 +9 -0
  223. package/scripts/archive/test-headed.ps1 +9 -0
  224. package/scripts/archive/test-hello.ps1 +7 -0
  225. package/scripts/archive/test-i18n-studio.ps1 +8 -0
  226. package/scripts/archive/test-i18n.ps1 +7 -0
  227. package/scripts/archive/test-manual-headed.ps1 +26 -0
  228. package/scripts/archive/test-mathieu-quota.ps1 +8 -0
  229. package/scripts/archive/test-notebook-1.ps1 +10 -0
  230. package/scripts/archive/test-notebook-2-sources.ps1 +12 -0
  231. package/scripts/archive/test-notebook1.ps1 +14 -0
  232. package/scripts/archive/test-personal-notebook.ps1 +14 -0
  233. package/scripts/archive/test-rate-limit.ps1 +19 -0
  234. package/scripts/archive/test-real-ask.ps1 +50 -0
  235. package/scripts/archive/test-real-ask2.ps1 +30 -0
  236. package/scripts/archive/test-rom1pey.ps1 +7 -0
  237. package/scripts/archive/test-rotation-complete.ps1 +14 -0
  238. package/scripts/archive/test-rotation.ps1 +8 -0
  239. package/scripts/archive/test-show-browser.ps1 +39 -0
  240. package/scripts/archive/test-update-notebook.ps1 +4 -0
  241. package/scripts/archive/verify-language-slow.ps1 +21 -0
  242. package/scripts/archive/verify-language.ps1 +15 -0
  243. package/scripts/check-server.ps1 +46 -0
  244. package/scripts/mcp-wsl-helper.sh +146 -0
  245. package/scripts/start-server.ps1 +94 -0
  246. package/scripts/stop-server.ps1 +30 -0
  247. package/scripts/switch-account-language.sh +191 -0
  248. package/scripts/test-account.ps1 +58 -0
  249. package/dist/__tests__/cleanup-manager.test.d.ts +0 -2
  250. package/dist/__tests__/cleanup-manager.test.d.ts.map +0 -1
  251. package/dist/__tests__/cleanup-manager.test.js +0 -341
  252. package/dist/__tests__/cleanup-manager.test.js.map +0 -1
  253. package/dist/__tests__/config-parsing.test.d.ts +0 -2
  254. package/dist/__tests__/config-parsing.test.d.ts.map +0 -1
  255. package/dist/__tests__/config-parsing.test.js +0 -338
  256. package/dist/__tests__/config-parsing.test.js.map +0 -1
  257. package/dist/__tests__/config.test.d.ts +0 -2
  258. package/dist/__tests__/config.test.d.ts.map +0 -1
  259. package/dist/__tests__/config.test.js +0 -267
  260. package/dist/__tests__/config.test.js.map +0 -1
  261. package/dist/__tests__/errors.test.d.ts +0 -2
  262. package/dist/__tests__/errors.test.d.ts.map +0 -1
  263. package/dist/__tests__/errors.test.js +0 -166
  264. package/dist/__tests__/errors.test.js.map +0 -1
  265. package/dist/__tests__/logger.test.d.ts +0 -2
  266. package/dist/__tests__/logger.test.d.ts.map +0 -1
  267. package/dist/__tests__/logger.test.js +0 -324
  268. package/dist/__tests__/logger.test.js.map +0 -1
  269. package/dist/__tests__/page-utils.test.d.ts +0 -2
  270. package/dist/__tests__/page-utils.test.d.ts.map +0 -1
  271. package/dist/__tests__/page-utils.test.js +0 -349
  272. package/dist/__tests__/page-utils.test.js.map +0 -1
  273. package/dist/__tests__/setup-verification.test.d.ts +0 -2
  274. package/dist/__tests__/setup-verification.test.d.ts.map +0 -1
  275. package/dist/__tests__/setup-verification.test.js +0 -15
  276. package/dist/__tests__/setup-verification.test.js.map +0 -1
  277. package/dist/__tests__/stealth-utils.test.d.ts +0 -2
  278. package/dist/__tests__/stealth-utils.test.d.ts.map +0 -1
  279. package/dist/__tests__/stealth-utils.test.js +0 -413
  280. package/dist/__tests__/stealth-utils.test.js.map +0 -1
  281. package/dist/__tests__/types.test.d.ts +0 -2
  282. package/dist/__tests__/types.test.d.ts.map +0 -1
  283. package/dist/__tests__/types.test.js +0 -461
  284. package/dist/__tests__/types.test.js.map +0 -1
@@ -1,6 +1,20 @@
1
1
  # Chrome Profile Limitation
2
2
 
3
- ## 🚨 Current Limitation (v1.3.2)
3
+ ## SOLVED: Use the Stdio-HTTP Proxy (v1.3.6+)
4
+
5
+ **The proxy mode allows Claude Desktop and HTTP server to run simultaneously!**
6
+
7
+ ```bash
8
+ # Terminal 1: Start HTTP server (owns Chrome)
9
+ npm run start:http
10
+
11
+ # Claude Desktop uses the proxy (no Chrome needed)
12
+ # See: deployment/docs/09-MULTI-INTERFACE.md
13
+ ```
14
+
15
+ ---
16
+
17
+ ## 🚨 Original Limitation (v1.3.2-v1.3.5)
4
18
 
5
19
  **The HTTP server and MCP stdio modes cannot run simultaneously** due to Chrome profile locking.
6
20
 
@@ -0,0 +1,304 @@
1
+ # Multi-Account Management System
2
+
3
+ ## Overview
4
+
5
+ The multi-account system enables industrial-grade authentication management for NotebookLM MCP by supporting:
6
+
7
+ - **Multiple Google accounts** with encrypted credential storage
8
+ - **Account pool rotation** with configurable strategies
9
+ - **Quota tracking** per account (50 queries/day free tier)
10
+ - **Automated login** with credential replay and interstitial handling
11
+ - **TOTP 2FA support** for accounts with two-factor authentication
12
+
13
+ ## Architecture
14
+
15
+ ```
16
+ ┌─────────────────────────────────────────────────────────────────┐
17
+ │ Account Management │
18
+ ├─────────────────────────────────────────────────────────────────┤
19
+ │ │
20
+ │ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
21
+ │ │ Account 1 │ │ Account 2 │ │ Account N │ │
22
+ │ │ (Primary) │ │ (Backup) │ │ (Pool) │ │
23
+ │ └──────┬──────┘ └──────┬──────┘ └──────┬──────┘ │
24
+ │ │ │ │ │
25
+ │ └──────────────────┴──────────────────┘ │
26
+ │ │ │
27
+ │ ┌────────▼────────┐ │
28
+ │ │ AccountManager │ │
29
+ │ │ - Pool logic │ │
30
+ │ │ - Rotation │ │
31
+ │ │ - Quota │ │
32
+ │ └────────┬────────┘ │
33
+ │ │ │
34
+ │ ┌────────▼────────┐ │
35
+ │ │ AutoLoginManager│ │
36
+ │ │ - Credential │ │
37
+ │ │ replay │ │
38
+ │ │ - 2FA/TOTP │ │
39
+ │ │ - Interstitial │ │
40
+ │ │ handling │ │
41
+ │ └─────────────────┘ │
42
+ │ │
43
+ └─────────────────────────────────────────────────────────────────┘
44
+ ```
45
+
46
+ ## Components
47
+
48
+ ### 1. Credential Encryption (`src/accounts/crypto.ts`)
49
+
50
+ - **Algorithm**: AES-256-GCM
51
+ - **Key Management**: Auto-generated encryption key stored securely
52
+ - **Storage**: Encrypted credentials in JSON format
53
+
54
+ ```typescript
55
+ // Example encrypted credential structure
56
+ {
57
+ emailEncrypted: "base64...",
58
+ passwordEncrypted: "base64...",
59
+ totpSecretEncrypted: "base64...", // Optional
60
+ encryptedAt: "2024-01-15T10:30:00Z"
61
+ }
62
+ ```
63
+
64
+ ### 2. Account Manager (`src/accounts/account-manager.ts`)
65
+
66
+ Manages the account pool with:
67
+
68
+ - **Account lifecycle**: Add, remove, enable/disable
69
+ - **Quota tracking**: Per-account usage limits
70
+ - **Rotation strategies**:
71
+ - `least_used`: Prefer accounts with lowest usage
72
+ - `round_robin`: Sequential rotation
73
+ - `failover`: Use primary until failure
74
+ - `random`: Random selection from pool
75
+
76
+ ### 3. Auto-Login Manager (`src/accounts/auto-login-manager.ts`)
77
+
78
+ Handles automated Google authentication:
79
+
80
+ - **Credential replay**: Email and password entry with human-like typing
81
+ - **TOTP 2FA**: Automatic code generation and entry
82
+ - **Interstitial handling**: Dismisses Google prompts (passkeys, security, etc.)
83
+ - **State persistence**: Saves authenticated session for reuse
84
+
85
+ ## Adding a New Account with 2FA (Complete Procedure)
86
+
87
+ ### Prerequisites
88
+
89
+ Before adding an account, ensure it has:
90
+
91
+ - A completed Google profile (date of birth, recovery email, etc.)
92
+ - TOTP-based 2FA enabled (Google Authenticator, not SMS)
93
+ - The TOTP secret key (base32 format, e.g., `JBSWY3DPEHPK3PXP`)
94
+
95
+ ### Step 1: Add the Account
96
+
97
+ Use a TypeScript script to avoid shell escaping issues with special characters in passwords:
98
+
99
+ ```typescript
100
+ // add-account.ts
101
+ import { AccountManager } from './src/accounts/account-manager.js';
102
+
103
+ const manager = new AccountManager();
104
+ await manager.initialize();
105
+
106
+ await manager.addAccount(
107
+ 'user@gmail.com',
108
+ 'P@ssw0rd!Special$Chars', // Special chars handled correctly
109
+ 'JBSWY3DPEHPK3PXP' // TOTP secret (no spaces)
110
+ );
111
+ ```
112
+
113
+ Run with:
114
+
115
+ ```bash
116
+ npx tsx add-account.ts
117
+ ```
118
+
119
+ ### Step 2: First Login (Headed Mode Required)
120
+
121
+ **CRITICAL**: The first login MUST be in headed mode (visible browser). Google blocks headless browsers for new account connections with "This browser or app may not be secure" error.
122
+
123
+ ```bash
124
+ npx tsx src/cli/accounts.ts test <account-id> --show
125
+ ```
126
+
127
+ This step:
128
+
129
+ - Opens a visible Chrome browser
130
+ - Automatically enters email, password, and TOTP code
131
+ - No human intervention required (fully automated)
132
+ - Establishes trust with Google for future headless logins
133
+ - Saves the authenticated session
134
+
135
+ ### Step 3: Verify Headless Mode Works
136
+
137
+ After the headed login succeeds, test headless mode:
138
+
139
+ ```bash
140
+ npx tsx src/cli/accounts.ts test <account-id>
141
+ ```
142
+
143
+ Expected output: `Already authenticated (session still valid)!`
144
+
145
+ ### Step 4: Share Notebooks (Optional)
146
+
147
+ If the account needs access to existing notebooks:
148
+
149
+ 1. Share notebooks from the owner account to the new account's email
150
+ 2. The new account can access shared notebooks immediately via direct URL
151
+ 3. No need for the new account to manually open the notebook first
152
+
153
+ ### Important Notes
154
+
155
+ | Aspect | Behavior |
156
+ | ------------------- | ---------------------------------------------- |
157
+ | First login | Must be headed (`--show`), but fully automated |
158
+ | Subsequent logins | Can be headless |
159
+ | TOTP handling | Automatic code generation and entry |
160
+ | Shared notebooks | Accessible immediately via URL |
161
+ | Session persistence | Saved to browser profile for reuse |
162
+ | Google anti-bot | Blocks headless on first login only |
163
+
164
+ ### Troubleshooting
165
+
166
+ **"This browser or app may not be secure"**
167
+
168
+ - Always use `--show` for the first login
169
+ - This is Google's anti-bot detection, not an account issue
170
+
171
+ **"Password field not found"**
172
+
173
+ - Usually means Google blocked the browser
174
+ - Run with `--show` to see what's happening
175
+
176
+ **TOTP code rejected**
177
+
178
+ - Verify the TOTP secret is correct (base32, no spaces)
179
+ - Check system time is synchronized
180
+
181
+ **Session expires quickly**
182
+
183
+ - Re-run the headed login to refresh the session
184
+ - Check that the browser profile isn't corrupted
185
+
186
+ ## CLI Commands
187
+
188
+ ```bash
189
+ # Add account (without 2FA)
190
+ npm run accounts add "user@gmail.com" "password"
191
+
192
+ # Add account (with TOTP) - USE SCRIPT FOR SPECIAL CHARS
193
+ npx tsx add-account.ts # Recommended for passwords with special characters
194
+
195
+ # List all accounts
196
+ npm run accounts list
197
+
198
+ # Test auto-login (headless)
199
+ npm run accounts test <account-id>
200
+
201
+ # Test auto-login (headed - REQUIRED for first login)
202
+ npm run accounts test <account-id> --show
203
+
204
+ # Check account health
205
+ npm run accounts health
206
+
207
+ # Set rotation strategy
208
+ npm run accounts strategy least_used
209
+
210
+ # Remove account
211
+ npm run accounts remove <account-id>
212
+ ```
213
+
214
+ ## Configuration
215
+
216
+ ### Data Storage
217
+
218
+ Account data is stored in the platform-specific data directory:
219
+
220
+ - **Windows**: `%APPDATA%\notebooklm-mcp\Data\accounts\`
221
+ - **Linux**: `~/.local/share/notebooklm-mcp/accounts/`
222
+ - **macOS**: `~/Library/Application Support/notebooklm-mcp/accounts/`
223
+
224
+ ### Files
225
+
226
+ | File | Description |
227
+ | ---------------------------------------- | ------------------------------------- |
228
+ | `accounts.json` | Account configurations and state |
229
+ | `encryption.key` | AES-256 encryption key (BACKUP THIS!) |
230
+ | `accounts/<id>/credentials.enc` | Encrypted credentials per account |
231
+ | `accounts/<id>/browser_state/state.json` | Session cookies per account |
232
+
233
+ ## Security Considerations
234
+
235
+ 1. **Encryption Key**: The encryption key (`encryption.key`) must be backed up securely. Lost key = lost credentials.
236
+
237
+ 2. **Credential Storage**: Credentials are encrypted at rest using AES-256-GCM.
238
+
239
+ 3. **Browser Profiles**: Each account has isolated browser profile data.
240
+
241
+ 4. **TOTP Secrets**: If stored, TOTP secrets are also encrypted.
242
+
243
+ ## Limitations
244
+
245
+ 1. **Google Account Requirements**: Accounts must have:
246
+ - Completed profile (date of birth, etc.)
247
+ - Standard password authentication enabled
248
+ - Optional: TOTP 2FA configured (not SMS/phone)
249
+
250
+ 2. **Google Security**: Google may still require additional verification for:
251
+ - New device/location
252
+ - Suspicious activity detection
253
+ - Captcha challenges
254
+
255
+ 3. **Rate Limits**: Google may rate-limit login attempts. Space out auto-login tests.
256
+
257
+ ## Usage Example
258
+
259
+ ```typescript
260
+ import { getAccountManager, AutoLoginManager } from './accounts/index.js';
261
+
262
+ // Get account manager
263
+ const manager = await getAccountManager();
264
+
265
+ // Add an account
266
+ const accountId = await manager.addAccount(
267
+ 'user@gmail.com',
268
+ 'password',
269
+ 'TOTP_SECRET' // optional
270
+ );
271
+
272
+ // Get best account based on rotation strategy
273
+ const selection = await manager.getBestAccount();
274
+ if (selection) {
275
+ console.log(`Using: ${selection.account.config.email}`);
276
+ console.log(`Reason: ${selection.reason}`);
277
+ }
278
+
279
+ // Perform auto-login
280
+ const autoLogin = new AutoLoginManager(manager);
281
+ const result = await autoLogin.performAutoLogin(accountId, { showBrowser: true });
282
+
283
+ if (result.success) {
284
+ console.log('Login successful!');
285
+ } else {
286
+ console.log(`Login failed: ${result.error}`);
287
+ if (result.requiresManualIntervention) {
288
+ console.log('Manual verification required');
289
+ }
290
+ }
291
+
292
+ // Record usage (for quota tracking)
293
+ await manager.recordUsage(accountId);
294
+
295
+ // Check health of all accounts
296
+ const health = await manager.healthCheck();
297
+ ```
298
+
299
+ ## Future Enhancements
300
+
301
+ 1. **Session Manager Integration**: Coordinate account selection with SessionManager
302
+ 2. **Auto-refresh**: Background session keep-alive with cookie refresh
303
+ 3. **Quota Alerts**: Notifications when approaching quota limits
304
+ 4. **Account Analytics**: Usage patterns and optimization suggestions
package/package.json CHANGED
@@ -1,24 +1,23 @@
1
1
  {
2
2
  "name": "@roomi-fields/notebooklm-mcp",
3
- "version": "1.3.6",
3
+ "version": "1.5.1",
4
4
  "description": "MCP server for NotebookLM API with HTTP REST API - Zero hallucinations from your notebooks",
5
5
  "type": "module",
6
6
  "bin": {
7
- "notebooklm-mcp": "dist/index.js"
7
+ "notebooklm-mcp": "dist/index.js",
8
+ "notebooklm-mcp-proxy": "dist/stdio-http-proxy.js"
8
9
  },
9
10
  "scripts": {
10
11
  "help": "node dist/cli/help.js",
11
12
  "setup-auth": "node dist/cli/setup-auth.js",
12
13
  "de-auth": "node dist/cli/de-auth.js",
14
+ "accounts": "node dist/cli/accounts.js",
13
15
  "start:http": "node dist/http-wrapper.js",
16
+ "start:proxy": "node dist/stdio-http-proxy.js",
14
17
  "dev:http": "tsx watch src/http-wrapper.ts",
15
- "daemon:start": "pm2 start ecosystem.config.cjs",
16
- "daemon:stop": "pm2 stop notebooklm-mcp",
17
- "daemon:restart": "pm2 restart notebooklm-mcp",
18
- "daemon:logs": "pm2 logs notebooklm-mcp",
19
- "daemon:status": "pm2 status",
20
- "daemon:delete": "pm2 delete notebooklm-mcp",
21
- "build": "tsc",
18
+ "dev:proxy": "tsx watch src/stdio-http-proxy.ts",
19
+ "build": "tsc && npm run build:i18n",
20
+ "build:i18n": "node -e \"require('fs').cpSync('src/i18n', 'dist/i18n', {recursive: true, filter: (s) => s.endsWith('.json') || require('fs').statSync(s).isDirectory()})\"",
22
21
  "watch": "tsc --watch",
23
22
  "dev": "tsx watch src/index.ts",
24
23
  "prepare": "husky",
@@ -27,7 +26,9 @@
27
26
  "test:coverage": "node --experimental-vm-modules node_modules/jest/bin/jest.js --coverage",
28
27
  "test:ci": "node --experimental-vm-modules node_modules/jest/bin/jest.js --ci --coverage --reporters=default",
29
28
  "test:unit": "node --experimental-vm-modules node_modules/jest/bin/jest.js --testPathPatterns=unit",
30
- "test:integration": "node --experimental-vm-modules node_modules/jest/bin/jest.js --testPathPatterns=integration"
29
+ "test:integration": "node --experimental-vm-modules node_modules/jest/bin/jest.js --testPathPatterns=integration",
30
+ "test:e2e": "powershell -ExecutionPolicy Bypass -File tests/e2e/run-e2e-tests.ps1",
31
+ "test:e2e:basic": "powershell -ExecutionPolicy Bypass -File tests/e2e/run-e2e-tests.ps1 -SkipBrowserTests"
31
32
  },
32
33
  "keywords": [
33
34
  "mcp",
@@ -59,7 +60,9 @@
59
60
  "README.md",
60
61
  "NOTEBOOKLM_USAGE.md",
61
62
  "LICENSE",
62
- "docs"
63
+ "docs",
64
+ "scripts",
65
+ "deployment"
63
66
  ],
64
67
  "dependencies": {
65
68
  "@modelcontextprotocol/sdk": "^1.0.0",
@@ -68,6 +71,7 @@
68
71
  "env-paths": "^3.0.0",
69
72
  "express": "^4.18.2",
70
73
  "globby": "^14.1.0",
74
+ "otplib": "^12.0.1",
71
75
  "patchright": "^1.48.2",
72
76
  "zod": "^3.22.0"
73
77
  },
@@ -84,7 +88,6 @@
84
88
  "husky": "^9.1.7",
85
89
  "jest": "^30.2.0",
86
90
  "lint-staged": "^16.2.7",
87
- "pm2": "^6.0.14",
88
91
  "prettier": "^3.6.2",
89
92
  "ts-jest": "^29.4.5",
90
93
  "tsx": "^4.7.0",
@@ -0,0 +1,31 @@
1
+ # Add the newly created notebook to library and activate it
2
+ Write-Host "=== Adding and activating new notebook ===" -ForegroundColor Cyan
3
+
4
+ # Add the notebook
5
+ $addBody = @{
6
+ name = "e2e-rom1pey-test"
7
+ url = "https://notebooklm.google.com/notebook/725d28e1-4284-4f36-99a2-b6693c2ebf13"
8
+ description = "E2E test notebook owned by rom1pey"
9
+ } | ConvertTo-Json
10
+
11
+ Write-Host "Adding notebook to library..."
12
+ try {
13
+ $response = Invoke-RestMethod -Uri "http://localhost:3000/notebooks" -Method POST -ContentType "application/json" -Body $addBody -TimeoutSec 60
14
+ Write-Host "Added: $($response.success)" -ForegroundColor Green
15
+ } catch {
16
+ Write-Host "Already exists or error: $($_.Exception.Message)" -ForegroundColor Yellow
17
+ }
18
+
19
+ # Activate it
20
+ Write-Host "`nActivating notebook..."
21
+ try {
22
+ $response = Invoke-RestMethod -Uri "http://localhost:3000/notebooks/e2e-rom1pey-test/activate" -Method PUT -TimeoutSec 30
23
+ Write-Host "Activated: $($response.success)" -ForegroundColor Green
24
+ } catch {
25
+ Write-Host "Error: $($_.Exception.Message)" -ForegroundColor Red
26
+ }
27
+
28
+ # Verify
29
+ Write-Host "`nVerifying active notebook..."
30
+ $notebooks = Invoke-RestMethod -Uri "http://localhost:3000/notebooks" -Method GET
31
+ Write-Host "Active: $($notebooks.data.active_notebook_id)" -ForegroundColor Cyan
@@ -0,0 +1,25 @@
1
+ # Add the newly created notebook to library with all required fields
2
+ Write-Host "=== Adding notebook to library ===" -ForegroundColor Cyan
3
+
4
+ $body = @{
5
+ name = "e2e-rom1pey-test"
6
+ url = "https://notebooklm.google.com/notebook/725d28e1-4284-4f36-99a2-b6693c2ebf13"
7
+ description = "E2E test notebook owned by rom1pey"
8
+ topics = @("test", "e2e", "rom1pey")
9
+ } | ConvertTo-Json
10
+
11
+ Write-Host "Body: $body"
12
+ Write-Host "`nSending request..."
13
+
14
+ try {
15
+ $response = Invoke-RestMethod -Uri "http://localhost:3000/notebooks" -Method POST -ContentType "application/json" -Body $body -TimeoutSec 120
16
+ Write-Host "Success: $($response.success)" -ForegroundColor Green
17
+ Write-Host "Notebook ID: $($response.data.notebook.id)"
18
+ } catch {
19
+ Write-Host "Error: $($_.Exception.Message)" -ForegroundColor Red
20
+
21
+ # Get response body
22
+ $streamReader = [System.IO.StreamReader]::new($_.Exception.Response.GetResponseStream())
23
+ $responseBody = $streamReader.ReadToEnd()
24
+ Write-Host "Response: $responseBody" -ForegroundColor Yellow
25
+ }
@@ -0,0 +1,2 @@
1
+ cd D:\Claude\notebooklm-mcp-http
2
+ npm run accounts add "rom1pey@gmail.com" "qZa!8A!Dm7S@vsnU" "ozzt dbdy d4po icw7 msk3 dc3s 33xc 3v36"
@@ -0,0 +1,2 @@
1
+ cd D:\Claude\notebooklm-mcp-http
2
+ npm run accounts add "rpmonster@gmail.com" 'w^mXCKl$o7aaJpp!' "e6ty a6dz jckj 5ogf m4yi vabs 4ttg x3tl"
@@ -0,0 +1,11 @@
1
+ $body = @{
2
+ source_type = "text"
3
+ title = "Test Source"
4
+ text = "Test document for E2E."
5
+ notebook_url = "https://notebooklm.google.com/notebook/abd21688-02a6-4459-953b-30f0612a984e"
6
+ show_browser = $true
7
+ } | ConvertTo-Json
8
+
9
+ Write-Host "Adding source (visible browser)..."
10
+ $response = Invoke-RestMethod -Uri "http://localhost:3000/content/sources" -Method POST -ContentType "application/json" -Body $body -TimeoutSec 180
11
+ $response | ConvertTo-Json -Depth 5
@@ -0,0 +1,28 @@
1
+ # Add source to test notebook with proper cleanup
2
+ $testNotebookUrl = "https://notebooklm.google.com/notebook/abd21688-02a6-4459-953b-30f0612a984e"
3
+
4
+ Write-Host "Adding text source to test notebook..." -ForegroundColor Cyan
5
+
6
+ $sourceBody = @{
7
+ source_type = "text"
8
+ title = "E2E Test Document"
9
+ text = "# E2E Test Document`n`nThis is a test document for E2E testing.`n`n## Features`n- HTTP REST API`n- Browser automation`n- Multi-account support`n`n## Technical`n1. Express.js wrapper`n2. Playwright sessions`n3. Content manager"
10
+ notebook_url = $testNotebookUrl
11
+ } | ConvertTo-Json
12
+
13
+ try {
14
+ $result = Invoke-RestMethod -Uri "http://localhost:3000/content/sources" -Method POST -ContentType "application/json" -Body $sourceBody -TimeoutSec 90
15
+ Write-Host "Result:" -ForegroundColor Yellow
16
+ $result | ConvertTo-Json -Depth 5
17
+ } catch {
18
+ Write-Host "Error: $($_.Exception.Message)" -ForegroundColor Red
19
+ }
20
+
21
+ # Close all sessions after operation
22
+ Write-Host "`nCleaning up sessions..." -ForegroundColor Cyan
23
+ $sessions = Invoke-RestMethod -Uri "http://localhost:3000/sessions" -Method GET
24
+ foreach ($session in $sessions.data.sessions) {
25
+ Write-Host " Closing session $($session.id)..."
26
+ Invoke-RestMethod -Uri "http://localhost:3000/sessions/$($session.id)" -Method DELETE -ErrorAction SilentlyContinue | Out-Null
27
+ }
28
+ Write-Host "Done." -ForegroundColor Green
@@ -0,0 +1,11 @@
1
+ $body = @{
2
+ source_type = "text"
3
+ title = "E2E Test Source"
4
+ text = "# E2E Test`n`nTest document for E2E testing. Contains info about NotebookLM MCP Server.`n`n## Features`n- REST API`n- Browser automation`n- Multi-account"
5
+ notebook_url = "https://notebooklm.google.com/notebook/abd21688-02a6-4459-953b-30f0612a984e"
6
+ show_browser = $true
7
+ } | ConvertTo-Json
8
+
9
+ Write-Host "Adding source (visible browser)..."
10
+ $response = Invoke-RestMethod -Uri "http://localhost:3000/content/sources" -Method POST -ContentType "application/json" -Body $body -TimeoutSec 120
11
+ $response | ConvertTo-Json -Depth 5
@@ -0,0 +1,13 @@
1
+ # Add test notebook to library (no browser needed)
2
+ $testNotebookUrl = "https://notebooklm.google.com/notebook/abd21688-02a6-4459-953b-30f0612a984e"
3
+
4
+ $addBody = @{
5
+ url = $testNotebookUrl
6
+ name = "E2E-Test-Notebook"
7
+ description = "Notebook for E2E testing - can be modified/deleted"
8
+ topics = @("test", "e2e", "automation")
9
+ } | ConvertTo-Json
10
+
11
+ Write-Host "Adding test notebook to library..."
12
+ $result = Invoke-RestMethod -Uri "http://localhost:3000/notebooks" -Method POST -ContentType "application/json" -Body $addBody -TimeoutSec 10
13
+ $result | ConvertTo-Json -Depth 3
@@ -0,0 +1,50 @@
1
+ # Add source to test notebook with proper cleanup
2
+ $testNotebookUrl = "https://notebooklm.google.com/notebook/abd21688-02a6-4459-953b-30f0612a984e"
3
+
4
+ Write-Host "Adding text source to test notebook..." -ForegroundColor Cyan
5
+
6
+ $sourceBody = @{
7
+ source_type = "text"
8
+ title = "E2E Test Document"
9
+ text = @"
10
+ # E2E Test Document
11
+
12
+ This is a test document for End-to-End testing of the NotebookLM MCP HTTP Server.
13
+
14
+ ## Section 1: Introduction
15
+ The NotebookLM MCP HTTP Server provides a REST API for interacting with Google NotebookLM.
16
+
17
+ ## Section 2: Features
18
+ - Asking questions about notebook content
19
+ - Adding and managing sources
20
+ - Generating audio overviews, presentations, and reports
21
+ - Creating and managing notes
22
+
23
+ ## Section 3: Technical Details
24
+ The architecture consists of:
25
+ 1. HTTP wrapper (Express.js)
26
+ 2. Session manager (Playwright browser sessions)
27
+ 3. Content manager (source and content operations)
28
+
29
+ This document should provide enough content for testing.
30
+ "@
31
+ notebook_url = $testNotebookUrl
32
+ } | ConvertTo-Json
33
+
34
+ try {
35
+ $result = Invoke-RestMethod -Uri "http://localhost:3000/content/sources" -Method POST -ContentType "application/json" -Body $sourceBody -TimeoutSec 90
36
+ Write-Host "Result:" -ForegroundColor Yellow
37
+ $result | ConvertTo-Json -Depth 5
38
+ } catch {
39
+ Write-Host "Error: $($_.Exception.Message)" -ForegroundColor Red
40
+ }
41
+
42
+ # Close all sessions after operation
43
+ Write-Host ""
44
+ Write-Host "Cleaning up sessions..." -ForegroundColor Cyan
45
+ $sessions = Invoke-RestMethod -Uri "http://localhost:3000/sessions" -Method GET
46
+ foreach ($session in $sessions.data.sessions) {
47
+ Write-Host " Closing session $($session.id)..."
48
+ Invoke-RestMethod -Uri "http://localhost:3000/sessions/$($session.id)" -Method DELETE -ErrorAction SilentlyContinue | Out-Null
49
+ }
50
+ Write-Host "Done." -ForegroundColor Green
@@ -0,0 +1,11 @@
1
+ # Just activate notebook and get content to take screenshot
2
+ Write-Host "Activating notebook-1..."
3
+ $response = Invoke-RestMethod -Uri "http://localhost:3000/notebooks/notebook-1/activate" -Method PUT
4
+ Write-Host "Activated"
5
+
6
+ # The server should have taken debug screenshots - check the data folder
7
+ Write-Host "`nChecking for debug screenshots..."
8
+ $debugPath = "C:\Users\romai\AppData\Local\notebooklm-mcp\Data"
9
+ Get-ChildItem $debugPath -Filter "*.png" | Sort-Object LastWriteTime -Descending | Select-Object -First 5 | ForEach-Object {
10
+ Write-Host " $($_.Name) - $($_.LastWriteTime)"
11
+ }
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Change Google account language to English
3
+ */
4
+ import { chromium } from 'patchright';
5
+ import path from 'path';
6
+ import readline from 'readline';
7
+
8
+ const ACCOUNT_ID = 'account-1767079146601'; // rom1pey@gmail.com
9
+ const DATA_DIR = 'C:\\Users\\romai\\AppData\\Local\\notebooklm-mcp\\Data';
10
+ const PROFILE_DIR = path.join(DATA_DIR, 'accounts', ACCOUNT_ID, 'profile');
11
+
12
+ async function changeLanguage() {
13
+ console.log('🌐 Opening browser with rom1pey profile...');
14
+ console.log(`📁 Profile: ${PROFILE_DIR}`);
15
+
16
+ const browser = await chromium.launchPersistentContext(PROFILE_DIR, {
17
+ headless: false,
18
+ channel: 'chrome',
19
+ viewport: { width: 1280, height: 800 },
20
+ });
21
+
22
+ const page = await browser.newPage();
23
+
24
+ console.log('🔗 Navigating to Google language settings...');
25
+ await page.goto('https://myaccount.google.com/language', { waitUntil: 'networkidle' });
26
+
27
+ // Wait for user to manually change language
28
+ console.log('\n' + '='.repeat(60));
29
+ console.log('👆 MANUAL STEP REQUIRED:');
30
+ console.log('1. Click the pencil icon next to your language');
31
+ console.log('2. Select "English (United States)" as primary language');
32
+ console.log('3. Press ENTER here when done');
33
+ console.log('='.repeat(60) + '\n');
34
+
35
+ // Wait for user input
36
+ const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
37
+ await new Promise((resolve) => rl.question('Press ENTER when done... ', resolve));
38
+ rl.close();
39
+
40
+ console.log('✅ Saving and closing browser...');
41
+ await browser.close();
42
+ console.log('🎉 Done! Language should now be English.');
43
+ }
44
+
45
+ changeLanguage().catch(console.error);