Unofficial NotebookLM MCP server and CLI — drives NotebookLM's internal RPCs through a Playwright session.
Project description
notebooklm-mcp
An unofficial NotebookLM MCP server and CLI — inspired by
jacob-bd/notebooklm-mcp-cli.
⚠️ NotebookLM has no public API. This project talks to NotebookLM's internal
batchexecute/GenerateFreeFormStreamedRPCs through a Playwright persistent-context session. It is not affiliated with Google.
What works today
| Tool | Status | Notes |
|---|---|---|
notebook_list |
✅ | Returns "mine" + "shared" notebooks. Pagination for many owned notebooks not yet discovered (shows most-recent owned). |
notebook_create |
✅ | Untitled empty notebook. |
notebook_delete |
✅ | Permanent, no undo. |
notebook_query |
✅ | Streams the answer with inline [1][2] citations. |
source_add |
⚠️ | kind="text" and kind="url" work. drive / file stubs. |
research_start |
✅ | NotebookLM Discover → returns candidate URLs (does not auto-import). |
research_and_ask |
✅ | One-shot: create → research → import → ask N questions → (optional) delete. |
studio_create |
⚠️ | artifact="audio" (podcast) works. video / slides / mindmap / etc. stubs. |
download_artifact |
✅ | Saves completed audio as .m4a. |
refresh_auth |
✅ | Checks whether the stored Google session is still live. |
Stubs (raise NotImplementedError): notebook_share_public,
notebook_share_invite, source_sync_drive, source_get_content,
studio_revise, cross_notebook_query, batch, pipeline, tag.
End-to-end workflow this supports
Manual orchestration:
notebook_create() → empty notebook
research_start(nid, topic) → ~10 candidate URLs
source_add(nid, kind="url")×N → import the ones you want
notebook_query(nid, question) → grounded answer with citations
studio_create(nid, "audio") → start podcast generation (2-5 min)
download_artifact(nid) → .m4a file on disk
Or, in a single call:
research_and_ask(
topic="history of the Cold War space race",
questions=["Who reached space first?", "Key consequences?"],
max_sources=3,
keep_notebook=False, # ephemeral — delete after
)
# → { sources_imported: [...], qa: [{question, answer, ...}, ...] }
Install (dev)
uv venv
uv pip install -e ".[dev]"
uv run playwright install chromium
First-time Google login
NotebookLM requires a signed-in Google session. Run once, headed:
uv run nlm login
A Chromium window opens. Complete Google OAuth; the session is saved to
the OS user-data dir (NLM_PROFILE_DIR to override). Subsequent runs are
headless.
Verify:
uv run nlm status
# {'logged_in': True}
Run the MCP server
uv run notebooklm-mcp
# or
uv run nlm serve
Claude Code (project-scoped, auto-picked-up)
.mcp.json in this repo is already configured. When you open the project in
Claude Code it prompts you to trust and loads notebooklm automatically.
Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"notebooklm": {
"command": "uv",
"args": ["--directory", "/absolute/path/to/this/repo", "run", "notebooklm-mcp"]
}
}
}
Repo layout
src/notebooklm_mcp/
server.py # FastMCP entry
cli.py # `nlm` CLI (login/status/serve)
browser.py # Playwright persistent context
config.py # paths, env
tools/
notebook.py source.py studio.py research.py workflow.py auth.py
Status
- Package scaffold, MCP server, CLI
- Playwright session with persistent Google login
- All tools registered (stubs)
-
notebook_listDOM scrape -
notebook_querychat flow -
source_add(url/text/drive/file) -
studio_createaudio (podcast) + download - remaining tools
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file notebooklm_mcp_lisa-0.1.0.tar.gz.
File metadata
- Download URL: notebooklm_mcp_lisa-0.1.0.tar.gz
- Upload date:
- Size: 111.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b0c6f315bdbfad8f2a66261d67dd1e1924383c32b5187613d8e4e129a2aa13f7
|
|
| MD5 |
fe8b785e00fd8d5f06b79cf95b3af10c
|
|
| BLAKE2b-256 |
793c14149abfd4828a47f2718e4ca087117b339b1a22fa289ab2fb58572c649c
|
File details
Details for the file notebooklm_mcp_lisa-0.1.0-py3-none-any.whl.
File metadata
- Download URL: notebooklm_mcp_lisa-0.1.0-py3-none-any.whl
- Upload date:
- Size: 22.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6f5bbfb12ca0ec845ecefb4ff90ad8b26ad62670c175d5b49977d136daa97aa2
|
|
| MD5 |
6b9ebf0e1c71bbbbbedaa8e862397473
|
|
| BLAKE2b-256 |
c152af8cb1c23562d17d15c850a79ae5a1064181897beff93ea838bb12107ef0
|