GitHub - jacob-bd/notebooklm-mcp-cli
Key Points
- 1This project offers a unified package providing programmatic access to Google NotebookLM through both a Command-Line Interface (CLI) and a Model Context Protocol (MCP) server.
- 2It enables users to perform a wide range of actions, including creating and managing notebooks, adding diverse sources, querying content with AI, generating various media (audio, video), and sharing, either via terminal commands or by connecting AI assistants.
- 3The tool operates by extracting cookies from a browser for authentication, utilizing undocumented internal APIs to bridge NotebookLM's capabilities with external scripting and AI models.
The jacob-bd/notebooklm-mcp-cli project provides programmatic access to Google NotebookLM through a unified command-line interface (CLI) and a Model Context Protocol (MCP) server. This single Python package, installed via uv, pip, or pipx, serves two primary purposes: nlm for direct terminal scripting and automation, and notebooklm-mcp for integrating NotebookLM capabilities with AI assistants like Claude, Gemini, and Cursor.
The core methodology of this project relies on interacting with NotebookLM's undocumented internal APIs. This means the system simulates user actions within the NotebookLM web interface rather than using a public, stable API. To achieve this, the project implements a sophisticated authentication mechanism that requires extracting session cookies from a user's browser. The nlm login or notebooklm-mcp-auth utility facilitates this, primarily through an "auto mode" that launches a dedicated headless Chrome instance. Users log into their Google account within this browser, and the necessary authentication tokens and cookies are automatically extracted and stored. The system supports multiple named profiles, each maintaining an isolated Chrome session for simultaneous access to different Google accounts. The project includes robust authentication lifecycle management, automatically refreshing CSRF tokens (valid for minutes) on demand, re-extracting session IDs at MCP server startup, and attempting to auto-refresh longer-lived cookies (2-4 weeks) via the saved headless Chrome profile. An explicit refresh_auth() function is also available.
The project exposes a comprehensive set of 31 NotebookLM functionalities as distinct MCP tools, allowing AI agents to perform complex operations via natural language commands. These tools cover:
- Notebook Management:
notebook_list,notebook_create,notebook_share(public/invite). - Source Management:
source_add(supporting URLs, text, Google Drive files, local files),source_sync_drive, and source deletion. - AI Interaction:
notebook_queryfor AI chat within a notebook, andresearch_startfor web/Drive-based research. - Content Generation (Studio):
studio_createfor generating artifacts like audio podcasts, video explainers, briefing documents, flashcards, infographics, mind maps, and slide decks. - Artifact Download:
download_artifactfor retrieving generated content.
AI agents, such as Claude Code or Gemini CLI, integrate with the notebooklm-mcp server by configuring it as an MCP endpoint. When a user issues a natural language request (e.g., "Create a notebook about quantum computing and generate a podcast"), the AI assistant's reasoning engine translates this into a sequence of calls to the exposed MCP tools (e.g., notebook_create, followed by studio_create for an audio overview). The project explicitly warns about the large number of tools potentially impacting AI model context windows, recommending disabling the MCP when not in active use.
Installation is streamlined, bundling both CLI and MCP server into one package. The documentation also provides detailed troubleshooting for common issues like uv upgrade problems and Chrome DevTools MCP connectivity, often stemming from npx caching issues resolved by using pnpm. Acknowledging its "vibe coding" origin by a non-developer using AI assistants, the project emphasizes its open-source nature and welcomes contributions for refactoring, error handling, and architectural improvements.