---
name: php186-skill-28387
description: "通过 Chrome 开发者工具协议登录 Google NotebookLM 并保存认证 cookies，用于 notebooklm-mcp。当用户要求登录、认证或重新认证时使用。"
---

# NotebookLM MCP Login

## NotebookLM MCP Login

 

Authenticate with Google and save cookies for the ` notebooklm-mcp ` CLI/MCP server.

 

## Why this skill exists

 

The built-in ` nlm login ` command sometimes fails to launch Chromium via ` subprocess.Popen ` in non-standard environments. This skill provides a tested workaround that:

 

1. Manually launches Chromium with ` --remote-debugging-port=9222 `
2. Waits for the user to complete Google login in the browser
3. Extracts cookies via CDP (` extract_cookies_via_existing_cdp `)
4. Saves them to ` ~/.notebooklm-mcp-cli/profiles/default/ ` via ` AuthManager.save_profile() `

 

## Steps

 

### 1. Verify prerequisites

 

```
which chromium-browser && which uv
```

 

If missing, install Chromium (` apt install chromium-browser `) and uv (` curl -LsSf https://astral.sh/uv/install.sh | sh `).

 

### 2. Run the login script

 

```
DISPLAY=:0 ~/.local/share/uv/tools/notebooklm-mcp-cli/bin/python3 {baseDir}/scripts/login.py
```

 

- A Chromium window opens on the host display.
- The user logs in to their Google account.
- The script waits up to 300s, then extracts and saves cookies automatically.

 

### 3. Verify

 

```
uv tool run --from notebooklm-mcp-cli nlm login --check
```

 

Expected output: ` ✓ Authentication valid! ` with email and notebook count.

 

## Storage

 

- Cookies: ` ~/.notebooklm-mcp-cli/profiles/default/cookies.json `
- Metadata: ` ~/.notebooklm-mcp-cli/profiles/default/metadata.json `

 

## Troubleshooting

 

| Problem | Fix |
| --- | --- |
| ` Cannot connect to browser on port 9222 ` | Kill stale Chrome: ` pkill -f remote-debugging-port=9222 ` |
| ` Profile not found: default ` | Re-run the login script |
| ` DISPLAY ` not set | Export ` DISPLAY=:0 ` before running |
