notebooklm-mcp-server 1.1.0 → 1.1.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.
package/dist/auth.js CHANGED
@@ -25,22 +25,48 @@ export class AuthManager {
25
25
  let isDone = false;
26
26
  try {
27
27
  await Promise.race([
28
- // Wait for redirect to dashboard or notebook
29
- page.waitForURL(url => url.origin === 'https://notebooklm.google.com' &&
30
- (url.pathname.includes('/notebook') || url.pathname === '/'), { timeout: 300000 }).then(() => { isDone = true; }),
31
- // Wait for user icon or other logged-in indicia
32
- page.waitForSelector('button[aria-label*="Account"], img[src*="googleusercontent.com"]', { timeout: 300000 })
28
+ // Wait for redirect to a specific notebook (the most common landing after login)
29
+ page.waitForURL('**/notebook/**', { timeout: 300000 }).then(() => { isDone = true; }),
30
+ // Wait for visual elements that only appear when logged in
31
+ // 1. The "Create new" button or notebook grid
32
+ page.waitForSelector('div[role="main"], .notebook-grid, button:has-text("Create new"), button:has-text("Crear nuevo")', { timeout: 300000 })
33
33
  .then(() => { isDone = true; }),
34
- // Safety fallback: if we see the landing page, we might already be logged in
35
- page.waitForFunction(() => {
36
- const body = document.body.innerText;
37
- return window.location.href.includes('notebooklm.google.com') &&
38
- !body.includes('Sign in') &&
39
- (body.includes('Notebooks') || body.includes('Create new'));
40
- }, { polling: 2000, timeout: 300000 }).then(() => { isDone = true; }),
34
+ // 2. The account button (usually an img or button with aria-label)
35
+ page.waitForSelector('button[aria-label*="Account"], button[aria-label*="Cuenta"], img[src*="googleusercontent.com"]', { timeout: 300000 })
36
+ .then(() => { isDone = true; }),
37
+ // 3. Fallback: check if we have the critical session cookies
38
+ new Promise((resolve) => {
39
+ const checkLoop = async () => {
40
+ if (isDone)
41
+ return;
42
+ try {
43
+ const cookies = await context.cookies();
44
+ const hasSession = cookies.some(c => c.name === '__Secure-3PSID' || c.name === 'SID');
45
+ if (hasSession && page.url().includes('notebooklm.google.com')) {
46
+ isDone = true;
47
+ resolve(true);
48
+ }
49
+ else {
50
+ setTimeout(checkLoop, 2000);
51
+ }
52
+ }
53
+ catch (e) {
54
+ isDone = true;
55
+ }
56
+ };
57
+ checkLoop();
58
+ })
41
59
  ]);
42
- // Small delay to ensure all session cookies are synced
43
- await page.waitForTimeout(2000);
60
+ // Ensure we actually have cookies before proceeding
61
+ const finalCookies = await context.cookies();
62
+ const hasSid = finalCookies.some(c => c.name === '__Secure-3PSID' || c.name === 'SID');
63
+ if (!hasSid) {
64
+ // If we don't have session cookies, we might have just landed on the landing page
65
+ // Wait a bit more or throw to avoid saving empty/expired sessions
66
+ if (onStatus)
67
+ onStatus('Verifying session session...');
68
+ await page.waitForTimeout(3000);
69
+ }
44
70
  }
45
71
  catch (e) {
46
72
  throw new Error('Authentication timed out or browser was closed.');
package/dist/index.js CHANGED
@@ -4,7 +4,7 @@ const program = new Command();
4
4
  program
5
5
  .name('notebooklm-mcp-server')
6
6
  .description('NotebookLM MCP Server (Node.js)')
7
- .version('1.1.0');
7
+ .version('1.1.1');
8
8
  program
9
9
  .command('server')
10
10
  .description('Start the MCP server (default)')
package/dist/server.js CHANGED
@@ -6,7 +6,7 @@ import { AuthManager } from "./auth.js";
6
6
  import chalk from "chalk";
7
7
  const server = new Server({
8
8
  name: "notebooklm-mcp-server",
9
- version: "1.1.0",
9
+ version: "1.1.1",
10
10
  }, {
11
11
  capabilities: {
12
12
  tools: {},
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "notebooklm-mcp-server",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "Node.js Model Context Protocol server for Google NotebookLM",
5
5
  "type": "module",
6
6
  "repository": {