@roomi-fields/notebooklm-mcp 1.3.4 → 1.3.6

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 (96) hide show
  1. package/README.md +164 -715
  2. package/dist/__tests__/cleanup-manager.test.d.ts +2 -0
  3. package/dist/__tests__/cleanup-manager.test.d.ts.map +1 -0
  4. package/dist/__tests__/cleanup-manager.test.js +341 -0
  5. package/dist/__tests__/cleanup-manager.test.js.map +1 -0
  6. package/dist/__tests__/config-parsing.test.d.ts +2 -0
  7. package/dist/__tests__/config-parsing.test.d.ts.map +1 -0
  8. package/dist/__tests__/config-parsing.test.js +338 -0
  9. package/dist/__tests__/config-parsing.test.js.map +1 -0
  10. package/dist/__tests__/config.test.d.ts +2 -0
  11. package/dist/__tests__/config.test.d.ts.map +1 -0
  12. package/dist/__tests__/config.test.js +267 -0
  13. package/dist/__tests__/config.test.js.map +1 -0
  14. package/dist/__tests__/errors.test.d.ts +2 -0
  15. package/dist/__tests__/errors.test.d.ts.map +1 -0
  16. package/dist/__tests__/errors.test.js +166 -0
  17. package/dist/__tests__/errors.test.js.map +1 -0
  18. package/dist/__tests__/logger.test.d.ts +2 -0
  19. package/dist/__tests__/logger.test.d.ts.map +1 -0
  20. package/dist/__tests__/logger.test.js +324 -0
  21. package/dist/__tests__/logger.test.js.map +1 -0
  22. package/dist/__tests__/page-utils.test.d.ts +2 -0
  23. package/dist/__tests__/page-utils.test.d.ts.map +1 -0
  24. package/dist/__tests__/page-utils.test.js +349 -0
  25. package/dist/__tests__/page-utils.test.js.map +1 -0
  26. package/dist/__tests__/setup-verification.test.d.ts +2 -0
  27. package/dist/__tests__/setup-verification.test.d.ts.map +1 -0
  28. package/dist/__tests__/setup-verification.test.js +15 -0
  29. package/dist/__tests__/setup-verification.test.js.map +1 -0
  30. package/dist/__tests__/stealth-utils.test.d.ts +2 -0
  31. package/dist/__tests__/stealth-utils.test.d.ts.map +1 -0
  32. package/dist/__tests__/stealth-utils.test.js +413 -0
  33. package/dist/__tests__/stealth-utils.test.js.map +1 -0
  34. package/dist/__tests__/types.test.d.ts +2 -0
  35. package/dist/__tests__/types.test.d.ts.map +1 -0
  36. package/dist/__tests__/types.test.js +461 -0
  37. package/dist/__tests__/types.test.js.map +1 -0
  38. package/dist/auth/auth-manager.d.ts +2 -2
  39. package/dist/auth/auth-manager.d.ts.map +1 -1
  40. package/dist/auth/auth-manager.js +147 -145
  41. package/dist/auth/auth-manager.js.map +1 -1
  42. package/dist/auto-discovery/auto-discovery.d.ts.map +1 -1
  43. package/dist/auto-discovery/auto-discovery.js +17 -17
  44. package/dist/auto-discovery/auto-discovery.js.map +1 -1
  45. package/dist/cli/de-auth.js +19 -19
  46. package/dist/cli/help.js +60 -60
  47. package/dist/cli/setup-auth.js +39 -39
  48. package/dist/config.d.ts +1 -1
  49. package/dist/config.d.ts.map +1 -1
  50. package/dist/config.js +35 -20
  51. package/dist/config.js.map +1 -1
  52. package/dist/errors.d.ts.map +1 -1
  53. package/dist/errors.js +3 -3
  54. package/dist/errors.js.map +1 -1
  55. package/dist/http-wrapper.js +36 -30
  56. package/dist/http-wrapper.js.map +1 -1
  57. package/dist/index.js +104 -102
  58. package/dist/index.js.map +1 -1
  59. package/dist/library/notebook-library.d.ts +2 -2
  60. package/dist/library/notebook-library.d.ts.map +1 -1
  61. package/dist/library/notebook-library.js +24 -24
  62. package/dist/library/notebook-library.js.map +1 -1
  63. package/dist/session/browser-session.d.ts +4 -4
  64. package/dist/session/browser-session.d.ts.map +1 -1
  65. package/dist/session/browser-session.js +59 -55
  66. package/dist/session/browser-session.js.map +1 -1
  67. package/dist/session/session-manager.d.ts +3 -3
  68. package/dist/session/session-manager.d.ts.map +1 -1
  69. package/dist/session/session-manager.js +14 -14
  70. package/dist/session/session-manager.js.map +1 -1
  71. package/dist/session/shared-context-manager.d.ts +2 -2
  72. package/dist/session/shared-context-manager.d.ts.map +1 -1
  73. package/dist/session/shared-context-manager.js +60 -56
  74. package/dist/session/shared-context-manager.js.map +1 -1
  75. package/dist/tools/index.d.ts +6 -6
  76. package/dist/tools/index.d.ts.map +1 -1
  77. package/dist/tools/index.js +505 -505
  78. package/dist/tools/index.js.map +1 -1
  79. package/dist/types.d.ts +2 -2
  80. package/dist/utils/cleanup-manager.d.ts +1 -1
  81. package/dist/utils/cleanup-manager.d.ts.map +1 -1
  82. package/dist/utils/cleanup-manager.js +90 -92
  83. package/dist/utils/cleanup-manager.js.map +1 -1
  84. package/dist/utils/logger.d.ts +1 -2
  85. package/dist/utils/logger.d.ts.map +1 -1
  86. package/dist/utils/logger.js +15 -15
  87. package/dist/utils/page-utils.d.ts +1 -1
  88. package/dist/utils/page-utils.d.ts.map +1 -1
  89. package/dist/utils/page-utils.js +30 -30
  90. package/dist/utils/page-utils.js.map +1 -1
  91. package/dist/utils/stealth-utils.d.ts +2 -2
  92. package/dist/utils/stealth-utils.d.ts.map +1 -1
  93. package/dist/utils/stealth-utils.js +13 -13
  94. package/dist/utils/stealth-utils.js.map +1 -1
  95. package/docs/CHROME_PROFILE_LIMITATION.md +229 -212
  96. package/package.json +107 -79
package/README.md CHANGED
@@ -1,715 +1,164 @@
1
- <div align="center">
2
-
3
- # NotebookLM MCP Server
4
-
5
- > **Forked from** [PleasePrompto/notebooklm-mcp](https://github.com/PleasePrompto/notebooklm-mcp)
6
-
7
- **Chat directly with NotebookLM for zero-hallucination answers based on your own notebooks**
8
-
9
- [![TypeScript](https://img.shields.io/badge/TypeScript-5.x-blue.svg)](https://www.typescriptlang.org/)
10
- [![MCP](https://img.shields.io/badge/MCP-2025-green.svg)](https://modelcontextprotocol.io/)
11
- [![npm](https://img.shields.io/npm/v/@roomi-fields/notebooklm-mcp.svg)](https://www.npmjs.com/package/@roomi-fields/notebooklm-mcp)
12
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
13
- [![Claude Code](https://img.shields.io/badge/Claude_Code-MCP-8A2BE2)](https://claude.ai/claude-code)
14
- [![n8n](https://img.shields.io/badge/n8n-HTTP_API-orange)](./deployment/docs/04-N8N-INTEGRATION.md)
15
- [![GitHub](https://img.shields.io/github/stars/roomi-fields/notebooklm-mcp?style=social)](https://github.com/roomi-fields/notebooklm-mcp)
16
-
17
- [MCP Installation](#mcp-installation) • [HTTP REST API](#http-rest-api) • [Why NotebookLM](#why-notebooklm-not-local-rag) • [Examples](#real-world-example) • [Documentation](./deployment/docs/)
18
-
19
- </div>
20
-
21
- ---
22
-
23
- > **⚠️ Current Limitation (v1.3.2):** HTTP and MCP stdio modes cannot run simultaneously due to Chrome profile locking. Choose one mode at a time, or see [Chrome Profile Limitation](./docs/CHROME_PROFILE_LIMITATION.md) for details. This will be fixed in v1.4.0 with automatic profile separation.
24
-
25
- ---
26
-
27
- ## 🚀 Two Ways to Use This Server
28
-
29
- ### 1️⃣ **HTTP REST API** (New! Recommended for n8n, Zapier, Make.com)
30
-
31
- Use NotebookLM from **any tool** via HTTP REST API:
32
-
33
- **Option A: Install from npm**
34
- ```bash
35
- # Install globally
36
- npm install -g @roomi-fields/notebooklm-mcp
37
-
38
- # For MCP stdio mode (Claude Code, Cursor)
39
- notebooklm-mcp
40
-
41
- # For HTTP server mode
42
- # Note: Currently requires cloning the repo for HTTP mode
43
- # See Option B below
44
- ```
45
-
46
- **Option B: Install from source (Required for HTTP mode)**
47
- ```bash
48
- # Clone and install
49
- git clone https://github.com/roomi-fields/notebooklm-mcp.git
50
- cd notebooklm-mcp
51
- npm install
52
- npm run build
53
- npm run start:http
54
- ```
55
-
56
- **Query the API:**
57
- ```bash
58
- curl -X POST http://localhost:3000/ask \
59
- -H "Content-Type: application/json" \
60
- -d '{"question": "Explain X", "notebook_id": "my-notebook"}'
61
- ```
62
-
63
- **Perfect for:**
64
- - ✅ n8n workflows and automation
65
- - ✅ Zapier, Make.com integrations
66
- - Custom web applications
67
- - Backend APIs
68
-
69
- **👉 Full HTTP setup guide:** [deployment/docs/01-INSTALL.md](./deployment/docs/01-INSTALL.md)
70
-
71
- ---
72
-
73
- ### 2️⃣ **MCP stdio** (For Claude Code, Cursor, Codex)
74
-
75
- Use NotebookLM directly from your AI coding assistant:
76
-
77
- ```bash
78
- # Claude Code
79
- claude mcp add notebooklm npx @roomi-fields/notebooklm-mcp@latest
80
-
81
- # Codex
82
- codex mcp add notebooklm -- npx @roomi-fields/notebooklm-mcp@latest
83
-
84
- # Cursor (add to ~/.cursor/mcp.json)
85
- {
86
- "mcpServers": {
87
- "notebooklm": {
88
- "command": "npx",
89
- "args": ["-y", "@roomi-fields/notebooklm-mcp@latest"]
90
- }
91
- }
92
- }
93
- ```
94
-
95
- **Perfect for:**
96
- - Claude Code, Cursor, Codex
97
- - ✅ Any MCP-compatible AI assistant
98
- - ✅ Direct CLI integration
99
-
100
- ---
101
-
102
- ## The Problem
103
-
104
- When you tell Claude Code or Cursor to "search through my local documentation", here's what happens:
105
- - **Massive token consumption**: Searching through documentation means reading multiple files repeatedly
106
- - **Inaccurate retrieval**: Searches for keywords, misses context and connections between docs
107
- - **Hallucinations**: When it can't find something, it invents plausible-sounding APIs
108
- - **Expensive & slow**: Each question requires re-reading multiple files
109
-
110
- ## The Solution
111
-
112
- Let your tools chat directly with [**NotebookLM**](https://notebooklm.google/) Google's **zero-hallucination knowledge base** powered by Gemini 2.5 that provides intelligent, synthesized answers from your docs.
113
-
114
- ```
115
- Your Task → Agent/n8n asks NotebookLM → Gemini synthesizes answer → Correct output
116
- ```
117
-
118
- **The real advantage**: No more manual copy-paste. Your agent/workflow asks NotebookLM directly and gets answers back. Build deep understanding through automatic follow-ups.
119
-
120
- ---
121
-
122
- ## Why NotebookLM, Not Local RAG?
123
-
124
- | Approach | Token Cost | Setup Time | Hallucinations | Answer Quality |
125
- |----------|------------|------------|----------------|----------------|
126
- | **Feed docs to Claude** | 🔴 Very high (multiple file reads) | Instant | Yes - fills gaps | Variable retrieval |
127
- | **Web search** | 🟡 Medium | Instant | High - unreliable sources | Hit or miss |
128
- | **Local RAG** | 🟡 Medium-High | Hours (embeddings, chunking) | Medium - retrieval gaps | Depends on setup |
129
- | **NotebookLM MCP** | 🟢 Minimal | 5 minutes | **Zero** - refuses if unknown | Expert synthesis |
130
-
131
- ### What Makes NotebookLM Superior?
132
-
133
- 1. **Pre-processed by Gemini**: Upload docs once, get instant expert knowledge
134
- 2. **Natural language Q&A**: Not just retrieval actual understanding and synthesis
135
- 3. **Multi-source correlation**: Connects information across 50+ documents
136
- 4. **Citation-backed**: Every answer includes source references
137
- 5. **No infrastructure**: No vector DBs, embeddings, or chunking strategies needed
138
-
139
- ---
140
-
141
- ## HTTP REST API
142
-
143
- ### Quick Start
144
-
145
- ```powershell
146
- # 1. Clone and install
147
- git clone <repo-url> D:\notebooklm-http
148
- cd D:\notebooklm-http
149
- npm install
150
- npm run build
151
-
152
- # 2. Configure authentication (one-time)
153
- npm run setup-auth
154
- # Chrome opens → log in with Google → close Chrome
155
-
156
- # 3. Start the server
157
-
158
- # Option A: Foreground mode (terminal stays open)
159
- npm run start:http
160
-
161
- # Option B: Background daemon mode (recommended for production)
162
- npm run daemon:start # Start in background
163
- npm run daemon:logs # View logs
164
- npm run daemon:status # Check status
165
- npm run daemon:stop # Stop server
166
-
167
- # 4. Add your first notebook (in another terminal if using Option A)
168
- curl -X POST http://localhost:3000/notebooks \
169
- -H "Content-Type: application/json" \
170
- -d '{
171
- "url": "https://notebooklm.google.com/notebook/YOUR-NOTEBOOK-ID",
172
- "name": "My Knowledge Base",
173
- "description": "My documentation",
174
- "topics": ["docs", "api"]
175
- }'
176
-
177
- # 5. Query NotebookLM
178
- curl -X POST http://localhost:3000/ask \
179
- -H "Content-Type: application/json" \
180
- -d '{"question": "Explain X"}'
181
-
182
- # 6. Validate installation (optional)
183
- .\deployment\scripts\test-server.ps1
184
- ```
185
-
186
- **👉 See [Testing Guide](./deployment/scripts/README.md) for automated test suite**
187
-
188
- ### API Endpoints
189
-
190
- | Method | Endpoint | Description |
191
- |--------|----------|-------------|
192
- | `GET` | `/health` | Check server health |
193
- | `POST` | `/ask` | Ask a question to NotebookLM |
194
- | `GET` | `/notebooks` | List all notebooks |
195
- | `POST` | `/notebooks` | Add notebook (with live validation) |
196
- | `POST` | `/notebooks/auto-discover` | Auto-generate notebook metadata |
197
- | `DELETE` | `/notebooks/:id` | Remove a notebook |
198
- | `PUT` | `/notebooks/:id/activate` | Set active notebook |
199
- | `GET` | `/sessions` | List active sessions |
200
- | `DELETE` | `/sessions/:id` | Close a session |
201
-
202
- **👉 Full API documentation:** [deployment/docs/03-API.md](./deployment/docs/03-API.md)
203
-
204
- ### n8n Integration
205
-
206
- Perfect for n8n workflows:
207
-
208
- ```json
209
- {
210
- "nodes": [
211
- {
212
- "name": "Ask NotebookLM",
213
- "type": "n8n-nodes-base.httpRequest",
214
- "parameters": {
215
- "method": "POST",
216
- "url": "http://your-server:3000/ask",
217
- "jsonParameters": true,
218
- "bodyParametersJson": {
219
- "question": "{{ $json.query }}",
220
- "notebook_id": "my-notebook"
221
- }
222
- }
223
- }
224
- ]
225
- }
226
- ```
227
-
228
- **👉 n8n guide:** [deployment/docs/04-N8N-INTEGRATION.md](./deployment/docs/04-N8N-INTEGRATION.md)
229
-
230
- ---
231
-
232
- ## 🔍 Auto-Discovery : Self-Organizing Documentation
233
-
234
- Autonomous resource discovery enables AI orchestrators to find and use relevant documentation without manual intervention.
235
-
236
- ### How it works
237
-
238
- **1. Add notebook** (zero manual metadata):
239
- ```bash
240
- curl -X POST http://localhost:3000/notebooks/auto-discover \
241
- -H "Content-Type: application/json" \
242
- -d '{"url": "https://notebooklm.google.com/notebook/YOUR_ID"}'
243
- ```
244
-
245
- **2. System queries NotebookLM** to auto-generate:
246
- - Kebab-case name (3 words max)
247
- - Concise description (2 sentences)
248
- - Relevant tags (8-10 keywords)
249
-
250
- **3. Orchestrators discover autonomously**:
251
- - Claude Code finds relevant docs without prompting
252
- - n8n workflows auto-select documentation
253
- - Cursor matches context to notebooks
254
-
255
- ### Progressive disclosure pattern
256
-
257
- Inspired by [Claude Skills best practices](https://platform.claude.com/docs/en/agents-and-tools/agent-skills/best-practices#progressive-disclosure-patterns):
258
-
259
- - **Level 0** (startup): Lightweight metadata loaded (~500 tokens)
260
- - **Level 1** (matching): Local tag/description search (0 NotebookLM queries)
261
- - **Level 2** (deep query): Targeted NotebookLM query only when needed
262
-
263
- ### Why this matters
264
-
265
- **Before**: Manual library management, orchestrators can't discover resources autonomously
266
-
267
- **After**: Self-organizing library, autonomous documentation discovery
268
-
269
- Perfect for:
270
- - ✅ Teams with 10+ documentation notebooks
271
- - ✅ n8n workflows needing dynamic doc access
272
- - ✅ Claude Code autonomous research
273
- - ✅ Onboarding new developers without manual setup
274
-
275
- ### Example workflow
276
-
277
- ```bash
278
- # 1. Add documentation notebooks (auto-discover metadata)
279
- curl -X POST /notebooks/auto-discover -d '{"url": "https://notebooklm.google.com/notebook/n8n-docs"}'
280
- curl -X POST /notebooks/auto-discover -d '{"url": "https://notebooklm.google.com/notebook/react-guide"}'
281
-
282
- # 2. Claude Code autonomously discovers relevant notebook
283
- User: "Build Gmail automation with n8n"
284
- → System matches: "n8n-docs" (tags: ["n8n", "gmail", "automation"])
285
- → Query NotebookLM: "Gmail node configuration?"
286
- → Claude implements with accurate info
287
-
288
- # 3. Zero hallucinations, zero manual intervention
289
- ```
290
-
291
- ---
292
-
293
- ### Background Daemon Mode
294
-
295
- Run the HTTP server as a background process without keeping a terminal window open:
296
-
297
- ```bash
298
- # Start server in background
299
- npm run daemon:start
300
-
301
- # View real-time logs
302
- npm run daemon:logs
303
-
304
- # Check server status
305
- npm run daemon:status
306
-
307
- # Restart server
308
- npm run daemon:restart
309
-
310
- # Stop server
311
- npm run daemon:stop
312
-
313
- # Remove from PM2 process list
314
- npm run daemon:delete
315
- ```
316
-
317
- **Features:**
318
- - ✅ Runs in background without terminal window
319
- - ✅ Auto-restart on crash
320
- - ✅ Centralized log management (logs/pm2-*.log)
321
- - ✅ Memory limit protection (1GB max)
322
- - ✅ Production-ready process management
323
-
324
- **Configuration:** Edit `ecosystem.config.cjs` to customize PM2 behavior (env vars, restart policy, etc.)
325
-
326
- ### Installation & Documentation
327
-
328
- - 📖 [**Installation Guide**](./deployment/docs/01-INSTALL.md) — Step-by-step setup
329
- - 🔧 [**Configuration**](./deployment/docs/02-CONFIGURATION.md) — Environment variables, security
330
- - 📡 [**API Reference**](./deployment/docs/03-API.md) — Complete endpoint documentation
331
- - 📚 [**Notebook Library**](./deployment/docs/06-NOTEBOOK-LIBRARY.md) — Multi-notebook management
332
- - ✅ [**Testing Suite**](./deployment/scripts/README.md) — Automated validation scripts
333
- - 🐛 [**Troubleshooting**](./deployment/docs/05-TROUBLESHOOTING.md) — Common issues
334
-
335
- ---
336
-
337
- ## MCP Installation
338
-
339
- <details>
340
- <summary>Claude Code</summary>
341
-
342
- ```bash
343
- claude mcp add notebooklm npx @roomi-fields/notebooklm-mcp@latest
344
- ```
345
- </details>
346
-
347
- <details>
348
- <summary>Codex</summary>
349
-
350
- ```bash
351
- codex mcp add notebooklm -- npx @roomi-fields/notebooklm-mcp@latest
352
- ```
353
- </details>
354
-
355
- <details>
356
- <summary>Gemini</summary>
357
-
358
- ```bash
359
- gemini mcp add notebooklm npx @roomi-fields/notebooklm-mcp@latest
360
- ```
361
- </details>
362
-
363
- <details>
364
- <summary>Cursor</summary>
365
-
366
- Add to `~/.cursor/mcp.json`:
367
- ```json
368
- {
369
- "mcpServers": {
370
- "notebooklm": {
371
- "command": "npx",
372
- "args": ["-y", "@roomi-fields/notebooklm-mcp@latest"]
373
- }
374
- }
375
- }
376
- ```
377
- </details>
378
-
379
- <details>
380
- <summary>amp</summary>
381
-
382
- ```bash
383
- amp mcp add notebooklm -- npx @roomi-fields/notebooklm-mcp@latest
384
- ```
385
- </details>
386
-
387
- <details>
388
- <summary>VS Code</summary>
389
-
390
- ```bash
391
- code --add-mcp '{"name":"notebooklm","command":"npx","args":["@roomi-fields/notebooklm-mcp@latest"]}'
392
- ```
393
- </details>
394
-
395
- <details>
396
- <summary>Other MCP clients</summary>
397
-
398
- **Generic MCP config:**
399
- ```json
400
- {
401
- "mcpServers": {
402
- "notebooklm": {
403
- "command": "npx",
404
- "args": ["@roomi-fields/notebooklm-mcp@latest"]
405
- }
406
- }
407
- }
408
- ```
409
- </details>
410
-
411
- ### MCP Quick Start
412
-
413
- 1. **Install** the MCP server (see above)
414
-
415
- 2. **Authenticate** (one-time)
416
-
417
- Say in your chat (Claude/Codex):
418
- ```
419
- "Log me in to NotebookLM"
420
- ```
421
- *A Chrome window opens → log in with Google*
422
-
423
- 3. **Create your knowledge base**
424
-
425
- Go to [notebooklm.google.com](https://notebooklm.google.com) → Create notebook → Upload your docs:
426
- - 📄 PDFs, Google Docs, markdown files
427
- - 🔗 Websites, GitHub repos
428
- - 🎥 YouTube videos
429
- - 📚 Multiple sources per notebook
430
-
431
- Share: **⚙️ Share → Anyone with link → Copy**
432
-
433
- 4. **Let Claude use it**
434
-
435
- ```
436
- "I'm building with [library]. Here's my NotebookLM: [link]"
437
- ```
438
-
439
- **That's it.** Claude now asks NotebookLM whatever it needs, building expertise before writing code.
440
-
441
- ---
442
-
443
- ## Related Project: Claude Code Skill (by original author)
444
-
445
- The original author [PleasePrompto](https://github.com/PleasePrompto) also created a **Python-based Claude Code Skill** as an alternative approach:
446
-
447
- 🔗 **[NotebookLM Claude Code Skill](https://github.com/PleasePrompto/notebooklm-skill)** - Python skill for Claude Code
448
-
449
- ### When to use which approach?
450
-
451
- | Feature | This Project (MCP + HTTP) | Original Skill (Python) |
452
- |---------|---------------------------|-------------------------|
453
- | **Protocol** | MCP (Model Context Protocol) | Claude Skills |
454
- | **Installation** | `claude mcp add notebooklm npx @roomi-fields/notebooklm-mcp` | Clone to `~/.claude/skills/` |
455
- | **Sessions** | ✅ Persistent browser sessions | Fresh browser per query |
456
- | **Compatibility** | ✅ Claude Code, Cursor, Codex, any MCP client | Claude Code only |
457
- | **HTTP API** | ✅ Works with n8n, Zapier, Make.com | ❌ Not available |
458
- | **Language** | TypeScript | Python |
459
- | **Use case** | Long conversations, automation workflows | Quick one-off queries |
460
-
461
- ### Which one should you choose?
462
-
463
- - **Use this MCP project** if you want:
464
- - Persistent sessions (faster repeated queries)
465
- - Compatibility with multiple tools (Cursor, Codex, etc.)
466
- - HTTP REST API for n8n/Zapier automation
467
- - TypeScript-based development
468
-
469
- - **Use the original Skill** if you prefer:
470
- - Python-based workflow
471
- - Simpler clone-and-use installation
472
- - Stateless queries (no session management)
473
- - Only using Claude Code locally
474
-
475
- Both use the same Patchright browser automation technology and provide zero-hallucination answers from NotebookLM.
476
-
477
- ---
478
-
479
- ## Real-World Example
480
-
481
- ### Building an n8n Workflow Without Hallucinations
482
-
483
- **Challenge**: n8n's API is new — Claude hallucinates node names and functions.
484
-
485
- **Solution**:
486
- 1. Downloaded complete n8n documentation → merged into manageable chunks
487
- 2. Uploaded to NotebookLM
488
- 3. Told Claude: *"Build me a Gmail spam filter workflow. Use this NotebookLM: [link]"*
489
-
490
- **Watch the AI-to-AI conversation:**
491
-
492
- ```
493
- Claude → "How does Gmail integration work in n8n?"
494
- NotebookLM → "Use Gmail Trigger with polling, or Gmail node with Get Many..."
495
-
496
- Claude → "How to decode base64 email body?"
497
- NotebookLM → "Body is base64url encoded in payload.parts, use Function node..."
498
-
499
- Claude → "How to parse OpenAI response as JSON?"
500
- NotebookLM → "Set responseFormat to json, use {{ $json.spam }} in IF node..."
501
-
502
- Claude → "What about error handling if the API fails?"
503
- NotebookLM → "Use Error Trigger node with Continue On Fail enabled..."
504
-
505
- Claude → ✅ "Here's your complete workflow JSON..."
506
- ```
507
-
508
- **Result**: Perfect workflow on first try. No debugging hallucinated APIs.
509
-
510
- ---
511
-
512
- ## Core Features
513
-
514
- ### **Zero Hallucinations**
515
- NotebookLM refuses to answer if information isn't in your docs. No invented APIs.
516
-
517
- ### **Multi-Notebook Library**
518
- Manage multiple NotebookLM notebooks with automatic validation, duplicate detection, and smart selection.
519
-
520
- ### **Autonomous Research**
521
- Claude asks follow-up questions automatically, building complete understanding before coding.
522
-
523
- ### **Deep, Iterative Research**
524
- - Claude automatically asks follow-up questions to build complete understanding
525
- - Each answer triggers deeper questions until Claude has all the details
526
- - Example: For n8n workflow, Claude asked multiple sequential questions about Gmail integration, error handling, and data transformation
527
-
528
- ### **HTTP REST API**
529
- Use NotebookLM from n8n, Zapier, Make.com, or any HTTP client. No MCP required.
530
-
531
- ### **Cross-Tool Sharing**
532
- Set up once, use everywhere. Claude Code, Codex, Cursor, n8n — all can access the same library.
533
-
534
- ---
535
-
536
- ## Architecture
537
-
538
- ```mermaid
539
- graph LR
540
- A[Your Task] --> B[Claude/n8n/HTTP Client]
541
- B --> C[MCP/HTTP Server]
542
- C --> D[Chrome Automation]
543
- D --> E[NotebookLM]
544
- E --> F[Gemini 2.5]
545
- F --> G[Your Docs]
546
- G --> F
547
- F --> E
548
- E --> D
549
- D --> C
550
- C --> B
551
- B --> H[Accurate Output]
552
- ```
553
-
554
- ---
555
-
556
- ## Common Commands (MCP Mode)
557
-
558
- | Intent | Say | Result |
559
- |--------|-----|--------|
560
- | Authenticate | *"Open NotebookLM auth setup"* or *"Log me in to NotebookLM"* | Chrome opens for login |
561
- | Add notebook | *"Add [link] to library"* | Saves notebook with metadata |
562
- | List notebooks | *"Show our notebooks"* | Lists all saved notebooks |
563
- | Research first | *"Research this in NotebookLM before coding"* | Multi-question session |
564
- | Select notebook | *"Use the React notebook"* | Sets active notebook |
565
- | Update notebook | *"Update notebook tags"* | Modify metadata |
566
- | Remove notebook | *"Remove [notebook] from library"* | Deletes from library |
567
- | View browser | *"Show me the browser"* | Watch live NotebookLM chat |
568
- | Fix auth | *"Repair NotebookLM authentication"* | Clears and re-authenticates |
569
- | Switch account | *"Re-authenticate with different Google account"* | Changes account |
570
- | Clean restart | *"Run NotebookLM cleanup"* | Removes all data for fresh start |
571
-
572
- ---
573
-
574
- ## Comparison to Alternatives
575
-
576
- ### vs. Downloading docs locally
577
- - **You**: Download docs → Claude: "search through these files"
578
- - **Problem**: Claude reads thousands of files → massive token usage, often misses connections
579
- - **NotebookLM**: Pre-indexed by Gemini, semantic understanding across all docs
580
-
581
- ### vs. Web search
582
- - **You**: "Research X online"
583
- - **Problem**: Outdated info, hallucinated examples, unreliable sources
584
- - **NotebookLM**: Only your trusted docs, always current, with citations
585
-
586
- ### vs. Local RAG setup
587
- - **You**: Set up embeddings, vector DB, chunking strategy, retrieval pipeline
588
- - **Problem**: Hours of setup, tuning retrieval, still gets "creative" with gaps
589
- - **NotebookLM**: Upload docs → done. Google handles everything.
590
-
591
- ---
592
-
593
- ## FAQ
594
-
595
- **Is it really zero hallucinations?**
596
- Yes. NotebookLM is specifically designed to only answer from uploaded sources. If it doesn't know, it says so.
597
-
598
- **What about rate limits?**
599
- Free tier has daily query limits per Google account. Quick account switching supported for continued research.
600
-
601
- **How secure is this?**
602
- Chrome runs locally. Your credentials never leave your machine. Use a dedicated Google account if concerned.
603
-
604
- **Can I see what's happening?**
605
- Yes! Say *"Show me the browser"* (MCP mode) or set `HEADLESS=false` (HTTP mode) to watch the live NotebookLM conversation.
606
-
607
- **What makes this better than Claude's built-in knowledge?**
608
- Your docs are always current. No training cutoff. No hallucinations. Perfect for new libraries, internal APIs, or fast-moving projects.
609
-
610
- ---
611
-
612
- ## The Bottom Line
613
-
614
- **Without NotebookLM**: Write code → Find it's wrong → Debug hallucinated APIs → Repeat
615
-
616
- **With NotebookLM**: Research first → Write correct code → Ship faster
617
-
618
- Stop debugging hallucinations. Start shipping accurate code.
619
-
620
- ---
621
-
622
- ## Disclaimer
623
-
624
- This tool automates browser interactions with NotebookLM to make your workflow more efficient. However, a few friendly reminders:
625
-
626
- **About browser automation:**
627
- While I've built in humanization features (realistic typing speeds, natural delays, mouse movements) to make the automation behave more naturally, I can't guarantee Google won't detect or flag automated usage. I recommend using a dedicated Google account for automation rather than your primary account—think of it like web scraping: probably fine, but better safe than sorry!
628
-
629
- **About CLI tools and AI agents:**
630
- CLI tools like Claude Code, Codex, and similar AI-powered assistants are incredibly powerful, but they can make mistakes. Please use them with care and awareness:
631
- - Always review changes before committing or deploying
632
- - Test in safe environments first
633
- - Keep backups of important work
634
- - Remember: AI agents are assistants, not infallible oracles
635
-
636
- I built this tool for myself because I was tired of the copy-paste dance between NotebookLM and my editor. I'm sharing it in the hope it helps others too, but I can't take responsibility for any issues, data loss, or account problems that might occur. Use at your own discretion and judgment.
637
-
638
- That said, if you run into problems or have questions, feel free to open an issue on GitHub. I'm happy to help troubleshoot!
639
-
640
- ---
641
-
642
- ## Roadmap
643
-
644
- ### ✅ Implemented in v1.3.2
645
-
646
- **🤖 Auto-Discovery: Autonomous Resource Discovery**
647
- - ✅ Automatically generate notebook name, description, and tags via NotebookLM
648
- - ✅ Progressive disclosure pattern inspired by Claude Skills best practices
649
- - ✅ Zero-friction notebook addition (30 seconds vs 5 minutes)
650
- - ✅ Validation of auto-generated metadata (kebab-case, description length, tags count)
651
- - ✅ Orchestrators discover relevant documentation autonomously
652
-
653
- **👉 See [Auto-Discovery Documentation](./deployment/docs/07-AUTO-DISCOVERY.md) for details**
654
-
655
- ### 🔜 Planned for v1.4.0+
656
-
657
- **🔥 Separate Chrome Profiles by Mode (Priority):**
658
- - Enable HTTP and MCP stdio modes to run simultaneously
659
- - Automatic profile detection: `chrome_profile_http` vs `chrome_profile_stdio`
660
- - No user configuration needed - just works
661
- - Solves Chrome profile locking issue for dual-mode users
662
- - **👉 See [Chrome Profile Limitation](./docs/CHROME_PROFILE_LIMITATION.md) for details**
663
-
664
- **Smart Metadata Refresh:**
665
- - Auto-detect when notebook content has changed
666
- - Re-query NotebookLM to update metadata
667
- - Endpoint: `PATCH /notebooks/:id/refresh`
668
-
669
- **Semantic Matching:**
670
- - Use embeddings for advanced notebook matching beyond tags
671
- - Endpoint: `GET /notebooks/match?query=gmail&semantic=true`
672
-
673
- **Usage Analytics:**
674
- - Track which notebooks are queried together
675
- - Suggest related notebooks based on usage patterns
676
- - Endpoint: `GET /notebooks/:id/related`
677
-
678
- ### 🚀 Previously Implemented
679
-
680
- **✅ PM2 Daemon Mode (v1.1.2):**
681
- - Cross-platform process manager with auto-restart
682
- - Commands: `npm run daemon:start`, `daemon:logs`, `daemon:status`
683
- - Built-in log rotation and monitoring
684
-
685
- **✅ Multi-Notebook Library (v1.1.2):**
686
- - Live validation of notebooks
687
- - Duplicate detection
688
- - Smart notebook selection
689
-
690
- ### 💡 Have an idea?
691
- [Open a discussion](https://github.com/roomi-fields/notebooklm-mcp/discussions) to suggest new features!
692
-
693
- ---
694
-
695
- ## Contributing
696
-
697
- Found a bug? Have a feature idea? [Open an issue](https://github.com/roomi-fields/notebooklm-mcp/issues) or submit a PR!
698
-
699
- See [CONTRIBUTING.md](./CONTRIBUTING.md) for contribution guidelines.
700
-
701
- ## License
702
-
703
- MIT — Use freely in your projects.
704
-
705
- See [LICENSE](./LICENSE) for details.
706
-
707
- ---
708
-
709
- <div align="center">
710
-
711
- Built with frustration about hallucinated APIs, powered by Google's NotebookLM
712
-
713
- ⭐ [Star on GitHub](https://github.com/roomi-fields/notebooklm-mcp) if this saves you debugging time!
714
-
715
- </div>
1
+ <div align="center">
2
+
3
+ # NotebookLM MCP Server
4
+
5
+ > **Forked from** [PleasePrompto/notebooklm-mcp](https://github.com/PleasePrompto/notebooklm-mcp)
6
+
7
+ **Chat directly with NotebookLM for zero-hallucination answers based on your own notebooks**
8
+
9
+ <!-- Badges -->
10
+
11
+ [![CI](https://github.com/roomi-fields/notebooklm-mcp/actions/workflows/ci.yml/badge.svg)](https://github.com/roomi-fields/notebooklm-mcp/actions/workflows/ci.yml) [![npm version](https://badge.fury.io/js/%40roomi-fields%2Fnotebooklm-mcp.svg)](https://www.npmjs.com/package/@roomi-fields/notebooklm-mcp) [![npm downloads](https://img.shields.io/npm/dm/@roomi-fields/notebooklm-mcp.svg)](https://www.npmjs.com/package/@roomi-fields/notebooklm-mcp) [![codecov](https://codecov.io/gh/roomi-fields/notebooklm-mcp/branch/main/graph/badge.svg)](https://codecov.io/gh/roomi-fields/notebooklm-mcp) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![TypeScript](https://img.shields.io/badge/TypeScript-5.x-blue.svg)](https://www.typescriptlang.org/) [![Node.js](https://img.shields.io/badge/Node.js->=18-green.svg)](https://nodejs.org/)
12
+
13
+ [![MCP](https://img.shields.io/badge/MCP-2025-green.svg)](https://modelcontextprotocol.io/) [![Claude Code](https://img.shields.io/badge/Claude_Code-MCP-8A2BE2)](https://claude.ai/claude-code) [![n8n](https://img.shields.io/badge/n8n-HTTP_API-orange)](./deployment/docs/04-N8N-INTEGRATION.md) [![GitHub](https://img.shields.io/github/stars/roomi-fields/notebooklm-mcp?style=social)](https://github.com/roomi-fields/notebooklm-mcp)
14
+
15
+ <!-- End Badges -->
16
+
17
+ </div>
18
+
19
+ ---
20
+
21
+ ## Why NotebookLM?
22
+
23
+ | Approach | Token Cost | Hallucinations | Answer Quality |
24
+ | ------------------- | ----------- | ----------------------------- | -------------------- |
25
+ | Feed docs to Claude | Very high | Yes - fills gaps | Variable |
26
+ | Web search | Medium | High - unreliable sources | Hit or miss |
27
+ | Local RAG | Medium-High | Medium - retrieval gaps | Depends on setup |
28
+ | **NotebookLM MCP** | **Minimal** | **Zero** - refuses if unknown | **Expert synthesis** |
29
+
30
+ NotebookLM is pre-indexed by Gemini, provides citation-backed answers, and requires no infrastructure.
31
+
32
+ ---
33
+
34
+ ## Quick Start
35
+
36
+ ### Option 1: MCP Mode (Claude Code, Cursor, Codex)
37
+
38
+ ```bash
39
+ # Claude Code
40
+ claude mcp add notebooklm npx @roomi-fields/notebooklm-mcp@latest
41
+
42
+ # Cursor - add to ~/.cursor/mcp.json
43
+ {
44
+ "mcpServers": {
45
+ "notebooklm": {
46
+ "command": "npx",
47
+ "args": ["-y", "@roomi-fields/notebooklm-mcp@latest"]
48
+ }
49
+ }
50
+ }
51
+ ```
52
+
53
+ Then say: _"Log me in to NotebookLM"_ → Chrome opens → log in with Google.
54
+
55
+ ### Option 2: HTTP REST API (n8n, Zapier, Make.com)
56
+
57
+ ```bash
58
+ git clone https://github.com/roomi-fields/notebooklm-mcp.git
59
+ cd notebooklm-mcp
60
+ npm install && npm run build
61
+ npm run setup-auth # One-time Google login
62
+ npm run start:http # Start server on port 3000
63
+ ```
64
+
65
+ ```bash
66
+ # Query the API
67
+ curl -X POST http://localhost:3000/ask \
68
+ -H "Content-Type: application/json" \
69
+ -d '{"question": "Explain X", "notebook_id": "my-notebook"}'
70
+ ```
71
+
72
+ ---
73
+
74
+ ## Documentation
75
+
76
+ | Guide | Description |
77
+ | ------------------------------------------------------------ | ----------------------------------------- |
78
+ | [Installation](./deployment/docs/01-INSTALL.md) | Step-by-step setup for HTTP and MCP modes |
79
+ | [Configuration](./deployment/docs/02-CONFIGURATION.md) | Environment variables and security |
80
+ | [API Reference](./deployment/docs/03-API.md) | Complete HTTP endpoint documentation |
81
+ | [n8n Integration](./deployment/docs/04-N8N-INTEGRATION.md) | Workflow automation setup |
82
+ | [Troubleshooting](./deployment/docs/05-TROUBLESHOOTING.md) | Common issues and solutions |
83
+ | [Notebook Library](./deployment/docs/06-NOTEBOOK-LIBRARY.md) | Multi-notebook management |
84
+ | [Auto-Discovery](./deployment/docs/07-AUTO-DISCOVERY.md) | Autonomous metadata generation |
85
+ | [Chrome Limitation](./docs/CHROME_PROFILE_LIMITATION.md) | HTTP/MCP simultaneous mode issue |
86
+
87
+ ---
88
+
89
+ ## Core Features
90
+
91
+ - **Zero Hallucinations** — NotebookLM refuses to answer if info isn't in your docs
92
+ - **Multi-Notebook Library** — Manage multiple notebooks with validation and smart selection
93
+ - **Auto-Discovery** — Automatically generate metadata via NotebookLM queries
94
+ - **HTTP REST API** — Use from n8n, Zapier, Make.com, or any HTTP client
95
+ - **Daemon Mode** — Run as background process with PM2 (`npm run daemon:start`)
96
+ - **Cross-Tool** — Works with Claude Code, Cursor, Codex, and any MCP client
97
+
98
+ ---
99
+
100
+ ## Architecture
101
+
102
+ ```
103
+ Your Task → Agent/n8n → MCP/HTTP Server → Chrome Automation → NotebookLM → Gemini 2.5 → Your Docs
104
+
105
+ Accurate Output
106
+ ```
107
+
108
+ ---
109
+
110
+ ## Roadmap
111
+
112
+ See [ROADMAP.md](./ROADMAP.md) for planned features and version history.
113
+
114
+ **Next up (v1.4.0):** Separate Chrome profiles to enable HTTP + MCP modes simultaneously.
115
+
116
+ ---
117
+
118
+ ## Disclaimer
119
+
120
+ This tool automates browser interactions with NotebookLM. Use a dedicated Google account for automation. CLI tools like Claude Code can make mistakes — always review changes before deploying.
121
+
122
+ See full [Disclaimer](#disclaimer-details) below.
123
+
124
+ ---
125
+
126
+ ## Contributing
127
+
128
+ Found a bug? Have an idea? [Open an issue](https://github.com/roomi-fields/notebooklm-mcp/issues) or submit a PR!
129
+
130
+ See [CONTRIBUTING.md](./CONTRIBUTING.md) for guidelines.
131
+
132
+ ## License
133
+
134
+ MIT Use freely in your projects. See [LICENSE](./LICENSE).
135
+
136
+ ---
137
+
138
+ <details>
139
+ <summary><a name="disclaimer-details"></a>Full Disclaimer</summary>
140
+
141
+ **About browser automation:**
142
+ While I've built in humanization features (realistic typing speeds, natural delays, mouse movements), I can't guarantee Google won't detect or flag automated usage. Use a dedicated Google account for automation.
143
+
144
+ **About CLI tools and AI agents:**
145
+ CLI tools like Claude Code, Codex, and similar AI-powered assistants are powerful but can make mistakes:
146
+
147
+ - Always review changes before committing or deploying
148
+ - Test in safe environments first
149
+ - Keep backups of important work
150
+ - AI agents are assistants, not infallible oracles
151
+
152
+ I built this tool for myself and share it hoping it helps others, but I can't take responsibility for any issues that might occur. Use at your own discretion.
153
+
154
+ </details>
155
+
156
+ ---
157
+
158
+ <div align="center">
159
+
160
+ Built with frustration about hallucinated APIs, powered by Google's NotebookLM
161
+
162
+ [Star on GitHub](https://github.com/roomi-fields/notebooklm-mcp) if this saves you debugging time!
163
+
164
+ </div>