#!/usr/bin/env node /** * NotebookLM MCP Server * * MCP Server for Google NotebookLM - Chat with Gemini 3 through NotebookLM * with session support and human-like behavior! * * Features: * - Session-based contextual conversations * - Auto re-login on session expiry * - Human-like typing and mouse movements * - Persistent browser fingerprint * - Stealth mode with Patchright * - Claude Code integration via npx * * Usage: * npx notebooklm-mcp * node dist/index.js * * Environment Variables: * NOTEBOOK_URL - Default NotebookLM notebook URL * AUTO_LOGIN_ENABLED - Enable automatic login (true/false) * LOGIN_EMAIL - Google email for auto-login * LOGIN_PASSWORD - Google password for auto-login * HEADLESS - Run browser in headless mode (true/false) * MAX_SESSIONS - Maximum concurrent sessions (default: 10) * SESSION_TIMEOUT - Session timeout in seconds (default: 900) * * Based on the Python NotebookLM API implementation */ import type { Transport } from "@modelcontextprotocol/sdk/shared/transport.js"; /** * Main MCP Server Class */ export declare class NotebookLMMCPServer { private readonly options; private server; private authManager; private sessionManager; private library; private toolHandlers; private resourceHandlers; private settingsManager; private toolDefinitions; private toolRegistry; private complianceToolNames; private retentionTimer?; private readonly advancedToolsEnabled; constructor(options?: { registerShutdownHandlers?: boolean; }); private filterAdvancedTools; private filterAdvancedToolRegistry; /** * Setup MCP request handlers */ private setupHandlers; /** * Setup graceful shutdown handlers */ private setupShutdownHandlers; /** * Bootstrap the compliance module at startup: * 1. Display the privacy notice to stderr on first run and auto-record * acknowledgment (stdio MCP cannot prompt interactively, so the * notice is informational — operators wishing for explicit consent * should call the `grant_consent` MCP tool). * 2. Run the retention engine immediately and schedule it every 6 hours * so archive/delete policies actually fire. Timer is unref()'d so it * does not keep the process alive on shutdown. */ private bootstrapCompliance; /** * Start the MCP server */ start(transport?: Transport): Promise; stop(): Promise; } /** * Main entry point */ export declare function main(): Promise;