Notebooklm Go
Notebook LM MCP SERVER
Ask AI about Notebooklm Go
Powered by Claude Β· Grounded in docs
I know everything about Notebooklm Go. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
notebooklm-mcp-go
English
A Golang rewrite of PleasePrompto/notebooklm-mcp β an MCP server that lets AI agents (Claude Code, Cursor, Codexβ¦) query Google NotebookLM notebooks for source-grounded, citation-backed answers powered by Gemini.
What's different from the TypeScript original?
| Feature | TypeScript original | Go rewrite |
|---|---|---|
| Runtime | Node.js + npx | Single static binary |
| Browser automation | Patchright (Playwright fork) | go-rod (Chrome DevTools Protocol) |
| Startup time | ~3β5 s (node bootstrap) | ~100 ms |
| Memory | ~150 MB idle | ~25 MB idle |
| Binary size | ~100 MB (node_modules) | ~14 MB |
| MCP transport | @modelcontextprotocol/sdk | Hand-rolled JSON-RPC 2.0 over stdio |
All 16 tools from the original are implemented.
Quick Start
# Build
go build -o notebooklm-mcp-go .
# Register as an MCP server (Claude Code)
claude mcp add notebooklm ./notebooklm-mcp-go
# Or add to your claude_desktop_config.json:
# {
# "mcpServers": {
# "notebooklm": {
# "command": "/path/to/notebooklm-mcp-go"
# }
# }
# }
How To Use This MCP
This project is an MCP server. You usually do not call its tools manually. Instead, you:
- Build the binary
- Register it in your MCP client
- Ask your AI agent to use NotebookLM
- The agent calls these tools for you over MCP
Typical user flow
- Build and register the server.
- Ask your agent to authenticate:
Set up NotebookLM authentication- This calls
setup_authand opens Chrome for Google login.
- Verify status:
Check NotebookLM health- This calls
get_health.
- Add a notebook to the local library:
Add my NotebookLM notebook- The agent should collect the NotebookLM URL, description, topics, and use cases, then call
add_notebook.
- Select a default notebook if needed:
Use <notebook name> as my default notebook- This calls
select_notebook.
- Start asking questions:
Ask my notebook to summarize the API designAsk the same session to compare v1 and v2 behaviour- This calls
ask_question, optionally reusingsession_id.
How MCP clients typically interact with it
- Claude Code / Claude Desktop: Register the binary as an MCP server, then ask for actions in natural language.
- Cursor / Codex / other MCP-aware clients: Add the server command in that client's MCP/server config, then instruct the agent normally.
- Direct execution:
Running
./notebooklm-mcp-gostarts a stdio JSON-RPC MCP server. This is for MCP clients, not for interactive terminal use.
Example prompts you can give your agent
Set up NotebookLM authenticationShow NotebookLM server healthList my notebooksAdd this NotebookLM notebook to the librarySelect the notebook named <name>Ask the active notebook: what are the main design tradeoffs?Continue the previous NotebookLM session and ask for implementation stepsReset the current NotebookLM sessionClean up NotebookLM data but keep my library
Client-specific MCP configuration examples
The exact MCP UI and file format can change by client version. The examples below match the current documented patterns for stdio-based local MCP servers.
Claude Desktop / Claude Code
Claude Code can register the server directly from the CLI:
claude mcp add notebooklm ./notebooklm-mcp-go
If you want to configure Claude Desktop manually, add an entry like this to your MCP config JSON:
{
"mcpServers": {
"notebooklm": {
"command": "C:\\Users\\andyl\\Myprogram\\notebooklm-go\\notebooklm-mcp-go.exe",
"args": [],
"env": {
"DEBUG": "0"
}
}
}
}
Notes:
- Replace the
commandpath with your actual built binary location. - On macOS/Linux, use the absolute binary path such as
/Users/you/path/notebooklm-mcp-go. - If you build frequently, keep the binary path stable so the client config does not need updating.
Cursor
Cursor reads MCP configuration from project-level .cursor/mcp.json or global ~/.cursor/mcp.json.
Project-local example:
{
"mcpServers": {
"notebooklm": {
"command": "${workspaceFolder}/notebooklm-mcp-go",
"args": [],
"env": {
"DEBUG": "0"
}
}
}
}
Windows example using an absolute path:
{
"mcpServers": {
"notebooklm": {
"command": "C:\\Users\\andyl\\Myprogram\\notebooklm-go\\notebooklm-mcp-go.exe",
"args": [],
"env": {
"DEBUG": "0"
}
}
}
}
Notes:
- If you keep the binary in the repo root,
${workspaceFolder}/notebooklm-mcp-gois convenient on macOS/Linux. - On Windows, prefer the
.exepath. - After editing
mcp.json, restart Cursor or reload MCP servers.
Codex
Codex supports MCP through the CLI and shared config.
CLI registration example:
codex mcp add notebooklm -- C:\Users\andyl\Myprogram\notebooklm-go\notebooklm-mcp-go.exe
If you prefer config file setup, add this to ~/.codex/config.toml:
[mcp_servers.notebooklm]
command = "C:\\Users\\andyl\\Myprogram\\notebooklm-go\\notebooklm-mcp-go.exe"
args = []
[mcp_servers.notebooklm.env]
DEBUG = "0"
macOS/Linux example:
[mcp_servers.notebooklm]
command = "/absolute/path/to/notebooklm-mcp-go"
args = []
[mcp_servers.notebooklm.env]
DEBUG = "0"
Notes:
codex mcp listcan be used to verify the server is registered.- Codex shares MCP configuration between the CLI and IDE extension.
- Keep the server name short and descriptive, for example
notebooklm.
Tools
Core
| Tool | Description |
|---|---|
ask_question | Ask a question to a NotebookLM notebook. Supports session continuity, notebook selection, and browser options. |
Session Management
| Tool | Description |
|---|---|
list_sessions | List all active browser sessions with age, message count, last activity |
close_session | Close a specific session by ID |
reset_session | Reset chat history for a session (reload notebook page) |
System
| Tool | Description |
|---|---|
get_health | Auth state, active sessions, configuration summary |
setup_auth | Open a visible browser for manual Google login |
re_auth | Switch accounts / fresh authentication (clears all data) |
cleanup_data | Deep cleanup of all MCP data files with preview + confirm |
Library Management
| Tool | Description |
|---|---|
add_notebook | Add a NotebookLM notebook to your persistent library |
list_notebooks | List all notebooks with metadata |
get_notebook | Get a specific notebook by ID |
select_notebook | Set the active notebook |
update_notebook | Update notebook metadata |
remove_notebook | Remove a notebook from the library |
search_notebooks | Search notebooks by name, description, topics, or tags |
get_library_stats | Usage statistics for your notebook library |
What each tool is for
| Tool | When to use it | Notes |
|---|---|---|
ask_question | Ask NotebookLM a question grounded in notebook sources | Supports session_id, notebook_id, notebook_url, and browser overrides |
list_sessions | Inspect active browser-backed chat sessions | Useful for debugging or reusing session context |
close_session | End one session and free browser resources | Requires session_id |
reset_session | Keep the same session ID but clear chat history | Reloads the notebook page |
get_health | Check auth state, configuration, and current session stats | Good first diagnostic command |
setup_auth | First-time Google login for NotebookLM | Opens a visible browser |
re_auth | Login again with the same or a different Google account | Clears old auth and closes sessions |
cleanup_data | Preview or delete local NotebookLM MCP data | Supports confirm and preserve_library |
add_notebook | Save a NotebookLM notebook into the local library | Requires notebook metadata |
list_notebooks | Show all notebooks in the local library | Includes metadata and URLs |
get_notebook | Show one notebook's details | Requires notebook id |
select_notebook | Set the default notebook used by ask_question | Requires notebook id |
update_notebook | Edit saved notebook metadata | Requires notebook id |
remove_notebook | Remove a notebook from the local library | Does not delete the real NotebookLM notebook |
search_notebooks | Find notebooks by topic/name/tag/description | Useful once the library grows |
get_library_stats | Show usage counts and active notebook status | Good for operational visibility |
Recommended operating sequence
If you are using this MCP for the first time, follow this order:
setup_authget_healthadd_notebooklist_notebooksselect_notebookask_question
For ongoing use:
get_healthlist_notebooksorsearch_notebooksask_questionlist_sessions/reset_session/close_sessionif you need session management
Configuration
Environment Variables
# NotebookLM
NOTEBOOK_URL=https://notebooklm.google.com/notebook/...
# Browser
HEADLESS=true # Run headless (default: true)
BROWSER_TIMEOUT=30000 # Timeout in ms
# Sessions
MAX_SESSIONS=10 # Max concurrent sessions
SESSION_TIMEOUT=900 # Session idle timeout in seconds
# Auto-login (optional)
AUTO_LOGIN_ENABLED=false
LOGIN_EMAIL=you@gmail.com
LOGIN_PASSWORD=yourpassword
# Stealth (human-like behavior)
STEALTH_ENABLED=true
STEALTH_HUMAN_TYPING=true
TYPING_WPM_MIN=160
TYPING_WPM_MAX=240
MIN_DELAY_MS=100
MAX_DELAY_MS=400
# Tool profile
NOTEBOOKLM_PROFILE=full # minimal | standard | full
NOTEBOOKLM_DISABLED_TOOLS=cleanup_data,re_auth
CLI Config Commands
# Show current settings
./notebooklm-mcp-go config get
# Set tool profile
./notebooklm-mcp-go config set profile minimal
./notebooklm-mcp-go config set profile standard
./notebooklm-mcp-go config set profile full
# Disable specific tools
./notebooklm-mcp-go config set disabled-tools "cleanup_data,re_auth"
# Reset to defaults
./notebooklm-mcp-go config reset
Settings are saved to ~/.config/notebooklm-mcp/settings.json.
What the CLI config affects
profile: Limits which tools are exposed to the MCP client.disabled-tools: Hides selected tools even if the current profile would normally allow them.- These settings affect the tool list returned by the server at startup.
Profiles
| Profile | Tools included |
|---|---|
minimal | ask_question, get_health, setup_auth |
standard | + re_auth, list_sessions, close_session, list_notebooks, select_notebook, add_notebook |
full | All 16 tools (default) |
Data Paths
| Platform | Data directory |
|---|---|
| Linux | ~/.local/share/notebooklm-mcp/ |
| macOS | ~/Library/Application Support/notebooklm-mcp/ |
| Windows | %APPDATA%\notebooklm-mcp\ |
Library: <data>/library.json
Auth state: <data>/browser_state/state.json
Chrome profile: <data>/chrome_profile/
Architecture
Your Task
βββΊ Claude / Codex / Cursor
βββΊ MCP Server (JSON-RPC over stdio)
βββΊ go-rod (Chrome DevTools Protocol)
βββΊ Chrome / Chromium
βββΊ NotebookLM (Gemini 2.5)
βββΊ Your Docs
Package Structure
.
βββ main.go # Entry point + CLI config
βββ internal/
β βββ config/config.go # Configuration (env vars + defaults)
β βββ auth/auth_manager.go # Browser state / cookie persistence
β βββ library/
β β βββ types.go # Library data types
β β βββ library.go # Persistent notebook library (library.json)
β βββ session/session.go # Browser sessions + session manager
β βββ tools/
β β βββ definitions.go # MCP tool definitions (schemas + descriptions)
β β βββ handlers.go # Tool implementation logic
β βββ mcp/server.go # JSON-RPC 2.0 MCP server (stdio transport)
β βββ utils/
β βββ logger.go # Structured logging to stderr
β βββ settings.go # Profile/tool filtering settings
βββ go.mod
First-Time Setup
- Build the binary:
go build -o notebooklm-mcp-go . - Register with your MCP client
- Ask Claude: "Set up NotebookLM authentication" β calls
setup_auth - A Chrome window opens β log in to your Google account
- After login, auth state is saved to disk automatically
- Verify: "Check NotebookLM health" β calls
get_health - Add a notebook: "Add my NotebookLM notebook" β Claude guides you through
add_notebook - Start querying: "Ask my notebook about X" β calls
ask_question
Common Workflows
1. First-time authentication
- Start the MCP server through your client.
- Ask the agent to run
setup_auth. - Log in to Google in the browser window.
- Ask the agent to run
get_health. - Confirm
authenticated=true.
2. Add a notebook and query it
- Create or open a notebook in NotebookLM.
- Copy its shareable URL.
- Ask the agent to add it via
add_notebook. - Optionally call
select_notebook. - Ask questions through
ask_question.
3. Continue a conversation
- Ask a first question with
ask_question. - Keep the returned
session_id. - Ask follow-up questions using the same
session_id. - Use
reset_sessionif you want a clean conversation without deleting the session record.
4. Troubleshooting
- If NotebookLM stops answering as expected, run
get_health. - If the Google account changed or the login expired, run
re_auth. - If browser/session state is corrupted, run
cleanup_datawith preview first, then confirm deletion. - If you want to keep your saved notebooks during cleanup, set
preserve_library=true.
Rate Limits
Free Google accounts: 50 queries/day. When the limit is hit:
ask_questionreturns aRateLimitError- Use
re_authto switch to a different Google account - Or wait until the next day
Upgrade to Google AI Pro/Ultra for 5Γ higher limits.
License
MIT β same as the original TypeScript project.
ηΉι«δΈζ
δΈζηθ«εθ README.zh-TW.mdγ
