This document is written for AI Agents to read. The user hands this repo to AntiGravity; after reading it, AntiGravity should be able to walk the user step by step through installation and authorization.
All commands and configuration formats in this document have been verified on real hardware on notebooklm-mcp-cli 0.5.19 / Windows 11 .
Execution principles for the Agent
- Do only one step at a time, and confirm the result of each step before moving to the next. Do not dump all the commands on the user at once.
- The user must operate the browser themselves for the login step; you cannot log in on their behalf. After running
nlm login, explicitly tell them "a browser window will pop up, please choose an account and click Allow", thenstop and wait for them to report back。 - For each step, explain "what this step does" in language the user can understand; do not just throw commands at them.
- If you hit an error, first check the "Troubleshooting" section of this document; do not guess or retry repeatedly.
- Neverpaste tokens, cookies, or authorization codes into the conversation, write them to files, or commit them to the repo.
- Neverask the user for their Google password—the OAuth flow does not require you to know the password.
Step 0: Prerequisite check
uv --version
If there is no uv , first ask the user to install uv (a Python package management tool), then continue.
Step 1: Install the CLI
uv tool install notebooklm-mcp-cli
Verify:
nlm --version
It should display something like nlm version 0.5.19。
What this step does: installs two executables—nlm(the command-line tool) and notebooklm-mcp(the MCP server itself). AntiGravity will connect to the latter.
Step 2: Log in (OAuth browser authorization)
nlm login
Tell the user what will happen, like this:
- After the command runs,the system automatically opens a browser window
- A Google login page appears
- The userselects the correct Google account—the one they normally use for NotebookLM
- Google lists the permissions to authorize; the user clicksAllow/Permit
- After authorization completes, the browser shows a success message, and the terminal's
nlm loginthen completes
⚠️ Required reading for the Agent
- This stepmust be completed by the user themselves. Do not fill it in on their behalf, and do not ask for the authorization code.
- When the user has multiple Google accounts, specifically remind themto make sure they pick the right one—picking the wrong one will connect to someone else's notebooks.
- After running the command,stop and wait for them to report back; do not proceed on your own.
Switching between multiple accounts
nlm login switch <profile>
After switching, the MCP server immediately uses the new default profile; no restart is needed.
Step 3: Verify login status
nlm doctor
Look at the Authentication section; it should show:
Authentication
Default profile: default
Profiles found: 1
Cookies: present (N cookies)
CSRF token: yes
Account: 使用者的信箱
It only counts as success if the Account shown is the correct email address.
Then confirm that data can actually be read:
nlm list
It should list the notebooks in the user's NotebookLM account.
Step 4: Register the MCP with AntiGravity ⭐
Use the official command; do not edit the JSON manually:
nlm setup add antigravity
If successful, it will show:
Antigravity — Adding NotebookLM MCP
✓ Added to Antigravity
C:\Users\<你>\.gemini\antigravity\mcp_config.json
Restart Antigravity to activate the MCP server.
🚫 Do not run
nlm setup listOn Windows Traditional Chinese (cp950), this command will crash outright (UnicodeDecodeError→AttributeError: 'NoneType' object has no attribute 'lower'), and configuringPYTHONIOENCODING=utf-8will not fix it either(it crashes during the subprocess probing of other tools). It is only a helper command that "lists the configuration status of each tool"; skipping it does not affect installation at all. To check the status, usenlm doctor。
Fallback: if you really need to configure it manually
Configuration file location (Windows):
C:\Users\<你的使用者名稱>\.gemini\antigravity\mcp_config.json
Correct content:
{
"mcpServers": {
"notebooklm": {
"command": "notebooklm-mcp",
"args": []
}
}
}
⚠️ Watch out for these common incorrect forms(all of them will fail to connect):
- ❌
"command": ["nlm", "mcp"]— command is astringnot an array, and the executable is callednotebooklm-mcp, notnlm mcp- ❌ Adding
"type": "local"or"enabled": true— this configuration file format does not have these fields- ❌ Missing the outer
"mcpServers"wrapper
If the file already contains other MCP settings, pleaseadd the notebooklm section into the existing mcpServers object, and do not overwrite the whole file.
📌 The desktop version and the CLI read different configuration files
Actual testing confirms that the MCP settings for these two areseparate:
| Execution environment | Configuration file location |
|---|---|
| AntiGravity desktop version | ~/.gemini/antigravity/mcp_config.json ← nlm setup add antigravity write here |
AntiGravity CLI(agy) |
~/.gemini/config/mcp_config.json |
In other words:After running nlm setup add antigravity , the desktop version will take effect, but the CLI will not automatically follow along. If the user needs to use both, the CLI copy must be added separately (same format as above, added under mcpServers ).
Note:
~/.gemini/antigravity-ide/and~/.gemini/antigravity-backup/also contain files with the same name, but actual testing shows they are 0-byte empty files; do not write to them.
About whether command should use an absolute path
nlm setup add uses the plain command name notebooklm-mcp, relying on PATH resolution. This is fine under normal circumstances —uv tool install will add ~/.local/bin(on Windows, C:\Users\<你>\.local\bin) to theuser-level PATH, and GUI programs will inherit it when they start.
But if the desktop version simply cannot find the executable, just change it to an absolute path:
{
"mcpServers": {
"notebooklm": {
"command": "C:\\Users\\<你>\\.local\\bin\\notebooklm-mcp.exe",
"args": ["--transport", "stdio"]
}
}
}
--transport The default value of is originally stdio, so adding it or not makes no difference; writing it out is just clearer.
Step 5: Restart and verify
Restart AntiGravity(the configuration file must be reloaded to take effect).
After restarting, have the Agent actually call a tool once to verify, for example by asking it to list the notebooks. Being able to list notebooks = done ✅
Optional: Install the NotebookLM skill
In addition to the MCP, you can also install an operating skill description for AntiGravity:
nlm skill install antigravity
Check the installation status (this command works normally on Windows):
nlm skill list
Troubleshooting
nlm setup list crash
Known issue; see the warning in Step 4.Skip it, and use nlm doctor to check the status.
Encoding errors / garbled text appear on Windows
$env:PYTHONIOENCODING = "utf-8"
Works for most prompts (but cannot fix nlm setup list). To make it permanent, add it to the PowerShell profile.
Authentication expired / authentication error
Just re-run the login; this is the most proper fix:
nlm login
nlm command not found
uv tool install executable is placed in the user's local bin (on Windows usually C:\Users\<你>\.local\bin). Confirm that directory is in PATH, or open a new terminal window and try again.
MCP does not appear in AntiGravity
Check in order:
- Run
notebooklm-mcpdirectly in the terminal to see if it starts mcp_config.jsonJSON format is correct (commas, brackets)- Whether command is written as a
"notebooklm-mcp"string (see the list of incorrect forms in step 4) - Whetheractually restartedAntiGravity
Browserless environment (headless / remote server)
OAuth requires a browser. On a machine with a browser, first complete nlm login; do not try to bypass it by manually pasting a token.
To remove the configuration
nlm setup remove antigravity
Security rules
- ❌ Do not copy or repost cookies, tokens, or authorization codes
- ❌ Do not commit notebook lists or source content to any repo
- ❌ Do not ask users for their Google password
- ✅ Always authorize through
nlm loginbrowser OAuth, completed by the user themselves on the Google page
What the Agent can do after completion
- List / create / delete notebooks
- Add sources (URLs, text, Google Drive files, local files)
- Ask questions about notebooks, query across notebooks
- Generate and download Studio artifacts (audio overviews, videos, infographics, presentations)
- Manage notes and sharing settings