nblm-mcp
nblm-mcp
一个 MCP 服务器,让 AI 代理能够访问 Google NotebookLM(2026 年 7 月更名为 Gemini Notebook):列出和创建笔记本、管理其 来源、提出基于这些来源并附带引用的问题, 以及生成 Studio 产物,如音频概览、简报文档、测验和 思维导图。
关键在于落地。NotebookLM 只根据你提供的材料作答,
因此能够调用 ask 的代理可以从你自己的文档中获得带引用的答案,
而不是凭空猜测——并且不会消耗你自己上下文的 token,因为
Gemini 在服务端完成阅读。
⚠️ 非官方——请先阅读
Google 没有为 NotebookLM 提供公开的消费者 API。 本服务器驱动的是 notebooklm.google.com 界面所调用的同一个私有 Web 端点, 通过你自己的浏览器会话 cookie 进行身份验证,基于 MIT 许可的
notebooklm-py库。
与 Google 无关联,也未获得 Google 认可。
内部 API 可能随时变更,从而导致本服务器失效。
适用你 Google 账户的速率限制和每日 Studio 配额。
请使用你愿意用于自动化的账户。最适合个人 项目、研究和原型开发。
Google 确实为 Gemini Notebook Enterprise 提供了文档化的官方 API。如果你 拥有带该功能的 Workspace/Cloud 组织,请优先使用它,而不是本服务器。
安装
尚未发布到 PyPI——直接从本仓库安装。uvx 会按需构建并运行,
因此无需手动保持更新:
uvx --from git+https://github.com/Diego-Dev-Moros/nblm-mcp nblm-mcpRelated MCP server: notebooklm-mcp-server
登录一次
登录需要 auth 附加依赖(Playwright)以及人工在键盘前操作:
uvx --from "nblm-mcp[auth] @ git+https://github.com/Diego-Dev-Moros/nblm-mcp" nblm-mcp-login浏览器窗口会打开;像平常一样登录 NotebookLM。会话
cookie 存储在 ~/.notebooklm/ 下(与
notebooklm-py 使用的配置文件布局相同,因此已有的 notebooklm login 也能复用)。MCP
服务器绝不会自行登录——它需要一个交互式浏览器,而
MCP 宿主无法提供这一点。
如果还没有浏览器,请先运行 playwright install chromium。
Cookie 会过期。过期后,工具会开始返回身份验证错误;请重新运行 登录命令。
连接到客户端
Claude Code——使用 -s user 即可在每个项目中可用:
claude mcp add notebooklm -s user -- \
uvx --from git+https://github.com/Diego-Dev-Moros/nblm-mcp nblm-mcpClaude Desktop——将其添加到 claude_desktop_config.json 并重启
应用(macOS:~/Library/Application Support/Claude/,Windows:
%APPDATA%\Claude\,Linux:~/.config/Claude/):
{
"mcpServers": {
"notebooklm": {
"command": "uvx",
"args": ["--from", "git+https://github.com/Diego-Dev-Moros/nblm-mcp", "nblm-mcp"]
}
}
}Claude Desktop 从图形界面启动,不会继承你 shell 中的
PATH。如果服务器在那里无法启动,请将 "uvx" 替换为它的绝对
路径(which uvx,通常为 ~/.local/bin/uvx)。
无论哪种方式,都可以让代理调用 auth_status 来确认是否正常工作。
工具
工具 | 功能 |
| 通过真实请求验证已存储的会话;告知你是否需要重新登录。 |
| 列出该账户可访问的所有笔记本,以及 ID 和来源数量。 |
| 获取单个笔记本及其来源;可选地包含 NotebookLM 自己的摘要。 |
| 创建一个空笔记本。 |
| 删除一个笔记本及其所有内容。需要 |
| 列出笔记本中的来源及其处理状态。 |
| 从 URL(网页、YouTube、Drive)、粘贴的文本或本地文件添加一个来源。 |
| 移除一个来源。需要 |
| 向笔记本提问;返回答案并将引用解析为来源标题。 |
| 获取笔记本的过往问答轮次。 |
| 列出已生成的 Studio 产物及其状态——这也是轮询生成进度的方法。 |
| 生成音频、视频、简报文档、学习指南、测验、抽认卡、信息图、幻灯片或思维导图。 |
| 将已完成的产物下载到运行服务器的机器上的一个文件。 |
行为说明
破坏性工具设有门禁。
delete_notebook和delete_source在没有confirm=true的情况下拒绝执行,因此误调用不会销毁 笔记本。生成速度慢且受配额限制。
generate_artifact在任务 进入队列后立即返回(默认wait=false),并告知代理轮询list_artifacts。传入wait=true则会阻塞等待;最多等待NBLM_GENERATION_TIMEOUT秒。文件路径是服务器端的。
add_source(file_path=...)和download_artifact在运行 MCP 服务器的主机上读写文件,而该主机 不一定就是用户聊天客户端所在的位置。
配置
全部可选——参见 .env.example。工作
目录中的 .env 文件会被加载(如果存在)。
变量 | 默认值 | 用途 |
| active profile | 选择使用哪个已存储的登录,用于多个 Google 账户。 |
| resolved from profile | 显式指定 |
|
|
|
|
|
|
|
| 等待新来源完成处理的秒数。 |
开发
uv venv && uv pip install -e ".[dev]"
uv run pytest
uv run ruff check src tests测试套件针对内存中的模拟客户端运行工具——它从不 接触 Google,因此在任何地方运行都安全且快速。
相关项目
notebooklm-py 完成了最困难的部分
——逆向工程并维护私有的 batchexecute 协议——并且
自带一个更庞大的 MCP 服务器。本项目是在该库之上构建的一个更小、更聚焦的工具
集合:更少的工具、对破坏性操作的确认门禁、
以及将引用解析为答案的功能。
许可证
MIT——参见 LICENSE。
Available Tools
13 toolsadd_sourceA
Add one source to a notebook, from a URL, pasted text, or a local file.
Pass exactly one of url, text, or file_path.
Inputs: notebook_id (required), url, text, wait, +2 more. Returns: object
askA
Ask a notebook a question and get an answer grounded in its sources.
The answer comes from Gemini reading the notebook's own sources, with citations back to them — use this instead of summarizing the sources yourself when a notebook already holds the material.
Inputs: question (required), notebook_id (required), source_ids, conversation_id. Returns: object
auth_statusA
Check whether this server has a working NotebookLM session.
Call this first when any other tool reports an auth problem. It performs a real (cheap) request, so it distinguishes "no cookies stored" from "cookies stored but expired".
Inputs: no named parameters. Returns: object
chat_historyB
Read past question/answer turns for a notebook's current conversation.
Inputs: notebook_id (required), limit. Returns: object
create_notebookA
Create an empty notebook.
A notebook with no sources cannot answer questions — follow up with add_source before calling ask.
Inputs: title (required). Returns: object
delete_notebookA
Permanently delete a notebook and everything in it.
This cannot be undone and deletes the notebook's sources, chats, and generated artifacts along with it.
Inputs: notebook_id (required), confirm. Returns: object
delete_sourceC
Remove a source from a notebook.
Inputs: source_id (required), notebook_id (required), confirm. Returns: object
download_artifactB
Download a completed Studio artifact to a file on the server host.
Inputs: artifact_id (required), notebook_id (required), output_path. Returns: object
generate_artifactA
Generate a Studio artifact (podcast, report, quiz, mind map...).
Generation runs server-side and is slow — an audio overview commonly takes several minutes — and it consumes the account's daily Studio quota. Prefer the default wait=false and poll with list_artifacts.
Inputs: kind (required), notebook_id (required), wait, language, +7 more. Returns: object
get_notebookC
Get one notebook with its sources.
Inputs: notebook_id (required), include_summary. Returns: object
list_artifactsA
List generated Studio artifacts in a notebook.
Use this to poll a generation started with wait=false: the artifact reports
status: completed when it is ready to download.
Inputs: notebook_id (required), kind. Returns: object
list_notebooksA
List the notebooks reachable by the signed-in Google account.
Returns id, title, and source count for each. Use the ids with every other tool — NotebookLM has no lookup by title.
Inputs: no named parameters. Returns: object
list_sourcesB
List the sources in a notebook, with their processing status.
A source that is not ready is still being ingested and will not ground
answers yet.
Inputs: notebook_id (required). Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 13 tools
Most tools target a distinct resource+action (notebook CRUD, source add/delete/list, artifact generate/list/download, ask, auth). Minor overlap between get_notebook (returns notebook with sources) and list_sources (sources with processing status), but descriptions clarify the difference.
Strong verb_noun pattern for most tools (add_source, list_notebooks, create_notebook, list_artifacts, generate_artifact, download_artifact). A few deviations—ask (bare verb), chat_history and auth_status (noun phrases)—but overall readable and predictable.
13 tools is well-scoped for the NotebookLM domain, cleanly grouped into notebooks, sources, artifacts, and query/auth concerns. Each tool earns its place with no filler.
Good CRUD/lifecycle coverage: notebook create/get/list/delete, source add/delete/list, artifact generate/list/download, plus ask, chat_history, and auth_status. Minor gaps like notebook rename/update and source update, but core workflows are covered.
Related MCP Connectors
Google NotebookLM via natural language: create notebooks, add sources (PDF, URL, YouTube) and ask gr
Google Gemini Notebook (NotebookLM): notebooks, sources, cited chat, podcasts, video, slides
Turn any recording or document into notes, flashcards and quizzes your agent can read and act on
Create, search and manage Knowtis collaborative notes from AI assistants.
Related MCP Servers
- FlicenseAqualityDmaintenanceEnables AI agents to query and interact with Google NotebookLM notebooks to retrieve citation-backed information. It provides tools for listing notebooks, accessing source data, and asking natural language questions.11-
- AlicenseBqualityDmaintenanceEnables AI agents to interact with Google NotebookLM for grounded, hallucination-free answers through notebook management, source management, research, and generation tools.29255 npm45MIT
- AlicenseBqualityAmaintenanceEnables AI assistants to programmatically interact with Google NotebookLM, allowing them to create and manage notebooks, add sources, query content, generate audio/video, and perform research tasks through natural language commands.5518,759 PyPI6,558MIT
- AlicenseAqualityDmaintenanceEnables AI assistants to programmatically access and control Google NotebookLM, supporting operations like notebook management, source addition, audio generation, and more via natural language.39MIT