NotebookLM MCP Server
# NotebookLM CLI & MCP Server — Enterprise + Personal

[](https://pypi.org/project/notebooklm-enterprise-mcp/)
[](https://github.com/Robiton/notebooklm-mcp-cli/blob/main/LICENSE)
[](https://github.com/jacob-bd/notebooklm-mcp-cli)
> **This is an enterprise-focused fork of [jacob-bd/notebooklm-mcp-cli](https://github.com/jacob-bd/notebooklm-mcp-cli).**
> It adds full support for **NotebookLM Enterprise** (`notebooklm.cloud.google.com`) via the official Discovery Engine REST API, while keeping all personal-mode features intact.
> If you only use personal NotebookLM, the upstream repo is the right choice. If you have a Google Workspace enterprise account, you're in the right place.
### What this fork adds over upstream
| Addition | Details |
|---|---|
| **Enterprise REST API client** | Official Discovery Engine API — not reverse-engineered batchexecute |
| **GCP OAuth2 authentication** | `gcloud auth login` instead of browser cookies |
| **`configure_mode` MCP tool** | Switch personal ↔ enterprise from within Claude, with auth pre-checks |
| **Paywall detection** | URL sources checked for login/subscription walls before adding |
| **Per-URL batch fault isolation** | One bad URL in a batch no longer fails the entire batch |
| **Standalone Podcast API** | Generate podcasts from raw text — no notebook required |
| **Persistent config** | `nlm config set enterprise.mode enterprise` — no env var editing each session |
> All personal-mode features (chat, video, reports, flashcards, research, sharing, etc.) are fully preserved.
**Programmatic access to Google NotebookLM** — via command-line interface (CLI) or Model Context Protocol (MCP) server. Supports both Personal and Enterprise accounts.
📺 **Watch the Demos**
> **Note:** The demos below are from the upstream project ([jacob-bd/notebooklm-mcp-cli](https://github.com/jacob-bd/notebooklm-mcp-cli)) and show personal mode features. All commands and MCP tools work identically in this fork — enterprise mode adds on top of everything shown here.
### Latest
| **Codex Setup + Cinematic Video & Slides** |
|:---:|
| [](https://www.youtube.com/watch?v=KrgLCrvU1dw) |
### MCP Demos
| **General Overview** | **Claude Desktop** | **Perplexity Desktop** | **MCP Super Assistant** |
|:---:|:---:|:---:|:---:|
| [](https://www.youtube.com/watch?v=d-PZDQlO4m4) | [](https://www.youtube.com/watch?v=PU8JhgLPxes) | [](https://www.youtube.com/watch?v=BCKlDNg-qxs) | [](https://www.youtube.com/watch?v=7aHDbkr-l_E) |
### CLI Demos
| **CLI Overview** | **CLI, MCP & Skills** | **Setup, Doctor & mcpb** | **Infographics Support** |
|:---:|:---:|:---:|:---:|
| [](https://www.youtube.com/watch?v=XyXVuALWZkE) | [](https://www.youtube.com/watch?v=ZQBQigFK-E8) | [](https://www.youtube.com/watch?v=5tOUilBTJ3Q) | [](https://www.youtube.com/watch?v=Uc6iH5NuQ9A) |
## Two Ways to Use
### 🖥️ Command-Line Interface (CLI)
Use `nlm` directly in your terminal for scripting, automation, or interactive use:
```bash
nlm notebook list # List all notebooks
nlm notebook create "Research Project" # Create a notebook
nlm source add <notebook> --url "https://..." # Add sources
nlm audio create <notebook> --confirm # Generate podcast
nlm download audio <notebook> <artifact-id> # Download audio file
nlm share public <notebook> # Enable public link
```
Run `nlm --ai` for comprehensive AI-assistant documentation.
### 🤖 MCP Server (for AI Agents)
Connect AI assistants (Claude, Gemini, Cursor, etc.) to NotebookLM:
```bash
# Automatic setup — picks the right config for each tool
nlm setup add claude-code
nlm setup add gemini
nlm setup add cursor
nlm setup add cline
nlm setup add antigravity
# Generate JSON config for any other tool
nlm setup add json
```
Then use natural language: *"Create a notebook about quantum computing and generate a podcast"*
## Features
| Capability | CLI Command | MCP Tool |
|------------|-------------|----------|
| List notebooks | `nlm notebook list` | `notebook_list` |
| Create notebook | `nlm notebook create` | `notebook_create` |
| Add Sources (URL, Text, Drive, File) | `nlm source add` | `source_add` |
| Query notebook (persists to web UI) | `nlm notebook query` | `notebook_query` |
| Create Studio Content (Audio, Video, etc.) | `nlm studio create` | `studio_create` |
| Revise slide decks | `nlm slides revise` | `studio_revise` |
| Download artifacts | `nlm download <type>` | `download_artifact` |
| Web/Drive research | `nlm research start` | `research_start` |
| Share notebook | `nlm share public/invite` | `notebook_share_*` |
| Sync Drive sources | `nlm source sync` | `source_sync_drive` |
| Batch operations | `nlm batch query/create/delete` | `batch` |
| Cross-notebook query | `nlm cross query` | `cross_notebook_query` |
| Pipelines (multi-step workflows) | `nlm pipeline run/list` | `pipeline` |
| Tag & smart select | `nlm tag add/list/select` | `tag` |
| Configure AI tools | `nlm setup add/remove/list` | — |
| Install AI Skills | `nlm skill install/update` | — |
| Diagnose issues | `nlm doctor` | — |
📚 **More Documentation:**
- **[CLI Guide](docs/CLI_GUIDE.md)** — Complete command reference
- **[MCP Guide](docs/MCP_GUIDE.md)** — All 35 MCP tools with examples
- **[Authentication](docs/AUTHENTICATION.md)** — Setup and troubleshooting
- **[API Reference](docs/API_REFERENCE.md)** — Internal API docs for contributors
## Important Disclaimer
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.
## Installation
> 🆕 **Claude Desktop users:** [Download the extension](https://github.com/Robiton/notebooklm-mcp-cli/releases/latest) (`.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)
```bash
uv tool install notebooklm-enterprise-mcp
```
### Using uvx (Run Without Install)
```bash
uvx --from notebooklm-enterprise-mcp nlm --help
uvx --from notebooklm-enterprise-mcp notebooklm-mcp
```
### Using pip
```bash
pip install notebooklm-enterprise-mcp
```
### Using pipx
```bash
pipx install notebooklm-enterprise-mcp
```
**After installation, you get:**
- `nlm` — Command-line interface
- `notebooklm-mcp` — MCP server for AI assistants
<details>
<summary>Alternative: Install from Source</summary>
```bash
# Clone the repository
git clone https://github.com/Robiton/notebooklm-mcp-cli.git
cd notebooklm-mcp
# Install with uv
uv tool install .
```
</details>
## Upgrading
```bash
# Using uv
uv tool upgrade notebooklm-enterprise-mcp
# Using pip
pip install --upgrade notebooklm-enterprise-mcp
# Using pipx
pipx upgrade notebooklm-enterprise-mcp
```
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
## Switching from Upstream (jacob-bd/notebooklm-mcp-cli)
If you were using the upstream package and want to switch to this fork for enterprise support:
### Step 1: Uninstall the upstream package
```bash
uv tool uninstall notebooklm-mcp-cli
# or: pip uninstall notebooklm-mcp-cli
```
### Step 2: Install this fork's package
```bash
uv tool install notebooklm-enterprise-mcp
```
### Step 3: Verify
```bash
uv tool list | grep notebooklm
# Should show: notebooklm-enterprise-mcp v1.0.0
# - nlm
# - notebooklm-mcp
```
### Step 4: Re-authenticate (if needed)
Your existing cookies from the upstream package should still work. If you hit auth errors:
```bash
nlm login
```
> **MCP configuration doesn't change** — the executable is still called `notebooklm-mcp`, so your Claude Code, Cursor, or other tool configs need no edits.
## Uninstalling
To completely remove the MCP:
```bash
# Using uv
uv tool uninstall notebooklm-enterprise-mcp
# Using pip
pip uninstall notebooklm-enterprise-mcp
# Using pipx
pipx uninstall notebooklm-enterprise-mcp
# Remove cached auth tokens and data (optional)
rm -rf ~/.notebooklm-mcp-cli
```
Also remove from your AI tools:
```bash
nlm setup remove claude-code
nlm setup remove cursor
# ... or any configured tool
```
## Why This Fork?
The upstream project targets personal NotebookLM accounts only. Enterprise NotebookLM (`notebooklm.cloud.google.com`) uses a completely different authentication system (GCP OAuth2) and a separate official REST API — it's not just a different URL.
This fork adds:
- **Enterprise REST API client** — official Discovery Engine API, not reverse-engineered batchexecute
- **Persistent config** — `nlm config set enterprise.mode enterprise` persists across restarts (no env var editing)
- **`configure_mode` MCP tool** — switch modes from within Claude with auth pre-checks
- **Paywall detection** — URL sources are checked for login/subscription walls before adding
- **Per-URL bulk results** — one bad URL in a batch doesn't fail the whole batch
- **Standalone Podcast API** — generate podcasts from raw text, no notebook needed
The enterprise REST API (`v1alpha`) covers notebooks, sources, and audio. Chat, video, reports, and other features remain personal-only — they have no documented REST endpoints. The hope is that Google promotes the API to `v1` stable and expands coverage over time.
See [docs/AUTHENTICATION.md](docs/AUTHENTICATION.md) for full enterprise setup instructions.
---
## Enterprise Mode
If you use **NotebookLM Enterprise** (notebooklm.cloud.google.com), configure enterprise mode:
### Via CLI
```bash
nlm config set enterprise.mode enterprise
nlm config set enterprise.project_id YOUR_PROJECT_NUMBER
nlm config set enterprise.location global # or "us" or "eu"
```
### Via MCP (Claude Desktop)
Ask Claude to call:
```
configure_mode(mode="enterprise", project_id="YOUR_PROJECT_NUMBER", location="global")
```
### Enterprise Authentication
Enterprise uses GCP OAuth2 instead of browser cookies:
```bash
gcloud auth login
```
### Switch Back to Personal
```bash
nlm config set enterprise.mode personal
```
### Enterprise Feature Support
| Feature | Personal | Enterprise |
|---------|----------|------------|
| Notebooks (list/create/get/delete) | All | All |
| Sources (add URL/text/YouTube/Drive/file) | All | All |
| Audio Overview (podcast) | Yes | Yes |
| Standalone Podcast API | No | Yes |
| Sharing | Public + email | Email only (org-scoped) |
| Chat/Query | Yes | Not in REST API |
| Video, Reports, Flashcards, etc. | Yes | Not in REST API |
Environment variables (`NOTEBOOKLM_MODE`, `NOTEBOOKLM_PROJECT_ID`, `NOTEBOOKLM_LOCATION`) override config.toml when set.
### Paywall / Login-Required URLs
When adding URL sources, the MCP checks if the URL is behind a paywall or login wall. If your organisation hosts content on an internal domain or a subscription site you have access to, add it to your approved list to skip the check:
```bash
# Approve a single domain
nlm config set sources.approved_domains '["yourcompany.com"]'
# Approve multiple domains
nlm config set sources.approved_domains '["yourcompany.com", "ft.com", "wsj.com"]'
```
Or in the MCP, call `source_add` with `skip_paywall_check=True` to bypass for a single URL.
## Authentication
Before using the CLI or MCP, you need to authenticate with NotebookLM:
### CLI Authentication (Recommended)
```bash
# Auto mode: launches your browser, you log in, cookies extracted automatically
nlm login
# Check if already authenticated
nlm login --check
# Use a named profile (for multiple Google accounts)
nlm login --profile work
nlm login --profile personal
# Manual mode: import cookies from a file
nlm login --manual --file cookies.txt
# External CDP provider (e.g., OpenClaw-managed browser)
nlm login --provider openclaw --cdp-url http://127.0.0.1:18800
```
**Profile management:**
```bash
nlm login --check # Show current auth status
nlm login switch <profile> # Switch the default profile
nlm login profile list # List all profiles with email addresses
nlm login profile delete <profile> # Delete a profile
nlm login profile rename <old> <new> # Rename a profile
```
Each profile gets its own isolated browser session, so you can be logged into multiple Google accounts simultaneously.
### Standalone Auth Tool
If you only need the MCP server (not the CLI):
```bash
nlm login # Auto mode (launches browser)
nlm login --manual # Manual file mode
```
**How it works:** Auto mode launches a dedicated browser profile (supports Chrome, Arc, Brave, Edge, Chromium, 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 `brave`, `arc`, `edge`, `chrome`, etc.). Falls back to auto-detection if the preferred browser is not found.
For detailed instructions and troubleshooting, see **[docs/AUTHENTICATION.md](docs/AUTHENTICATION.md)**.
## MCP Configuration
> **⚠️ Context Window Warning:** This MCP provides **35 tools**. Disable it when not using NotebookLM to preserve context. In Claude Code: `@notebooklm-mcp` to toggle.
### Automatic Setup (Recommended)
Use `nlm setup` to automatically configure the MCP server for your AI tools — no manual JSON editing required:
```bash
# Add to any supported tool
nlm setup add claude-code
nlm setup add claude-desktop
nlm setup add gemini
nlm setup add cursor
nlm setup add windsurf
# Generate JSON config for any other tool
nlm setup add json
# Check which tools are configured
nlm setup list
# Diagnose installation & auth issues
nlm doctor
```
### Install AI Skills (Optional)
Install the NotebookLM expert guide for your AI assistant to help it use the tools effectively. Supported for **Cline**, **Antigravity**, **OpenClaw**, **Codex**, **OpenCode**, **Claude Code**, and **Gemini CLI**.
```bash
# Install skill files
nlm skill install cline
nlm skill install openclaw
nlm skill install codex
nlm skill install antigravity
# Update skills
nlm skill update
```
### Remove from a tool
```bash
nlm setup remove claude-code
```
### Using uvx (No Install Required)
If you don't want to install the package, you can use `uvx` to run on-the-fly:
```bash
# Run CLI commands directly
uvx --from notebooklm-enterprise-mcp nlm setup add cursor
uvx --from notebooklm-enterprise-mcp nlm login
```
For tools that use JSON config, point them to uvx:
```json
{
"mcpServers": {
"notebooklm-mcp": {
"command": "uvx",
"args": ["--from", "notebooklm-enterprise-mcp", "notebooklm-mcp"]
}
}
}
```
<details>
<summary>Manual Setup (if you prefer)</summary>
> **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:
```bash
claude mcp add --scope user notebooklm-mcp notebooklm-mcp
gemini mcp add --scope user notebooklm-mcp notebooklm-mcp
```
**Cursor / Windsurf** resolve commands from your `PATH`, so the command name is enough:
```json
{
"mcpServers": {
"notebooklm-mcp": {
"command": "notebooklm-mcp"
}
}
}
```
| Tool | Config Location |
|------|-----------------|
| Cursor | `~/.cursor/mcp.json` |
| Windsurf | `~/.codeium/windsurf/mcp_config.json` |
**Claude Desktop / VS Code** may not resolve `PATH` — use the full path to the binary:
```json
{
"mcpServers": {
"notebooklm-mcp": {
"command": "/full/path/to/notebooklm-mcp"
}
}
}
```
Find your path with: `which notebooklm-mcp`
| Tool | Config Location |
|------|-----------------|
| Claude Desktop | `~/Library/Application Support/Claude/claude_desktop_config.json` |
| VS Code | `~/.vscode/mcp.json` |
</details>
📚 **Full configuration details:** [MCP Guide](docs/MCP_GUIDE.md) — Server options, environment variables, HTTP transport, multi-user setup, and context window management.
## What You Can Do
Simply chat with your AI tool (Claude Code, Cursor, Gemini CLI) using natural language. Here are some examples:
### Research & Discovery
- "List all my NotebookLM 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"
- "Search my Google Drive for documents about 'product roadmap' and create a notebook"
### Adding Content
- "Add this URL to my notebook: https://example.com/article"
- "Add this YouTube video about Kubernetes to the notebook"
- "Add my meeting notes as a text source to this notebook"
- "Import this Google Doc into my research notebook"
### AI-Powered Analysis
- "What are the key findings in this notebook?"
- "Summarize the main arguments across all these sources"
- "What does this source say about security best practices?"
- "Get an AI summary of what this notebook is about"
- "Configure the chat to use a learning guide style with longer responses"
*(All queries sent from CLI or MCP automatically persist in your NotebookLM web UI chat history!)*
### Content Generation
- "Create an audio podcast overview of this notebook in deep dive format"
- "Generate a video explainer with classic visual style"
- "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"
### Smart Management
- "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"
### 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 user@example.com 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
| Component | Duration | Refresh |
|-----------|----------|---------|
| Cookies | ~2-4 weeks | Auto-refresh via headless browser (if profile saved) |
| CSRF Token | ~minutes | Auto-refreshed on every request failure |
| Session ID | Per MCP session | Auto-extracted on MCP start |
**v1.0.0+**: The server now automatically handles token expiration:
1. Refreshes CSRF tokens immediately when expired
2. Reloads cookies from disk if updated externally
3. Runs headless browser auth if profile has saved login
You can also call `refresh_auth()` to explicitly reload tokens.
If automatic refresh fails (Google login fully expired), run `nlm login` again.
## Troubleshooting
### `uv tool upgrade` Not Installing Latest Version
**Symptoms:**
- Running `uv tool upgrade notebooklm-enterprise-mcp` installs an older version than expected
- `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:**
```bash
uv tool install --force notebooklm-enterprise-mcp
```
This bypasses any cached constraints and installs the absolute latest version from PyPI.
**Verify:**
```bash
uv tool list | grep notebooklm
# Should show: notebooklm-enterprise-mcp v1.0.0 (or latest)
```
## Limitations
- **Rate limits**: Free tier has ~50 queries/day
- **No official support**: API may change without notice
- **Cookie expiration**: Need to re-extract cookies every few weeks
## Reporting Issues
Use the **[GitHub Issues](https://github.com/Robiton/notebooklm-mcp-cli/issues/new/choose)** tab — you'll be prompted to pick the right template:
| Template | Use when |
|---|---|
| **Bug — Enterprise** | Something broken in enterprise mode (GCP, Discovery Engine API) |
| **Bug — Personal** | Something broken in personal mode that's specific to this fork |
| **Feature Request** | New capability you'd like to see |
| **Question** | Setup help, usage questions, config issues |
> **Personal mode bugs** that also exist in the upstream project should be filed at [jacob-bd/notebooklm-mcp-cli](https://github.com/jacob-bd/notebooklm-mcp-cli/issues) first — fixes accepted there get cherry-picked here automatically.
## Contributing
See [CONTRIBUTING.md](CONTRIBUTING.md) for setup instructions, PR process, and how to add new features.
## A Note on This Fork
This fork started as an internal tool to fill a real gap: NotebookLM Enterprise had no programmatic access, and the upstream project (which is excellent) is scoped to personal accounts only. The enterprise implementation was built with AI assistance — I'm not a professional Python developer — so if you see something that could be done better, PRs are genuinely welcome.
The upstream project's original "vibe coding" spirit applies here too: the goal was to solve a problem, not to write a textbook. The code works, passes tests, and is production-stable enough for daily use. But experienced developers will likely see room for improvement, and that input is valuable.
See [CONTRIBUTING.md](CONTRIBUTING.md) for how to get involved — especially if you have enterprise NotebookLM access and can test end-to-end.
## Credits
Special thanks to:
- **Le Anh Tuan** ([@latuannetnam](https://github.com/latuannetnam)) for contributing the HTTP transport, debug logging system, and performance optimizations.
- **David Szabo-Pele** ([@davidszp](https://github.com/davidszp)) for the `source_get_content` tool and Linux auth fixes.
- **saitrogen** ([@saitrogen](https://github.com/saitrogen)) for the research polling query fallback fix.
- **devnull03** ([@devnull03](https://github.com/devnull03)) for multi-browser CDP authentication support (Arc, Brave, Edge, Chromium, Vivaldi, Opera).
- **VooDisss** ([@VooDisss](https://github.com/VooDisss)) for multi-browser authentication improvements.
- **codepiano** ([@codepiano](https://github.com/codepiano)) for the configurable DevTools timeout for the auth CLI.
- **Tony Hansmann** ([@997unix](https://github.com/997unix)) for contributing the `nlm setup` and `nlm doctor` commands and CLI Guide documentation.
- **Fabiana Furtado** ([@fabianafurtadoff](https://github.com/fabianafurtadoff)) for batch operations, cross-notebook query, pipelines, and smart select/tagging (PR #90).
## License
[MIT License](LICENSE)
TDQS
Scored across 41 tools
Each tool targets a distinct operation or resource. Even with many tools, the boundaries are clear: notebook CRUD, source management, research pipeline, studio artifacts, notes, sharing, tags, etc. No two tools perform the same function.
Tool names follow different patterns: some use noun_verb (notebook_create, source_add), others verb_noun (download_artifact, export_artifact), and some are single words (note, batch). While subdomains have internal consistency, the overall naming is mixed.
41 tools is a very large surface for a single server. Although it covers extensive NotebookLM functionality, the count is high enough to overwhelm agents. Several tools could be consolidated (e.g., async query start/status, podcast tools redundant with studio).
The toolset covers nearly all NotebookLM features: full CRUD for notebooks, sources, notes, artifacts, research, sharing, tags, configuration, authentication, and batch operations. No obvious gaps in functionality for the domain.