Skip to content

amp-rh/notebooklm-agent-plugin

Repository files navigation

NotebookLM Agent Plugin

An MCP server and agent integration kit that lets AI coding assistants (Cursor, Claude Code) interact with Google NotebookLM.

What's included

Component Path Purpose
MCP server mcp-server/ Stdio MCP server exposing NotebookLM operations as tools
Cookie extractor scripts/extract_cookies.py Extracts session cookies from Firefox/Chrome for auth
Cursor hooks hooks/ Auto-refreshes auth before MCP calls
Cursor rule rules/ Instructs the agent to delegate NotebookLM work to subagents
Cursor skill skills/ Teaches the agent how to use the NotebookLM tools
Claude Code config CLAUDE.md Instructions for Claude Code agents

Quick start

1. Install

git clone https://github.com/amp-rh/notebooklm-agent-plugin.git
cd notebooklm-agent-plugin
./install.sh

This installs the notebooklm-mcp command via pip (editable mode).

2. Authenticate

Log into NotebookLM in Firefox or Chrome, then extract cookies:

python3 scripts/extract_cookies.py \
    --domains .google.com notebooklm.google.com \
    --required SID OSID __Secure-OSID \
    --host-filter '%notebooklm%' \
    --output ~/.notebooklm/storage_state.json

3. Configure your agent

Cursor

Add the MCP server to your project's .cursor/mcp.json:

{
  "mcpServers": {
    "notebooklm": {
      "command": "notebooklm-mcp",
      "args": []
    }
  }
}

Optional enhancements (recommended for best experience):

  • Hooks — Merge hooks/hooks.json entries into ~/.cursor/hooks.json, updating paths to point to this repo's hooks/ directory. The auth hook auto-refreshes cookies before every NotebookLM MCP call.

  • Rule — Copy rules/notebooklm-subagent.mdc to your project's .cursor/rules/ to teach the agent the subagent delegation pattern.

  • Skill — Register skills/notebooklm/SKILL.md in your Cursor skills configuration.

Claude Code

Add the MCP server to your .mcp.json:

{
  "mcpServers": {
    "notebooklm": {
      "command": "notebooklm-mcp",
      "args": []
    }
  }
}

Claude Code will automatically discover tools from the CLAUDE.md file in this repo.

Available tools

Tool Description
notebooklm_auth_status Check if credentials exist (local, no network)
notebooklm_list_notebooks List all notebooks
notebooklm_get_notebook Get notebook details by ID
notebooklm_create_notebook Create a new notebook
notebooklm_rename_notebook Rename a notebook
notebooklm_delete_notebook Delete a notebook
notebooklm_chat Send a message and get an AI response
notebooklm_get_chat_history Get conversation history
notebooklm_get_notebook_description Get AI-generated summary and topics
notebooklm_open_notebook Open a notebook in the default browser

Authentication details

NotebookLM has no public API — it uses Google session cookies for authentication. The included extract_cookies.py script reads cookies directly from your browser's cookie database:

  • Firefox (preferred): Reads cookies.sqlite directly (unencrypted on Linux)
  • Chrome: Uses rookiepy to decrypt cookies

The Cursor auth hook (hooks/notebooklm-auth.sh) runs this extraction automatically before every NotebookLM MCP call, so credentials stay fresh as long as your browser session is active.

Docker

Build and run the MCP server in a container:

cd mcp-server
docker build -t notebooklm-mcp .

Mount your credentials when running:

docker run -i --rm -v ~/.notebooklm:/root/.notebooklm notebooklm-mcp

Requirements

  • Python 3.11+
  • Linux (cookie extraction reads browser databases directly)
  • Firefox or Chrome with an active NotebookLM session
  • jq (for hook scripts)

Dependencies

  • notebooklm-py — Python client for NotebookLM
  • mcp — Model Context Protocol SDK
  • httpx — HTTP client

License

Apache License 2.0

About

MCP server + agent integration kit for Google NotebookLM — works with Cursor and Claude Code.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages