notebooklm-py-diet-mcp

notebooklm-py-diet-mcp

Connects AI coding agents to Google NotebookLM, enabling querying notebooks, adding sources, and generating artifacts like reports, podcasts, and slide decks.

Category
Visit Server

README

notebooklm-py-diet-mcp

The Context Bridge -- Connecting AI coding agents to Google NotebookLM

Connect your AI agent to Google NotebookLM. Query your notebooks, add sources, generate reports, podcasts, slide decks, and more -- directly from Cursor, Claude Code, or any MCP-compatible client.

Workflow-orientated MCP toolset for IDE level interaction with NotebookLM. Designed as a smart and lightweight MCP server to enable AI code assist-native multi-step workflows (research, generate artifacts, download and convert). Packaged as single tool calls so the agent gets more done with less messing aroung and without losing capability.

Built on notebooklm-py by Teng Lin.

Unofficial -- Uses undocumented Google APIs via notebooklm-py. Not affiliated with Google. APIs may change without notice.

Python 3.10+ Licence: MIT

Need granular control over every SDK method? See the full-fat notebooklm-py-MCP (72 individual tools exposed - designed primarily for testing).

Beyond the SDK

This server is not just a thin wrapper. It adds capabilities that the underlying API does not provide:

  • Templated slide generation -- Three bundled design templates (Corporate, Educational, Creative) in templates/slide_styles.md. Pass any template as the instructions parameter to generate_and_download and NotebookLM will follow the specified tone, colour palette, typography, and layout rules. Create your own templates using the same structure.
  • PDF / PNG round-trip editing -- pdf_to_png splits a downloaded slide deck (or any PDF) into individual page images that an LLM can review, critique, or annotate. png_to_pdf reassembles edited pages back into a single document. This enables a generate-review-refine loop that is not possible through the NotebookLM interface alone.
  • Inline persona control -- ask_question accepts optional persona and response_length parameters, configuring the chat persona in the same call rather than requiring a separate configuration step.

AI Workflow Tools (14)

Tool Description
list_notebooks_tool List all notebooks with IDs and titles
create_notebook Create a new notebook
list_sources List all sources in a notebook
add_sources Add multiple sources (URL, text, file) in a single call
ask_question Query a notebook with optional persona, source filtering, and threading
generate_and_download Generate and download an artifact in one step (report, audio, slide deck, quiz, infographic)
list_artifacts List artifacts in a notebook
export_artifact Export an artifact to a file
research_and_import Research a topic and import results as sources automatically
get_account_info Show the active account and available profiles
switch_account Switch to a different Google account profile
create_profile Create a new account profile and launch browser sign-in
pdf_to_png Convert a PDF to individual PNG images (one per page)
png_to_pdf Combine PNG images into a single PDF document

MCP Resources

URI Description
notebooklm://notebooks List all notebooks (read-only)
notebooklm://notebook/{id} Notebook details including sources

MCP Prompts

Prompt Description
analyze_notebook_sources Template for analysing notebook sources by theme
research_topic_workflow Guided research workflow using NotebookLM tools
generate_styled_slides Generate a slide deck using a bundled design template (corporate, educational, creative)

Prerequisites

  • Python 3.10 or later
  • A Google account with access to NotebookLM
  • Cursor or another MCP-compatible client

Installation

1. Clone the repository

git clone https://github.com/earlyprototype/notebooklm-py-diet-mcp.git
cd notebooklm-py-diet-mcp

2. Create a virtual environment and install dependencies

python -m venv venv

# Windows (PowerShell)
.\venv\Scripts\Activate.ps1

# macOS / Linux
source venv/bin/activate

pip install -e ".[dev]"

Alternatively, install from requirements.txt:

pip install -r requirements.txt

3. Install Playwright (required for first-time login and auto-reauthentication)

playwright install chromium

4. Authenticate with Google NotebookLM

# Set the account profile directory
# Windows (PowerShell)
$env:NOTEBOOKLM_HOME = "$HOME\.notebooklm-work"

# macOS / Linux
export NOTEBOOKLM_HOME=~/.notebooklm-work

# Login (opens a browser window -- select your Google account)
notebooklm login

# Verify
notebooklm list

Configuration

Cursor

Add the following to your .cursor/mcp.json file:

{
  "mcpServers": {
    "notebooklm": {
      "command": "<path-to-venv>/python",
      "args": [
        "<path-to-repo>/notebooklm_mcp_server.py"
      ]
    }
  }
}

Replace the placeholder paths with your actual paths. The server manages account profiles internally -- no NOTEBOOKLM_HOME environment variable is needed. Use switch_account and get_account_info to manage profiles at runtime.

Restart Cursor after saving the configuration.

Claude Code

claude mcp add notebooklm -- python /path/to/notebooklm_mcp_server.py

HTTP Transport (for MCP Inspector or remote access)

python notebooklm_mcp_server.py --http

Then connect your client to http://localhost:8000/mcp.

Multiple Google Accounts

Each Google account is stored in a separate directory. Set NOTEBOOKLM_HOME to switch between them:

# Authenticate different accounts
NOTEBOOKLM_HOME=~/.notebooklm-work notebooklm login      # Work account
NOTEBOOKLM_HOME=~/.notebooklm notebooklm login            # Personal account
NOTEBOOKLM_HOME=~/.notebooklm-design notebooklm login     # Another account

The get_account_info tool shows the currently active profile and available alternatives. Use switch_account to change at runtime without restarting.

Usage Examples

Once configured, you can interact with NotebookLM directly from your AI agent:

List notebooks:

"List my NotebookLM notebooks"

Query a knowledge base:

"Ask the Strategy notebook: what are our key objectives for 2026?"

Set a persona and ask:

"As a strategy analyst, summarise the key risks in my Research notebook"

Add multiple sources at once:

"Add these URLs to my Research notebook: https://example.com/article1, https://example.com/article2"

Generate and download content:

"Generate a podcast overview for the Project notebook and save it" "Generate a report from the Strategy notebook and download it as PDF" "Create an infographic from the Training notebook"

Research and import:

"Research 'digital fabrication trends' and import the top results into my Research notebook"

Generate a styled slide deck:

"Generate a slide deck for the Strategy notebook using the Corporate template"

Slide Template Demos

The three bundled templates produce distinctly different output from the same workflow. Each example below was generated from a subsection of an innovation literacy training programme.

Corporate

Strategy consulting style -- serif headings, blue accent, data-dense layouts with charts, tables, and evidence callouts.

<p> <img src="docs/demos/selected/corporate_1.png" width="32%" alt="Corporate slide: historical analogy mapping" /> <img src="docs/demos/selected/corporate_2.png" width="32%" alt="Corporate slide: diagnostic table" /> <img src="docs/demos/selected/corporate_3.png" width="32%" alt="Corporate slide: recommendation table" /> </p>

Educational

Workshop and training style -- warm cream background, teal/amber accents, illustrated concepts, generous whitespace.

<p> <img src="docs/demos/selected/educational_1.png" width="32%" alt="Educational slide: operational vs design thinking comparison" /> <img src="docs/demos/selected/educational_2.png" width="32%" alt="Educational slide: four-point capture cycle" /> <img src="docs/demos/selected/educational_3.png" width="32%" alt="Educational slide: disproven hypothesis principle" /> </p>

Creative

Pitch deck style -- dark backgrounds, lime accent, bold typography, minimal text, visually striking layouts.

<p> <img src="docs/demos/selected/creative_1.png" width="32%" alt="Creative slide: hero statement on dark background" /> <img src="docs/demos/selected/creative_2.png" width="32%" alt="Creative slide: facilitation gap with split contrast" /> <img src="docs/demos/selected/creative_3.png" width="32%" alt="Creative slide: 2x2 grid with icons" /> </p>

See templates/slide_styles.md for the full template definitions or create your own following the same structure.

Project Structure

notebooklm-py-diet-mcp/
  notebooklm_mcp_server.py   # MCP server (14 tools, resources, prompts)
  pyproject.toml              # Python packaging and tool configuration
  requirements.txt            # Convenience dependency file
  INSTRUCTIONS.md             # Context injected into the LLM when loaded
  LICENSE                     # MIT licence
  README.md                   # This file
  tests/
    conftest.py               # Shared test fixtures and mocks
    test_helpers.py            # Unit tests for helper functions
    test_tools.py              # Mock-based tool tests
    test_lifespan.py           # Server startup scenario tests
  templates/
    slide_styles.md           # Bundled slide design templates
  docs/
    setup.md                  # Detailed setup guide
    demos/selected/           # Curated slide demo images (README gallery)
      demos/corporate/          # Full corporate template example set
      demos/educational/        # Full educational template example set
      demos/creative/           # Full creative template example set

Development

Running tests

pip install -e ".[dev]"
pytest

Linting

ruff check .
ruff format .

INSTRUCTIONS.md

The INSTRUCTIONS.md file is loaded by MCP clients alongside the server and provides the LLM with usage context -- workflow patterns, error handling guidance, and tool conventions. Place it next to notebooklm_mcp_server.py or in the MCP server metadata directory used by your client.

Acknowledgements

This project would not exist without notebooklm-py by Teng Lin and contributors. It provides the complete Python API for Google NotebookLM that this MCP server wraps.

The MCP server is built using the Model Context Protocol Python SDK by Anthropic.

Licence

MIT -- see LICENSE for details.

Disclaimer

This is an unofficial project. It is not affiliated with, endorsed by, or supported by Google. It relies on undocumented APIs that may change at any time. Use at your own risk. See the notebooklm-py security policy for credential handling guidance.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured