NotebookLM MCP Gateway
Unofficial MCP server that enables interaction with NotebookLM through a Cloudflare Worker, supporting tools for notebooks, sources, chat, notes, and more. It uses OAuth authentication and stateless encrypted credential envelopes.
README
NotebookLM MCP Gateway
Unofficial TypeScript Cloudflare Worker that exposes a remote Streamable HTTP MCP gateway for NotebookLM.
The gateway lets an MCP client complete OAuth against the Worker, paste a fresh NotebookLM browser request artifact during authorization, and then call NotebookLM through MCP tools. The Worker is intentionally stateless: NotebookLM browser credentials are encrypted into signed OAuth/MCP token artifacts and are not stored in KV, Durable Objects, D1, R2, cache, or the filesystem.
Important disclaimer
This project uses reverse-engineered, undocumented NotebookLM/Google browser APIs.
- It is not affiliated with, endorsed by, or supported by Google, NotebookLM, OpenAI, Anthropic, or Cloudflare.
- NotebookLM internal endpoints, RPC IDs, payload shapes, authentication requirements, quotas, and product behavior may change without notice.
- The MCP tools may break, return partial data, or behave differently across account tiers, regions, languages, and future NotebookLM releases.
- Users paste browser authentication material into the OAuth page. Only self-host this Worker, or use deployments operated by someone you explicitly trust.
- This is best treated as experimental software for personal projects, prototypes, and research automation. There are no stability, availability, or data-loss guarantees.
See SECURITY.md before deploying or connecting real accounts.
Features
- Remote MCP endpoint at
/mcpusing Streamable HTTP. - OAuth Authorization Code + PKCE for public clients.
- Dynamic Client Registration at
POST /register. - Short-lived MCP bearer access tokens and stateless refresh tokens bounded by the selected connector expiration.
- Encrypted NotebookLM credential envelopes inside signed OAuth artifacts.
- Server-enforced OAuth/MCP scopes so users can grant read-only or selected chat/write/delete/share capabilities at consent time.
- Zod-backed MCP input/output schemas and
structuredContenton successful tool calls. - Sanitized MCP tool errors and tool outputs that avoid exposing cookies, Authorization headers, JWTs, or raw upstream response bodies.
- Explicit guards for destructive or permission-changing tools.
Tools
The current MCP tool surface covers notebooks, sources, chat, notes, Studio artifacts, research, and sharing:
list_notebooks, get_notebook, create_notebook, rename_notebook, delete_notebook,
list_sources, add_url_source, add_youtube_source, add_text_source, add_drive_source,
get_source_guide, get_source_content, refresh_source, delete_source,
ask_notebook, get_last_conversation_id, get_conversation_turns,
list_notes, create_note, update_note, delete_note,
list_artifacts, generate_artifact, download_artifact,
start_research, poll_research, import_research_sources,
get_share_status, set_share_public
See docs/TOOLS.md for read/write/destructive markers and known limitations.
OAuth and MCP scopes
OAuth consent is least-privilege by default. If the client omits scope or sends it blank, the Worker grants only notebooklm:read. Unknown scopes or duplicate scope parameters are rejected with 400 invalid_request.
Supported scopes:
notebooklm:read— required baseline; read notebooks, sources, notes, chats, artifacts, and sharing status.notebooklm:chat— ask questions, start research, and generate Studio artifacts.notebooklm:write— create/edit notebooks, sources, notes, refresh sources, and import research sources.notebooklm:delete— delete notebooks, sources, and notes.notebooklm:share— change public link sharing.
The authorization page renders human-readable scope checkboxes. Optional scopes requested by the client are pre-checked and can be deselected before granting. Auth codes, access tokens, and refresh tokens carry the granted scope snapshot; refresh-token exchange preserves that exact snapshot and cannot widen access. /token responses include the granted scope string. MCP tools/list only advertises tools allowed by the token scopes, and direct calls to ungranted tools fail without invoking NotebookLM.
Limitations
- NotebookLM APIs are private and can break without warning.
- Browser file upload is not implemented; safe Worker proxying needs additional size, streaming, and trust-boundary work.
- Binary artifact downloads are not proxied.
download_artifactrequests export metadata/URLs where available. - Stateless auth codes and refresh tokens cannot be server-side revoked or replay-detected before JWT expiry.
- OAuth/MCP scopes are capability-level only. Object-level authorization still relies on the pasted NotebookLM browser session and upstream NotebookLM permissions.
- Fine-grained user permission management is intentionally limited; only public/private link sharing is exposed through
notebooklm:share.
Local development
npm ci
npm run dev
npm test
npm run typecheck
npm run dev uses dummy local-only signing/encryption values and localhost OAuth issuer/resource/audience overrides. Never reuse those values in a deployed Worker.
Deployment overview
-
Edit
wrangler.jsoncsoOAUTH_ISSUER,MCP_RESOURCE, andMCP_AUDIENCEmatch your deployed Worker URL exactly. -
Set secrets through Wrangler stdin only:
openssl rand -base64 48 | wrangler secret put OAUTH_JWT_SIGNING_KEY_B64 openssl rand -base64 32 | wrangler secret put NOTEBOOKLM_CREDENTIAL_ENC_KEY_B64 openssl rand -base64 48 | wrangler secret put CSRF_SIGNING_KEY_B64 -
Run checks and deploy:
npm run check npx wrangler deploy
Do not store real secrets, browser cookies, Copy-as-cURL artifacts, or MCP/OAuth tokens in .env, .dev.vars, docs, logs, or git.
OAuth redirect policy
Dynamic Client Registration and /authorize enforce a narrow redirect allowlist:
https://chatgpt.com/connector/oauth/{callback_id}where{callback_id}matches[A-Za-z0-9_-]+https://chatgpt.com/connector_platform_oauth_redirecthttps://claude.ai/api/mcp/auth_callback- loopback
http://localhost:{port}/callback,http://127.0.0.1:{port}/callback, andhttp://[::1]:{port}/callback
Optional OAUTH_EXTRA_REDIRECT_URI_PATTERNS can add tested HTTPS clients. It cannot allow arbitrary non-loopback HTTP redirects.
Credits and prior art
This gateway was built with protocol and UX inspiration from:
teng-lin/notebooklm-py— comprehensive unofficial NotebookLM Python API/CLI/MCP project.jacob-bd/notebooklm-mcp-cli— unofficial NotebookLM CLI and MCP server.
Those projects are independent; credit here does not imply endorsement or shared maintainership.
License
MIT. See LICENSE.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。