This guide explains how to authenticate with NotebookLM MCP.
NotebookLM MCP uses browser cookies for authentication (there is no official API). The notebooklm-mcp-auth CLI tool extracts these cookies and caches them for the MCP server to use.
Two authentication methods are available:
| Method | Best For | Requires |
|---|---|---|
| Auto Mode (default) | Most users | Chrome installed, can close Chrome |
File Mode (--file) |
Complex setups, troubleshooting | Manual cookie extraction |
This method launches Chrome automatically and extracts cookies after you log in.
- Google Chrome installed
- Chrome must be completely closed before running
# 1. Close Chrome completely (Cmd+Q on Mac, or quit from taskbar)
# 2. Run the auth command
notebooklm-mcp-auth
# 3. Log in to your Google account in the browser window that opens
# 4. Wait for "SUCCESS!" message- A dedicated Chrome profile is created at
~/.notebooklm-mcp/chrome-profile/ - Chrome launches with remote debugging enabled
- You log in to NotebookLM via the browser
- Cookies and CSRF token are extracted and cached
- Chrome can be closed
The dedicated Chrome profile persists your Google login:
- First run: You must log in to Google
- Future runs: Already logged in, just extracts fresh cookies
This profile is separate from your regular Chrome profile and includes no extensions.
This method lets you manually extract and provide cookies. Use this if:
- Auto mode doesn't work on your system
- You have Chrome extensions that interfere (e.g., Google Antigravity IDE)
- You prefer manual control
# Option A: Interactive mode (shows instructions, prompts for file path)
notebooklm-mcp-auth --file
# Option B: Direct file path
notebooklm-mcp-auth --file /path/to/cookies.txt- Open Chrome and go to https://notebooklm.google.com
- Make sure you're logged in
- Press F12 (or Cmd+Option+I on Mac) to open DevTools
- Click the Network tab
- In the filter box, type:
batchexecute - Click on any notebook to trigger a request
- Click on a
batchexecuterequest in the list - In the right panel, scroll to Request Headers
- Find the line starting with
cookie: - Right-click the cookie value and select Copy value
- Paste into a text file and save
The cookie file should contain the raw cookie string from Chrome DevTools:
SID=abc123...; HSID=xyz789...; SSID=...; APISID=...; SAPISID=...; __Secure-1PSID=...; ...
Notes:
- Lines starting with
#are treated as comments and ignored - The file can contain the cookie string on one or multiple lines
- A template file
cookies.txtis included in the repository
Authentication tokens are cached at:
~/.notebooklm-mcp/auth.json
This file contains:
- Parsed cookies
- CSRF token (auto-extracted)
- Session ID (auto-extracted)
- Extraction timestamp
The dedicated Chrome profile (for auto mode) is stored at:
~/.notebooklm-mcp/chrome-profile/
Once authenticated, add the MCP to your AI tool:
Claude Code:
claude mcp add notebooklm-mcp -- notebooklm-mcpGemini CLI:
gemini mcp add notebooklm notebooklm-mcpManual (settings.json):
{
"mcpServers": {
"notebooklm-mcp": {
"command": "notebooklm-mcp"
}
}
}Then restart your AI assistant.
- Cookies: Generally stable for weeks, but some rotate on each request
- CSRF token: Auto-refreshed on each MCP client initialization
- Session ID: Auto-refreshed on each MCP client initialization
When you start seeing authentication errors, simply run notebooklm-mcp-auth again to refresh.
Close Chrome completely and try again. On Mac, use Cmd+Q to fully quit.
Try file mode instead:
notebooklm-mcp-auth --fileYour cookies have expired. Run the auth command again to refresh.
Some Chrome extensions or tools modify Chrome's behavior. Use file mode:
notebooklm-mcp-auth --fileMake sure you copied the cookie value, not the header name. The value should start with something like SID=... not cookie: SID=....
Chrome version 136 and later restrict remote debugging on the default profile for security reasons. This MCP works around this by:
- Using a dedicated profile directory (
~/.notebooklm-mcp/chrome-profile/) - Adding the
--remote-allow-origins=*flag for WebSocket connections
This is handled automatically - no action required from users.
- Cookies are stored locally in
~/.notebooklm-mcp/auth.json - The dedicated Chrome profile contains your Google login for NotebookLM
- Never share your
auth.jsonfile or commit it to version control - The
cookies.txtfile in the repo is a template - don't commit real cookies