@charlie.act7/gemini-notebook-mcp 2.1.3 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/README.md +446 -434
  2. package/dist/auth/auth-manager.d.ts +2 -2
  3. package/dist/auth/auth-manager.d.ts.map +1 -1
  4. package/dist/auth/auth-manager.js +27 -26
  5. package/dist/auth/auth-manager.js.map +1 -1
  6. package/dist/errors.d.ts +10 -1
  7. package/dist/errors.d.ts.map +1 -1
  8. package/dist/errors.js +19 -0
  9. package/dist/errors.js.map +1 -1
  10. package/dist/index.js +53 -17
  11. package/dist/index.js.map +1 -1
  12. package/dist/library/notebook-library.d.ts +7 -3
  13. package/dist/library/notebook-library.d.ts.map +1 -1
  14. package/dist/library/notebook-library.js +162 -14
  15. package/dist/library/notebook-library.js.map +1 -1
  16. package/dist/library/types.d.ts +18 -0
  17. package/dist/library/types.d.ts.map +1 -1
  18. package/dist/notebooklm/artifact-store.d.ts +26 -0
  19. package/dist/notebooklm/artifact-store.d.ts.map +1 -0
  20. package/dist/notebooklm/artifact-store.js +102 -0
  21. package/dist/notebooklm/artifact-store.js.map +1 -0
  22. package/dist/notebooklm/audio.d.ts.map +1 -1
  23. package/dist/notebooklm/audio.js +13 -37
  24. package/dist/notebooklm/audio.js.map +1 -1
  25. package/dist/notebooklm/chat.d.ts.map +1 -1
  26. package/dist/notebooklm/chat.js +22 -14
  27. package/dist/notebooklm/chat.js.map +1 -1
  28. package/dist/notebooklm/citations.d.ts +17 -22
  29. package/dist/notebooklm/citations.d.ts.map +1 -1
  30. package/dist/notebooklm/citations.js +148 -115
  31. package/dist/notebooklm/citations.js.map +1 -1
  32. package/dist/notebooklm/selectors.d.ts +54 -2
  33. package/dist/notebooklm/selectors.d.ts.map +1 -1
  34. package/dist/notebooklm/selectors.js +109 -2
  35. package/dist/notebooklm/selectors.js.map +1 -1
  36. package/dist/notebooklm/sources.d.ts +16 -1
  37. package/dist/notebooklm/sources.d.ts.map +1 -1
  38. package/dist/notebooklm/sources.js +123 -27
  39. package/dist/notebooklm/sources.js.map +1 -1
  40. package/dist/session/browser-session.d.ts +15 -9
  41. package/dist/session/browser-session.d.ts.map +1 -1
  42. package/dist/session/browser-session.js +123 -154
  43. package/dist/session/browser-session.js.map +1 -1
  44. package/dist/session/session-manager.d.ts +1 -1
  45. package/dist/session/session-manager.d.ts.map +1 -1
  46. package/dist/session/session-manager.js +47 -36
  47. package/dist/session/session-manager.js.map +1 -1
  48. package/dist/tools/definitions/notebook-management.d.ts.map +1 -1
  49. package/dist/tools/definitions/notebook-management.js +43 -0
  50. package/dist/tools/definitions/notebook-management.js.map +1 -1
  51. package/dist/tools/definitions/sources.d.ts +8 -0
  52. package/dist/tools/definitions/sources.d.ts.map +1 -1
  53. package/dist/tools/definitions/sources.js +144 -8
  54. package/dist/tools/definitions/sources.js.map +1 -1
  55. package/dist/tools/handlers.d.ts +94 -13
  56. package/dist/tools/handlers.d.ts.map +1 -1
  57. package/dist/tools/handlers.js +222 -19
  58. package/dist/tools/handlers.js.map +1 -1
  59. package/dist/tools/validation.d.ts.map +1 -1
  60. package/dist/tools/validation.js +108 -1
  61. package/dist/tools/validation.js.map +1 -1
  62. package/dist/transport/http.d.ts +2 -0
  63. package/dist/transport/http.d.ts.map +1 -1
  64. package/dist/transport/http.js +4 -0
  65. package/dist/transport/http.js.map +1 -1
  66. package/dist/types.d.ts +11 -0
  67. package/dist/types.d.ts.map +1 -1
  68. package/dist/utils/operation.d.ts +8 -0
  69. package/dist/utils/operation.d.ts.map +1 -0
  70. package/dist/utils/operation.js +42 -0
  71. package/dist/utils/operation.js.map +1 -0
  72. package/dist/utils/page-utils.d.ts.map +1 -1
  73. package/dist/utils/page-utils.js +3 -3
  74. package/dist/utils/page-utils.js.map +1 -1
  75. package/docs/configuration.md +184 -182
  76. package/docs/implementation-plan.md +26 -2
  77. package/docs/tools.md +469 -410
  78. package/docs/troubleshooting.md +176 -176
  79. package/docs/usage-guide.md +285 -285
  80. package/package.json +71 -69
@@ -1,183 +1,183 @@
1
- # Troubleshooting
2
-
1
+ # Troubleshooting
2
+
3
3
  A symptom → fix matrix for the current 2.x release. For the full env-var inventory, see [`configuration.md`](./configuration.md).
4
-
5
- ## Chrome fails to launch (macOS Tahoe / Windows exit 21)
6
-
7
- Symptom: `Failed to launch chrome`, `chrome exited immediately`, `code 21`, `executable doesn't exist`.
8
-
9
- Cause: System Chrome on macOS 26 (Tahoe) and certain Windows 11 setups crashes on the persistent profile launch.
10
-
11
- Fix: Force the bundled Patchright Chromium.
12
-
13
- ```bash
14
- BROWSER_CHANNEL=chromium npx notebooklm-mcp@latest
15
- # or
16
- NOTEBOOKLM_BROWSER_CHANNEL=chromium npx notebooklm-mcp@latest
17
- ```
18
-
19
- The fallback is also auto-applied when launch errors match the known patterns, but setting the env var explicitly makes the choice deterministic.
20
-
21
- ## `ask_question` times out
22
-
23
- Symptom: The tool fails after roughly 10 min with a timeout error.
24
-
25
- Checks:
26
-
27
- 1. Confirm the answer wait is sufficient — long-form prompts on notebooks with many sources legitimately exceed 2 min.
28
- ```bash
29
- ANSWER_TIMEOUT_MS=900000 npx notebooklm-mcp@latest # 15 minutes
30
- ```
31
- Or per-call: `browser_options.timeout_ms`.
32
- 2. Run with a visible browser to see what NotebookLM is doing:
33
- ```json
34
- { "name": "ask_question", "arguments": { "question": "...", "show_browser": true } }
35
- ```
36
- Or start the server with `HEADLESS=false`.
37
- 3. `get_health` can confirm that a readable auth backup exists, but it does not
38
- probe Google. A browser-driven NotebookLM operation performs the live check.
39
-
40
- ## Session expired / repeated login prompts
41
-
42
- Symptom: a browser-driven NotebookLM operation redirects to
43
- `accounts.google.com` after a previously successful login.
44
-
45
- Workflow:
46
-
47
- 1. Retry with `show_browser=true` and confirm that Google actually requests
48
- credentials. The age of `state.json` and `get_health.auth_state_present` do
49
- not establish whether the live session is valid.
50
- 2. Close other MCP/Chrome processes that may hold the persistent profile lock,
51
- or set `NOTEBOOK_PROFILE_STRATEGY=single` to fail clearly instead of using an
52
- isolated profile.
53
- 3. Only after a confirmed sign-in redirect, run `re_auth` to wipe stored auth
54
- and prompt for a fresh login. If that fails repeatedly, preview
55
- `cleanup_data` with the library preserved:
56
- ```json
57
- { "name": "cleanup_data", "arguments": { "confirm": false, "preserve_library": true } }
58
- ```
4
+
5
+ ## Chrome fails to launch (macOS Tahoe / Windows exit 21)
6
+
7
+ Symptom: `Failed to launch chrome`, `chrome exited immediately`, `code 21`, `executable doesn't exist`.
8
+
9
+ Cause: System Chrome on macOS 26 (Tahoe) and certain Windows 11 setups crashes on the persistent profile launch.
10
+
11
+ Fix: Force the bundled Patchright Chromium.
12
+
13
+ ```bash
14
+ BROWSER_CHANNEL=chromium npx notebooklm-mcp@latest
15
+ # or
16
+ NOTEBOOKLM_BROWSER_CHANNEL=chromium npx notebooklm-mcp@latest
17
+ ```
18
+
19
+ The fallback is also auto-applied when launch errors match the known patterns, but setting the env var explicitly makes the choice deterministic.
20
+
21
+ ## `ask_question` times out
22
+
23
+ Symptom: The tool fails after roughly 10 min with a timeout error.
24
+
25
+ Checks:
26
+
27
+ 1. Confirm the answer wait is sufficient — long-form prompts on notebooks with many sources legitimately exceed 2 min.
28
+ ```bash
29
+ ANSWER_TIMEOUT_MS=900000 npx notebooklm-mcp@latest # 15 minutes
30
+ ```
31
+ Or per-call: `browser_options.timeout_ms`.
32
+ 2. Run with a visible browser to see what NotebookLM is doing:
33
+ ```json
34
+ { "name": "ask_question", "arguments": { "question": "...", "show_browser": true } }
35
+ ```
36
+ Or start the server with `HEADLESS=false`.
37
+ 3. `get_health` can confirm that a readable auth backup exists, but it does not
38
+ probe Google. A browser-driven NotebookLM operation performs the live check.
39
+
40
+ ## Session expired / repeated login prompts
41
+
42
+ Symptom: a browser-driven NotebookLM operation redirects to
43
+ `accounts.google.com` after a previously successful login.
44
+
45
+ Workflow:
46
+
47
+ 1. Retry with `show_browser=true` and confirm that Google actually requests
48
+ credentials. The age of `state.json` and `get_health.auth_state_present` do
49
+ not establish whether the live session is valid.
50
+ 2. Close other MCP/Chrome processes that may hold the persistent profile lock,
51
+ or set `NOTEBOOK_PROFILE_STRATEGY=single` to fail clearly instead of using an
52
+ isolated profile.
53
+ 3. Only after a confirmed sign-in redirect, run `re_auth` to wipe stored auth
54
+ and prompt for a fresh login. If that fails repeatedly, preview
55
+ `cleanup_data` with the library preserved:
56
+ ```json
57
+ { "name": "cleanup_data", "arguments": { "confirm": false, "preserve_library": true } }
58
+ ```
59
59
  Review the preview, close every browser session, then run again with
60
60
  `confirm: true` and the returned `preview_token`. Then `setup_auth`.
61
-
62
- ## WSL1
63
-
64
- Symptom: Chrome refuses to launch under WSL1.
65
-
66
- Fix: Upgrade to WSL2.
67
-
68
- ```powershell
69
- wsl --set-default-version 2
70
- wsl --set-version <distro> 2
71
- ```
72
-
73
- WSL2 with WSLg (Windows 11 / Windows 10 22H2+) supports a real Chromium and works out of the box.
74
-
75
- ## Headless Linux server
76
-
77
- Symptom: `setup_auth` fails on a server with no display because the login window cannot open.
78
-
79
- Fix: Run the one-time setup under `xvfb-run`. After login the persistent Chrome profile lets every subsequent run go fully headless.
80
-
81
- ```bash
82
- xvfb-run -a npx notebooklm-mcp@latest
83
- # call setup_auth from your client, complete login, then exit
84
- # from then on, run normally:
85
- npx notebooklm-mcp@latest
86
- ```
87
-
88
- ## "Unknown resource: mcp://notebooklm"
89
-
90
- Cause: A client used the wrong URI scheme.
91
-
92
- Fix: The scheme is `notebooklm://`, not `mcp://`. Supported URIs:
93
-
94
- - `notebooklm://library`
95
- - `notebooklm://library/{id}`
96
- - `notebooklm://metadata` (deprecated)
97
-
98
- The error message in v2 lists the correct set.
99
-
100
- ## Orphan Chrome processes
101
-
102
- Symptom: Chrome processes survive after the MCP server exits.
103
-
104
- v2 ships a 5-second shutdown watchdog and an aggressive teardown path, so this is rare. If it does happen:
105
-
106
- 1. Kill the lingering Chromes manually.
61
+
62
+ ## WSL1
63
+
64
+ Symptom: Chrome refuses to launch under WSL1.
65
+
66
+ Fix: Upgrade to WSL2.
67
+
68
+ ```powershell
69
+ wsl --set-default-version 2
70
+ wsl --set-version <distro> 2
71
+ ```
72
+
73
+ WSL2 with WSLg (Windows 11 / Windows 10 22H2+) supports a real Chromium and works out of the box.
74
+
75
+ ## Headless Linux server
76
+
77
+ Symptom: `setup_auth` fails on a server with no display because the login window cannot open.
78
+
79
+ Fix: Run the one-time setup under `xvfb-run`. After login the persistent Chrome profile lets every subsequent run go fully headless.
80
+
81
+ ```bash
82
+ xvfb-run -a npx notebooklm-mcp@latest
83
+ # call setup_auth from your client, complete login, then exit
84
+ # from then on, run normally:
85
+ npx notebooklm-mcp@latest
86
+ ```
87
+
88
+ ## "Unknown resource: mcp://notebooklm"
89
+
90
+ Cause: A client used the wrong URI scheme.
91
+
92
+ Fix: The scheme is `notebooklm://`, not `mcp://`. Supported URIs:
93
+
94
+ - `notebooklm://library`
95
+ - `notebooklm://library/{id}`
96
+ - `notebooklm://metadata` (deprecated)
97
+
98
+ The error message in v2 lists the correct set.
99
+
100
+ ## Orphan Chrome processes
101
+
102
+ Symptom: Chrome processes survive after the MCP server exits.
103
+
104
+ v2 ships a 5-second shutdown watchdog and an aggressive teardown path, so this is rare. If it does happen:
105
+
106
+ 1. Kill the lingering Chromes manually.
107
107
  2. Preview `cleanup_data` with `preserve_library: true`, then confirm using the
108
108
  returned token to remove MCP-owned profile data.
109
- 3. Restart the server.
110
-
111
- ## Profile lock / `ProcessSingleton` errors
112
-
113
- Cause: Another Chrome owns the base profile.
114
-
115
- Fix: the default `NOTEBOOK_PROFILE_STRATEGY=single` fails clearly so the server
116
- does not silently open a clean profile. Close the other MCP/Chrome process. If
117
- concurrent instances are intentional, opt into automatic isolation:
118
-
119
- ```bash
120
- NOTEBOOK_PROFILE_STRATEGY=auto npx notebooklm-mcp@latest
121
- ```
122
-
123
- ## Rate limit reached
124
-
109
+ 3. Restart the server.
110
+
111
+ ## Profile lock / `ProcessSingleton` errors
112
+
113
+ Cause: Another Chrome owns the base profile.
114
+
115
+ Fix: the default `NOTEBOOK_PROFILE_STRATEGY=single` fails clearly so the server
116
+ does not silently open a clean profile. Close the other MCP/Chrome process. If
117
+ concurrent instances are intentional, opt into automatic isolation:
118
+
119
+ ```bash
120
+ NOTEBOOK_PROFILE_STRATEGY=auto npx notebooklm-mcp@latest
121
+ ```
122
+
123
+ ## Rate limit reached
124
+
125
125
  Symptom: NotebookLM reports a rate or quota limit.
126
-
127
- Options:
128
-
129
- - Use `re_auth` to switch to a different Google account.
130
- - Use multi-account mode for a clean separation:
131
- ```bash
132
- NOTEBOOKLM_ACCOUNT=backup npx notebooklm-mcp@latest
133
- ```
134
- - Wait until the daily quota resets.
135
- - Upgrade to Google AI Pro/Ultra for higher limits.
136
-
137
- ## Stealth typing too slow
138
-
139
- The default `160–240 WPM` range is realistic but slow for batch use. Either disable stealth typing or tighten the range:
140
-
141
- ```bash
142
- STEALTH_HUMAN_TYPING=false npx notebooklm-mcp@latest
143
- # or
144
- TYPING_WPM_MIN=400 TYPING_WPM_MAX=600 npx notebooklm-mcp@latest
145
- ```
146
-
147
- ## Citations are empty for `source_format=footnotes`
148
-
149
- The DOM citation panel is read after the answer settles. If it is empty:
150
-
151
- - The notebook may not have grounded sources for that question.
152
- - The UI may have shifted — check the active selectors in `src/notebooklm/selectors.ts`.
153
- - Run with `show_browser=true` and inspect the live page after the answer renders.
154
-
155
- ## Follow-up reminder is missing
156
-
157
- In v2 the follow-up reminder appended to `ask_question` answers is off by default. Re-enable with:
158
-
159
- ```bash
160
- NOTEBOOKLM_FOLLOW_UP_REMINDER=true npx notebooklm-mcp@latest
161
- ```
162
-
163
- ## AI marker breaks downstream parsing
164
-
126
+
127
+ Options:
128
+
129
+ - Use `re_auth` to switch to a different Google account.
130
+ - Use multi-account mode for a clean separation:
131
+ ```bash
132
+ NOTEBOOKLM_ACCOUNT=backup npx notebooklm-mcp@latest
133
+ ```
134
+ - Wait until the daily quota resets.
135
+ - Upgrade to Google AI Pro/Ultra for higher limits.
136
+
137
+ ## Stealth typing too slow
138
+
139
+ The default `160–240 WPM` range is realistic but slow for batch use. Either disable stealth typing or tighten the range:
140
+
141
+ ```bash
142
+ STEALTH_HUMAN_TYPING=false npx notebooklm-mcp@latest
143
+ # or
144
+ TYPING_WPM_MIN=400 TYPING_WPM_MAX=600 npx notebooklm-mcp@latest
145
+ ```
146
+
147
+ ## Citations are empty for `source_format=footnotes`
148
+
149
+ The DOM citation panel is read after the answer settles. If it is empty:
150
+
151
+ - The notebook may not have grounded sources for that question.
152
+ - The UI may have shifted — check the active selectors in `src/notebooklm/selectors.ts`.
153
+ - Run with `show_browser=true` and inspect the live page after the answer renders.
154
+
155
+ ## Follow-up reminder is missing
156
+
157
+ In v2 the follow-up reminder appended to `ask_question` answers is off by default. Re-enable with:
158
+
159
+ ```bash
160
+ NOTEBOOKLM_FOLLOW_UP_REMINDER=true npx notebooklm-mcp@latest
161
+ ```
162
+
163
+ ## AI marker breaks downstream parsing
164
+
165
165
  The default answer text starts with `[AI-GENERATED via Google NotebookLM — …]`. To return to the unprefixed answer, set:
166
-
167
- ```bash
168
- NOTEBOOKLM_AI_MARKER=false npx notebooklm-mcp@latest
169
- ```
170
-
171
- Or replace the prefix with your own:
172
-
173
- ```bash
174
- NOTEBOOKLM_AI_MARKER_PREFIX="[notebooklm]" npx notebooklm-mcp@latest
175
- ```
176
-
177
- The `_provenance` envelope on the result remains regardless.
178
-
179
- ## HTTP transport: `unknown session`
180
-
181
- Cause: The client made a `GET /mcp` or `POST /mcp` (non-initialize) without echoing the `Mcp-Session-Id` returned by the initial `initialize` response.
182
-
183
- Fix: Capture the `Mcp-Session-Id` response header from the initialize call and pass it on every subsequent request. The lifecycle is owned by the MCP SDK's `StreamableHTTPServerTransport`.
166
+
167
+ ```bash
168
+ NOTEBOOKLM_AI_MARKER=false npx notebooklm-mcp@latest
169
+ ```
170
+
171
+ Or replace the prefix with your own:
172
+
173
+ ```bash
174
+ NOTEBOOKLM_AI_MARKER_PREFIX="[notebooklm]" npx notebooklm-mcp@latest
175
+ ```
176
+
177
+ The `_provenance` envelope on the result remains regardless.
178
+
179
+ ## HTTP transport: `unknown session`
180
+
181
+ Cause: The client made a `GET /mcp` or `POST /mcp` (non-initialize) without echoing the `Mcp-Session-Id` returned by the initial `initialize` response.
182
+
183
+ Fix: Capture the `Mcp-Session-Id` response header from the initialize call and pass it on every subsequent request. The lifecycle is owned by the MCP SDK's `StreamableHTTPServerTransport`.