@roomi-fields/notebooklm-mcp 1.2.1 → 1.3.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.
@@ -0,0 +1,212 @@
1
+ # Chrome Profile Limitation
2
+
3
+ ## 🚨 Current Limitation (v1.3.0)
4
+
5
+ **The HTTP server and MCP stdio modes cannot run simultaneously** due to Chrome profile locking.
6
+
7
+ ### Why This Happens
8
+
9
+ The NotebookLM MCP server uses a persistent Chrome profile to maintain authentication between sessions. This profile is stored at:
10
+
11
+ ```
12
+ Windows: C:\Users\<username>\AppData\Local\notebooklm-mcp\Data\chrome_profile
13
+ Linux: ~/.local/share/notebooklm-mcp/chrome_profile
14
+ macOS: ~/Library/Application Support/notebooklm-mcp/chrome_profile
15
+ ```
16
+
17
+ **The problem:** Chrome can only open a profile in one instance at a time. When you try to run both:
18
+ - HTTP server (via `npm run daemon:start` or `npm run start:http`)
19
+ - MCP stdio server (via Claude Desktop, Cursor, etc.)
20
+
21
+ The second instance will fail to launch Chrome with this error:
22
+ ```
23
+ Error: browserType.launchPersistentContext: Target page, context or browser has been closed
24
+ ```
25
+
26
+ ### Who Is Affected?
27
+
28
+ | Scenario | Affected? | Why |
29
+ |----------|-----------|-----|
30
+ | **Single mode user** | ❌ No | Only runs one server at a time |
31
+ | **HTTP-only user** | ❌ No | Only uses HTTP server for n8n/Zapier |
32
+ | **MCP-only user** | ❌ No | Only uses Claude Desktop/Cursor |
33
+ | **Dual mode user** | ✅ Yes | Wants both HTTP API and Claude Desktop integration |
34
+
35
+ ### Current Workarounds
36
+
37
+ #### Option A: Use HTTP Server Only
38
+ ```bash
39
+ # Start HTTP server
40
+ npm run daemon:start
41
+
42
+ # Stop MCP stdio server (remove from Claude Desktop config)
43
+ # Use HTTP API for all integrations (n8n, Zapier, custom apps)
44
+ ```
45
+
46
+ #### Option B: Use MCP Stdio Only
47
+ ```bash
48
+ # Stop HTTP server
49
+ npm run daemon:stop
50
+
51
+ # Use only Claude Desktop/Cursor/Codex integration
52
+ ```
53
+
54
+ #### Option C: Switch Between Modes
55
+ ```bash
56
+ # For n8n workflows
57
+ npm run daemon:start
58
+
59
+ # For Claude Desktop work
60
+ npm run daemon:stop
61
+ # Then restart Claude Desktop
62
+ ```
63
+
64
+ ## 🔮 Planned Solution (v1.4.0+)
65
+
66
+ ### Option 1: Separate Chrome Profiles by Mode ⭐ (Selected)
67
+
68
+ **Implementation:** Detect the runtime mode and use different Chrome profiles.
69
+
70
+ ```typescript
71
+ // Automatic profile detection based on mode
72
+ const getProfilePath = () => {
73
+ const baseDir = getDataDirectory();
74
+ const mode = process.env.MCP_MODE || (process.stdout.isTTY ? 'stdio' : 'http');
75
+
76
+ return {
77
+ stdio: path.join(baseDir, 'chrome_profile_stdio'), // For Claude Desktop
78
+ http: path.join(baseDir, 'chrome_profile_http'), // For HTTP server
79
+ }[mode];
80
+ };
81
+ ```
82
+
83
+ **Benefits:**
84
+ - ✅ Both modes can run simultaneously
85
+ - ✅ No user configuration needed
86
+ - ✅ Separate authentication per mode
87
+ - ✅ Simple implementation
88
+
89
+ **Trade-offs:**
90
+ - Each mode needs separate authentication (one-time setup)
91
+ - Two Chrome profiles consume more disk space (~100-200MB each)
92
+
93
+ ### Option 2: Shared Session via IPC
94
+
95
+ **Implementation:** HTTP server becomes the master, stdio clients connect to it.
96
+
97
+ **Benefits:**
98
+ - ✅ Single Chrome instance
99
+ - ✅ Shared authentication
100
+
101
+ **Trade-offs:**
102
+ - ❌ Complex architecture
103
+ - ❌ HTTP server must be running for stdio to work
104
+ - ❌ Requires inter-process communication
105
+
106
+ ### Option 3: Better Error Messages
107
+
108
+ **Implementation:** Detect profile lock and show helpful error.
109
+
110
+ **Benefits:**
111
+ - ✅ Clear user guidance
112
+
113
+ **Trade-offs:**
114
+ - ❌ Doesn't solve the root problem
115
+ - ❌ Users still can't run both modes
116
+
117
+ ## 🛠️ Implementation Plan
118
+
119
+ ### Phase 1: Separate Chrome Profiles (v1.4.0)
120
+
121
+ **Changes:**
122
+ 1. Add `MCP_MODE` environment variable detection
123
+ 2. Create mode-specific profile directories
124
+ 3. Update authentication flow to use correct profile
125
+ 4. Update documentation
126
+
127
+ **Code locations:**
128
+ - `src/auth/shared-context-manager.ts` - Profile path logic
129
+ - `src/config.ts` - Mode detection
130
+ - `src/index.ts` - HTTP server mode flag
131
+ - `src/http-wrapper.ts` - HTTP mode environment
132
+
133
+ **Backwards compatibility:**
134
+ - Existing `chrome_profile` directory will be migrated to `chrome_profile_stdio`
135
+ - HTTP server will create new `chrome_profile_http`
136
+ - Users will need to re-authenticate HTTP mode once
137
+
138
+ ### Phase 2: Migration & Testing
139
+
140
+ **Migration script:**
141
+ ```typescript
142
+ // Auto-migrate existing profile to stdio mode
143
+ if (exists('chrome_profile') && !exists('chrome_profile_stdio')) {
144
+ rename('chrome_profile', 'chrome_profile_stdio');
145
+ log('Migrated existing profile to stdio mode');
146
+ }
147
+ ```
148
+
149
+ **Testing checklist:**
150
+ - [ ] HTTP server starts with separate profile
151
+ - [ ] MCP stdio starts with separate profile
152
+ - [ ] Both can run simultaneously
153
+ - [ ] Authentication works independently in each mode
154
+ - [ ] Existing users migrate smoothly
155
+ - [ ] Documentation updated
156
+
157
+ ### Phase 3: Documentation Updates
158
+
159
+ **Files to update:**
160
+ - `README.md` - Remove limitation warning
161
+ - `deployment/docs/01-INSTALL.md` - Update installation flow
162
+ - `deployment/docs/05-TROUBLESHOOTING.md` - Update troubleshooting
163
+ - `CHANGELOG.md` - Document breaking changes
164
+
165
+ ## 📝 For Developers
166
+
167
+ ### Testing the Fix Locally
168
+
169
+ ```bash
170
+ # Terminal 1: Start HTTP server
171
+ MCP_MODE=http npm run start:http
172
+
173
+ # Terminal 2: Start stdio server (simulate Claude Desktop)
174
+ MCP_MODE=stdio node dist/index.js
175
+
176
+ # Both should start without conflict
177
+ ```
178
+
179
+ ### Verifying Profile Separation
180
+
181
+ ```bash
182
+ # Check both profiles exist
183
+ ls -la ~/.local/share/notebooklm-mcp/
184
+ # Should show:
185
+ # - chrome_profile_http/
186
+ # - chrome_profile_stdio/
187
+
188
+ # Check profile usage
189
+ lsof | grep chrome_profile # Linux/macOS
190
+ # or
191
+ Get-Process | Where-Object {$_.Path -like "*chrome*"} # Windows PowerShell
192
+ ```
193
+
194
+ ## 🤝 Contributing
195
+
196
+ If you want to implement this feature or have alternative solutions:
197
+
198
+ 1. Open an issue on GitHub describing your approach
199
+ 2. Reference this document in your PR
200
+ 3. Include tests for both HTTP and stdio modes running simultaneously
201
+ 4. Update documentation accordingly
202
+
203
+ ## 📚 Related Issues
204
+
205
+ - [Issue #XX] Chrome profile conflict between HTTP and stdio modes
206
+ - [Issue #YY] Support running multiple MCP server instances
207
+
208
+ ## 🔗 See Also
209
+
210
+ - [Installation Guide](../deployment/docs/01-INSTALL.md)
211
+ - [Troubleshooting Guide](../deployment/docs/05-TROUBLESHOOTING.md)
212
+ - [Architecture Overview](../deployment/docs/02-CONFIGURATION.md)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@roomi-fields/notebooklm-mcp",
3
- "version": "1.2.1",
3
+ "version": "1.3.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": {