notebooklm-mcp-integration-pattern
NotebookLM Full Stack Integration Pattern
Built notebooklm-mcp (42 tools) wrapping notebooklm-py v0.3.4 library. Key patterns:
- Auth model: Google session cookies in Playwright
storage_state.jsonformat. Chrome DevTools cookies convert 1:1 — wrap in{"cookies": [...], "origins": []}. Required cookies: SID, HSID, SSID, APISID, SAPISID. - Client singleton: Async double-init —
await from_storage()thenawait __aenter__(). Shared across all tool modules viaget_client(). - Tool registration:
__all__lists in each module +safe_tool()error wrapper +inspect.getmembers()fallback. 8 modules, 42 tools total. - Enum mapping: String params → library enums via
{e.name.lower(): e for e in EnumClass}dicts. Keeps MCP interface string-based while library uses typed enums. - Download dispatch: Per-type download methods (
download_audio,download_video, etc.) mapped via_DOWNLOAD_METHODSdict keyed by artifact type string. - Long-running ops: generate_* returns
{task_id, status}. Poll viaartifacts.poll_status(). Audio 10-20min, video 15-45min, deep research 15-30min. - Hatchling gotcha:
src/layout needs[tool.hatch.build.targets.wheel] packages = ["src"]in pyproject.toml.
Related
- enterprise-capability-expansion-5-pillars-from-digital-employee-analysis
gws-capability-expansion-nova(archived)- clawteam-openclaw-multi-agent-swarm-evaluation
claude-code-to-nova-enterprise-backup-v3-2026-03-25(archived)claude-code-to-nova-20260327-090715(archived)- notebooklm-cookie-auth-keepalive
- hostinger-dns-delete-schema-gap
- markit-sdk-hono-integration-patterns
- mcp-upgrade-api-version-hardcodes
- httpx-http2-extra-required-for-gold-stack-upgrades