Programmatic access to Gemini Notebook β via command-line interface (CLI) or Model Context Protocol (MCP) server.
π¨ New: Protected login storage (recommended) Your saved Google login can now be encrypted, with its key kept in your computer's keychain instead of a plain file. We highly recommend everyone switch on a personal computer: nlm auth storage set protected π‘ You can also use the 'nlm setup' wizard and select the 'Credentials Protection' option in the wizard Optional: nothing changes unless you turn it on. Servers, cron, Docker and SSH setups can keep the plain file. π How it works Β· πΊ Watch this short video π€ Fun fact: this video was created by an agent using the gemini-notebook-mcp.
π¨ New: Protected login storage (recommended) Your saved Google login can now be encrypted, with its key kept in your computer's keychain instead of a plain file. We highly recommend everyone switch on a personal computer:
π‘ You can also use the 'nlm setup' wizard and select the 'Credentials Protection' option in the wizard
Optional: nothing changes unless you turn it on. Servers, cron, Docker and SSH setups can keep the plain file. π How it works Β· πΊ Watch this short video
π€ Fun fact: this video was created by an agent using the gemini-notebook-mcp.
Note: Personal/consumer accounts are tested regularly. Gemini Notebook Enterprise support is experimental. The documented notebook.cloud.google.com host has been live-verified with a project-qualified global deployment; other Enterprise host variants may require additional validation.
Note: Personal/consumer accounts are tested regularly. Gemini Notebook Enterprise support is experimental. The documented notebook.cloud.google.com host has been live-verified with a project-qualified global deployment; other Enterprise host variants may require additional validation.
β If you find notebooklm-mcp-cli useful, consider buying me a coffee . It's free and built in my spare time β but testing every Gemini Notebook feature takes real time and resources. A coffee helps me cover it and keep shipping. Thank you! π
β If you find notebooklm-mcp-cli useful, consider buying me a coffee . It's free and built in my spare time β but testing every Gemini Notebook feature takes real time and resources. A coffee helps me cover it and keep shipping. Thank you! π
Real workflows, start to finish. The newest videos are first, then the demo that matches how you work.
New here? Start with Claude in 5 minutes . It is the shortest path from install to your first notebook query.
New here? Start with Claude in 5 minutes . It is the shortest path from install to your first notebook query.
Three commands take you from nothing to a connected AI assistant:
Install (gives you nlm and the MCP server):
Sign in to your Google account:
Connect your AI tools:
The setup wizard ( nlm setup )
nlm setup finds the AI tools installed on your machine and connects them to Gemini Notebook β no config files to edit. Pick an option with the arrow keys:
Esc goes back from any screen (and quits from the main ).
Every file is backed up to ~/.notebooklm-mcp-cli/backups/ before it is changed.
Connects to: Claude Code, Claude Desktop (regular and Relay AI / 3P), Codex CLI / ChatGPT desktop app, Gemini CLI, Cursor, Windsurf, Cline, Antigravity, GitHub Copilot (VS Code), and OpenCode. The skill also installs for Hermes and OpenClaw.
Claude Desktop Chat & Cowork, and claude.ai: these only use skills uploaded to your Claude account. In Add the skill , tick Claude Desktop / claude.ai β the wizard saves ~/Downloads/nlm-skill.zip and shows where to upload it ( Customize β Skills β Add ). Or run nlm skill package .
Claude Desktop: fully quit it (Cmd+Q) before connecting β it can overwrite its settings while open, so the wizard refuses to write until it's closed.
Scripts and CI: every option has a direct command β nlm setup add , nlm setup remove , nlm setup list , nlm skill install . See MCP Configuration .
π₯οΈ Command-Line Interface (CLI)
Use nlm directly in your terminal for scripting, automation, or interactive use:
Run nlm --ai for comprehensive AI-assistant documentation.
π€ MCP Server (for AI Agents)
Connect AI assistants (Claude, Gemini, Cursor, etc.) to Gemini Notebook:
Then use natural language: "Create a notebook quantum computing and generate a podcast"
π More Documentation:
Getting Started β Install, login, agent setup, and migration from another Gemini Notebook MCP
CLI Guide β Complete command reference
MCP Guide β All 55 MCP tools with examples
Authentication β Setup and troubleshooting
Remote MCP β Web/mobile connector feasibility, security, and authentication limitations
API Reference β Internal API docs for contributors
This MCP and CLI use internal APIs that:
Are undocumented and may change without notice
Require cookie extraction from your browser (I have a tool for that!)
Use at your own risk for personal/experimental purposes.
π Claude Desktop users: Download the extension ( .mcpb file) β double-click β done! One-click install, no config needed.
π Claude Desktop users: Download the extension ( .mcpb file) β double-click β done! One-click install, no config needed.
Install from PyPI. This single package includes both the CLI and MCP server :
Using uv (Recommended)
Using uvx (Run Without Install)
After installation, you get:
nlm β Command-line interface
notebooklm-mcp β Gemini Notebook MCP server for AI assistants
After upgrading, restart your AI tool to reconnect to the updated MCP server:
Claude Code: Restart the application, or use /mcp to reconnect
Cursor: Restart the application
Gemini CLI: Restart the CLI session
Upgrading from Legacy Versions
If you previously installed the separate CLI and MCP packages, you need to migrate to the unified package.
Step 1: Check What You Have Installed
Legacy packages to remove:
Step 2: Uninstall Legacy Packages
Step 3: Reinstall the Unified Package
After removing legacy packages, reinstall to fix symlinks:
Why --force ? When multiple packages provide the same executable, uv can leave broken symlinks after uninstalling. The --force flag ensures clean symlinks.
Why --force ? When multiple packages provide the same executable, uv can leave broken symlinks after uninstalling. The --force flag ensures clean symlinks.
Step 4: Verify Installation
Step 5: Re-authenticate
Your existing cookies should still work, but if you encounter auth issues:
Note: The configured MCP server name is now gemini-notebook-mcp . The executable remains notebooklm-mcp for compatibility with existing installations.
Note: The configured MCP server name is now gemini-notebook-mcp . The executable remains notebooklm-mcp for compatibility with existing installations.
If you are setting up the tool for the first time β or migrating from a browser-based Gemini Notebook MCP β see the Getting Started Guide . It covers install, login, agent registration, and a step-by-step migration path that avoids the "two Gemini Notebook servers registered" trap.
To completely remove the MCP:
Also remove from your AI tools:
Before using the CLI or MCP, you need to authenticate with Gemini Notebook:
CLI Authentication (Recommended)
New profiles ask where to keep the saved login before the browser opens: Protected (encrypted, key in your OS keystore, recommended) or a plain file. Scripts can skip the question with nlm login --storage protected (or --storage file ). Existing profiles keep their mode; change it any time in nlm setup β Credential protection .
From an MCP-only app (for example Claude CoWork): ask the AI to use the profile tool. It can list your accounts, switch for the session, and, only if you ask, make one your saved default.
Unattended / scheduled refresh:
A live session self-heals β when Google's short-lived cookies age out, the client automatically runs a headless refresh. For unattended machines you can also refresh proactively from a scheduler so a session never lapses:
--http-only forces HTTP transport, including when CDP transport is configured. It cannot renew browser-dependent PSIDTS cookies or revive a fully expired login. Automatic recovery uses a per-process cooldown and failure budget; explicit refresh commands bypass these limits. See authentication guidance .
Run browser-based refresh on a timer (cron/launchd). It needs a saved Chrome profile from a prior nlm login , and does not apply when NOTEBOOKLM_COOKIES is set as an environment variable (that value overrides saved credentials).
Enterprise Authentication (Gemini Notebook Enterprise)
For organizations using Gemini Notebook Enterprise via Google Cloud, ask your Enterprise administrator for the project ID or number, the deployment location/multi-region, and confirmation that your account has access. The current documented host is notebook.cloud.google.com ; older deployments may use notebooklm.cloud.google.com or vertexaisearch.cloud.google.com .
Set Base URL, GCP Project ID & Location: export NOTEBOOKLM_BASE_URL=" # Required: your GCP project ID or project number from your administrator export NOTEBOOKLM_PROJECT_ID="your-gcp-project-id-or-number" # Optional: GCP location/multi-region from your administrator: global (default), us, or eu export NOTEBOOKLM_LOCATION="global"
Set Base URL, GCP Project ID & Location:
Save an Enterprise Auth Profile: This opens the configured Enterprise URL in an isolated browser profile. Sign in with your organization account: nlm login --profile enterprise nlm login switch enterprise You can switch back to a personal profile at any time: unset NOTEBOOKLM_BASE_URL NOTEBOOKLM_PROJECT_ID NOTEBOOKLM_LOCATION nlm login switch personal
Save an Enterprise Auth Profile: This opens the configured Enterprise URL in an isolated browser profile. Sign in with your organization account:
You can switch back to a personal profile at any time:
Configure MCP Server with Enterprise Environment Variables: When adding the MCP server to AI assistants (Claude, Cursor, etc.), pass NOTEBOOKLM_BASE_URL , NOTEBOOKLM_PROJECT_ID , and optionally NOTEBOOKLM_LOCATION : { "mcpServers": { "gemini-notebook-mcp": { "command": "notebooklm-mcp", "env": { "NOTEBOOKLM_BASE_URL": " "NOTEBOOKLM_PROJECT_ID": "your-gcp-project-id-or-number", "NOTEBOOKLM_LOCATION": "global" } } } }
Configure MCP Server with Enterprise Environment Variables: When adding the MCP server to AI assistants (Claude, Cursor, etc.), pass NOTEBOOKLM_BASE_URL , NOTEBOOKLM_PROJECT_ID , and optionally NOTEBOOKLM_LOCATION :
Each profile gets its own isolated browser session, so you can be logged into multiple Google accounts simultaneously. Enterprise environment variables apply to the current process, so keep them in an Enterprise-only shell or MCP configuration when you also use a personal account.
If you only need the MCP server (not the CLI):
How it works: Auto mode launches a dedicated browser profile (supports Chrome, Arc, Dia, Comet, Brave, Edge, Chromium, Firefox, and more), you log in to Google, and cookies are extracted automatically. Your login persists for future auth refreshes.
Prefer a specific browser? Set it with nlm config set auth.browser chromium (or comet , dia , brave , arc , edge , chrome , firefox , etc.). Falls back to auto-detection if the preferred named browser is not found. For any other Chromium-compatible browser, set its executable with nlm config set auth.browser_path /path/to/browser or NLM_BROWSER_PATH ; an invalid explicit path fails closed instead of launching a different browser. When Chromium/CDP is unavailable, auto can fall back to Firefox.
For detailed instructions and troubleshooting, see docs/AUTHENTICATION.md .
β οΈ Context Window Warning: This MCP provides 55 tools . Disable it when not using Gemini Notebook to preserve context. In Claude Code: @gemini-notebook-mcp to toggle. To keep it on but expose only a subset, see Selective tool exposure .
β οΈ Context Window Warning: This MCP provides 55 tools . Disable it when not using Gemini Notebook to preserve context. In Claude Code: @gemini-notebook-mcp to toggle. To keep it on but expose only a subset, see Selective tool exposure .
Automatic Setup (Recommended)
The setup wizard is the recommended way to connect tools β see Quick Start for what each option does:
MCP configuration goes to each app's user-level settings. Codex CLI and the ChatGPT desktop app one MCP configuration on the same host. GitHub Copilot uses the VS Code user profile in the wizard; the direct command without --scope user targets the current workspace.
For direct setup or scripts, keep using the existing commands:
Claude Desktop setup only writes to profiles that are detected as present. If both regular and Relay AI/3P profiles exist, the CLI asks whether to configure regular, 3P, or both. For scripts, use --profile regular|3p|both . If no Claude Desktop profile is detected, nothing is created or changed.
Removal uses the same profile selection, for example nlm setup remove claude-desktop --profile regular . Removal only offers detected profiles containing this MCP or a recognized legacy entry; unrelated MCP servers are left untouched.
Before adding or removing the MCP, fully quit the selected Claude Desktop profile. The CLI detects running regular and Relay AI/3P instances and refuses to write while they are open, because Claude may rewrite the config and discard the change. Reopen Claude Desktop after setup completes.
Install AI Skills (Optional)
The wizard can install the prompting and workflow skill after MCP setup. It defaults to All projects (user level) and can instead install into the current project. Existing current or newer versions are preserved; older or unversioned skills require confirmation before replacement, with a backup made first.
You can also manage skills directly. Supported local skill targets include Cline , Antigravity , OpenClaw , Hermes , Codex , OpenCode , Claude Code , and Gemini CLI .
User-level skill installation requires the target tool to be detected first; the CLI will not create a missing tool directory or install anyway. Use --level project when you intentionally want a project-local skill.
Claude Desktop (Chat and Cowork) and claude.ai
Claude Desktop's Code tab is Claude Code, so it uses the skill installed in ~/.claude/skills/ . The Chat and Cowork tabs, and claude.ai, only use skills uploaded to your Claude account. Create the upload file with the wizard (tick Claude Desktop / claude.ai in Add the skill ) or directly:
Then in Claude Desktop (or claude.ai) open Customize β Skills β Add , pick nlm-skill.zip , and turn the skill on. Re-upload after updating nlm to get the latest skill. The MCP for Chat and Cowork comes from the normal Claude Desktop connection ( nlm setup β Add the MCP ).
Using uvx (No Install Required)
If you don't want to install the package, you can use uvx to run on-the-fly:
For tools that use JSON config, point them to uvx:
Tip: Run nlm setup add json for an interactive wizard that generates the right JSON snippet for your tool.
Tip: Run nlm setup add json for an interactive wizard that generates the right JSON snippet for your tool.
Claude Code / Gemini CLI support adding MCP servers via their own CLI:
Cursor / Windsurf resolve commands from your PATH , so the command name is enough:
GitHub Copilot (VS Code workspace) uses .vscode/mcp.json with a top-level servers key:
Claude Desktop may not resolve PATH β use the full path to the binary:
Find your path with: which notebooklm-mcp
π Full configuration details: MCP Guide β Server options, environment variables, HTTP transport, and context window management. For Claude web/mobile and public deployment, read Remote MCP Deployment first.
Simply chat with your AI tool (Claude Code, Cursor, Gemini CLI) using natural language. Here are some examples:
"List all my Gemini Notebook notebooks"
"Create a new notebook called 'AI Strategy Research'"
"Start web research on 'enterprise AI ROI metrics' and show me what sources it finds"
"Do a deep research on 'cloud marketplace trends' and import the top 10 sources"
" my Google Drive for documents 'product roadmap' and create a notebook"
"Add this URL to my notebook: "
"Add this YouTube video Kubernetes to the notebook"
"Add my meeting notes as a text source to this notebook"
"Import this Google Doc into my research notebook"
"What are the key findings in this notebook?"
"Summarize the main arguments across all these sources"
"What does this source say security best practices?"
"Get an AI summary of what this notebook is "
"Configure the chat to use a learning guide style with longer responses"
(All queries sent from CLI or MCP automatically persist in your Gemini Notebook web UI chat history!)
"Create an audio podcast overview of this notebook in deep dive format"
"Generate a video explainer with classic visual style"
"Make a short vertical video overview of the key idea"
"Make a briefing doc from these sources"
"Create flashcards for studying, medium difficulty"
"Generate an infographic in landscape orientation with professional style"
"Build a mind map from my research sources"
"Create a slide deck presentation from this notebook"
"Check which Google Drive sources are out of date and sync them"
"Show me all the sources in this notebook with their freshness status"
"Delete this source from the notebook"
"Check the status of my audio overview generation"
"Check this specific artifact without listing every Studio item"
"List only the generated videos in this notebook"
Sharing & Collaboration
"Show me the sharing settings for this notebook"
"Make this notebook public so anyone with the link can view it"
"Disable public access to this notebook"
"Invite [email protected] as an editor to this notebook"
"Add a viewer to my research notebook"
Pro tip: After creating studio content (audio, video, reports, etc.), poll the status to get download URLs when generation completes.
Authentication Lifecycle
v0.1.9+ : The server now automatically handles token expiration:
Refreshes CSRF tokens immediately when expired
Reloads cookies from disk if updated externally
Runs headless browser auth if profile has saved login
You can also call refresh_auth() to explicitly reload and validate tokens, or refresh_auth(profile="work") to refresh a named saved account without switching the MCP server's active account.
If automatic refresh fails (Google login fully expired), run nlm login again.
For suspected browser-bound auth replay failures, run nlm doctor auth-replay . If the cdp_in_page probe succeeds while normal replay fails, see Experimental browser-backed RPC transport .
uv tool upgrade Not Installing Latest Version
Running uv tool upgrade notebooklm-mcp-cli installs an older version (e.g., 0.1.5 instead of 0.1.9)
uv cache clean doesn't fix the issue
Why this happens: uv tool upgrade respects version constraints from your original installation. If you initially installed an older version or with a constraint, upgrade stays within those bounds by design.
Fix β Force reinstall:
This bypasses any cached constraints and installs the absolute latest version from PyPI.
Rate limits : Chat and Studio usage is metered as compute against a rolling (~5h) window and a weekly cap, scaled by plan tier. Run nlm usage to see what is left and when it resets
No official support : API may change without notice
Cookie expiration : Need to re-extract cookies every few weeks
See CLAUDE.md for detailed API documentation and how to add new features.
Full transparency: this project was built by a non-developer using AI coding assistants. If you're an experienced Python developer, you might look at this codebase and wince. That's okay.
The goal here was to scratch an itch - programmatic access to Gemini Notebook - and learn along the way. The code works, but it's likely missing patterns, optimizations, or elegance that only years of experience can provide.
This is where you come in. If you see something that makes you cringe, please consider contributing rather than just closing the tab. This is open source specifically because human expertise is irreplaceable. Whether it's refactoring, better error handling, type hints, or architectural guidance - PRs and issues are welcome.
Think of it as a chance to mentor an AI-assisted developer through code review. We all benefit when experienced developers their knowledge.
Le Anh Tuan ( @latuannetnam ) for contributing the HTTP transport, debug logging system, and performance optimizations.
David Szabo-Pele ( @davidszp ) for the source_get_content tool and Linux auth fixes.
saitrogen ( @saitrogen ) for the research polling query fallback fix.
devnull03 ( @devnull03 ) for multi-browser CDP authentication support (Arc, Brave, Edge, Chromium, Vivaldi, Opera).
VooDisss ( @VooDisss ) for multi-browser authentication improvements.
codepiano ( @codepiano ) for the configurable DevTools timeout for the auth CLI.
Tony Hansmann ( @997unix ) for contributing the nlm setup and nlm doctor commands and CLI Guide documentation.
Fabiana Furtado ( @fabianafurtadoff ) for batch operations, cross-notebook query, pipelines, and smart select/tagging (PR #90).
Amy-Ra-lph ( @Amy-Ra-lph ) for security hardening: TOCTOU-safe credential storage, sensitive cookie redaction from debug logs, and pinning all CI actions to full commit SHAs (PRs #205β207).
Kyle Brodeur ( @kylebrodeur ) for WSL2 authentication support with Windows Chrome integration (PR #138).
Robiton ( @Robiton ) for enterprise Gemini Notebook support via configurable base URL (PR #114).
pjeby ( @pjeby ) for connection pooling and fast startup improvements (PR #54).
beausea ( @beausea ) for making the interface language configurable via the NOTEBOOKLM_HL environment variable (PR #59).
JumpLao ( @JumpLao ) for extended audio, video, and image format support (PR #82).
cbruyndoncx ( @cbruyndoncx ) for including cited_text passages in query output (PR #81).
zxyasfas ( @zxyasfas ) for cited-only research import (PR #188).
Serdar AkΔ±n ( @SERDAR-AKIN ) for the multi-probe AuthHealthChecker that fixes false "stale" reports for semi-stale cookies (PR #219).
The full story
This article is one source in a clustered incident β the cluster page carries the summary, timeline and every other outlet covering it.
