Forked from PleasePrompto/notebooklm-mcp
Chat directly with NotebookLM for zero-hallucination answers based on your own notebooks
MCP Installation β’ HTTP REST API β’ Why NotebookLM β’ Examples β’ Documentation
Use NotebookLM from any tool via HTTP REST API:
Option A: Install from npm
# Install globally
npm install -g @roomi-fields/notebooklm-mcp
# For MCP stdio mode (Claude Code, Cursor)
notebooklm-mcp
# For HTTP server mode
# Note: Currently requires cloning the repo for HTTP mode
# See Option B belowOption B: Install from source (Required for HTTP mode)
# Clone and install
git clone https://github.com/roomi-fields/notebooklm-mcp.git
cd notebooklm-mcp
npm install
npm run build
npm run start:httpQuery the API:
curl -X POST http://localhost:3000/ask \
-H "Content-Type: application/json" \
-d '{"question": "Explain X", "notebook_id": "my-notebook"}'Perfect for:
- β n8n workflows and automation
- β Zapier, Make.com integrations
- β Custom web applications
- β Backend APIs
π Full HTTP setup guide: deployment/docs/01-INSTALL.md
Use NotebookLM directly from your AI coding assistant:
# Claude Code
claude mcp add notebooklm npx @roomi-fields/notebooklm-mcp@latest
# Codex
codex mcp add notebooklm -- npx @roomi-fields/notebooklm-mcp@latest
# Cursor (add to ~/.cursor/mcp.json)
{
"mcpServers": {
"notebooklm": {
"command": "npx",
"args": ["-y", "@roomi-fields/notebooklm-mcp@latest"]
}
}
}Perfect for:
- β Claude Code, Cursor, Codex
- β Any MCP-compatible AI assistant
- β Direct CLI integration
When you tell Claude Code or Cursor to "search through my local documentation", here's what happens:
- Massive token consumption: Searching through documentation means reading multiple files repeatedly
- Inaccurate retrieval: Searches for keywords, misses context and connections between docs
- Hallucinations: When it can't find something, it invents plausible-sounding APIs
- Expensive & slow: Each question requires re-reading multiple files
Let your tools chat directly with NotebookLM β Google's zero-hallucination knowledge base powered by Gemini 2.5 that provides intelligent, synthesized answers from your docs.
Your Task β Agent/n8n asks NotebookLM β Gemini synthesizes answer β Correct output
The real advantage: No more manual copy-paste. Your agent/workflow asks NotebookLM directly and gets answers back. Build deep understanding through automatic follow-ups.
| Approach | Token Cost | Setup Time | Hallucinations | Answer Quality |
|---|---|---|---|---|
| Feed docs to Claude | π΄ Very high (multiple file reads) | Instant | Yes - fills gaps | Variable retrieval |
| Web search | π‘ Medium | Instant | High - unreliable sources | Hit or miss |
| Local RAG | π‘ Medium-High | Hours (embeddings, chunking) | Medium - retrieval gaps | Depends on setup |
| NotebookLM MCP | π’ Minimal | 5 minutes | Zero - refuses if unknown | Expert synthesis |
- Pre-processed by Gemini: Upload docs once, get instant expert knowledge
- Natural language Q&A: Not just retrieval β actual understanding and synthesis
- Multi-source correlation: Connects information across 50+ documents
- Citation-backed: Every answer includes source references
- No infrastructure: No vector DBs, embeddings, or chunking strategies needed
# 1. Clone and install
git clone <repo-url> D:\notebooklm-http
cd D:\notebooklm-http
npm install
npm run build
# 2. Configure authentication (one-time)
npm run setup-auth
# Chrome opens β log in with Google β close Chrome
# 3. Start the server
# Option A: Foreground mode (terminal stays open)
npm run start:http
# Option B: Background daemon mode (recommended for production)
npm run daemon:start # Start in background
npm run daemon:logs # View logs
npm run daemon:status # Check status
npm run daemon:stop # Stop server
# 4. Add your first notebook (in another terminal if using Option A)
curl -X POST http://localhost:3000/notebooks \
-H "Content-Type: application/json" \
-d '{
"url": "https://notebooklm.google.com/notebook/YOUR-NOTEBOOK-ID",
"name": "My Knowledge Base",
"description": "My documentation",
"topics": ["docs", "api"]
}'
# 5. Query NotebookLM
curl -X POST http://localhost:3000/ask \
-H "Content-Type: application/json" \
-d '{"question": "Explain X"}'
# 6. Validate installation (optional)
.\deployment\scripts\test-server.ps1π See Testing Guide for automated test suite
| Method | Endpoint | Description |
|---|---|---|
GET |
/health |
Check server health |
POST |
/ask |
Ask a question to NotebookLM |
GET |
/notebooks |
List all notebooks |
POST |
/notebooks |
Add notebook (with live validation) |
POST |
/notebooks/auto-discover |
Auto-generate notebook metadata |
DELETE |
/notebooks/:id |
Remove a notebook |
PUT |
/notebooks/:id/activate |
Set active notebook |
GET |
/sessions |
List active sessions |
DELETE |
/sessions/:id |
Close a session |
π Full API documentation: deployment/docs/03-API.md
Perfect for n8n workflows:
{
"nodes": [
{
"name": "Ask NotebookLM",
"type": "n8n-nodes-base.httpRequest",
"parameters": {
"method": "POST",
"url": "http://your-server:3000/ask",
"jsonParameters": true,
"bodyParametersJson": {
"question": "{{ $json.query }}",
"notebook_id": "my-notebook"
}
}
}
]
}π n8n guide: deployment/docs/04-N8N-INTEGRATION.md
Autonomous resource discovery enables AI orchestrators to find and use relevant documentation without manual intervention.
1. Add notebook (zero manual metadata):
curl -X POST http://localhost:3000/notebooks/auto-discover \
-H "Content-Type: application/json" \
-d '{"url": "https://notebooklm.google.com/notebook/YOUR_ID"}'2. System queries NotebookLM to auto-generate:
- Kebab-case name (3 words max)
- Concise description (2 sentences)
- Relevant tags (8-10 keywords)
3. Orchestrators discover autonomously:
- Claude Code finds relevant docs without prompting
- n8n workflows auto-select documentation
- Cursor matches context to notebooks
Inspired by Claude Skills best practices:
- Level 0 (startup): Lightweight metadata loaded (~500 tokens)
- Level 1 (matching): Local tag/description search (0 NotebookLM queries)
- Level 2 (deep query): Targeted NotebookLM query only when needed
Before: Manual library management, orchestrators can't discover resources autonomously
After: Self-organizing library, autonomous documentation discovery
Perfect for:
- β Teams with 10+ documentation notebooks
- β n8n workflows needing dynamic doc access
- β Claude Code autonomous research
- β Onboarding new developers without manual setup
# 1. Add documentation notebooks (auto-discover metadata)
curl -X POST /notebooks/auto-discover -d '{"url": "https://notebooklm.google.com/notebook/n8n-docs"}'
curl -X POST /notebooks/auto-discover -d '{"url": "https://notebooklm.google.com/notebook/react-guide"}'
# 2. Claude Code autonomously discovers relevant notebook
User: "Build Gmail automation with n8n"
β System matches: "n8n-docs" (tags: ["n8n", "gmail", "automation"])
β Query NotebookLM: "Gmail node configuration?"
β Claude implements with accurate info
# 3. Zero hallucinations, zero manual interventionRun the HTTP server as a background process without keeping a terminal window open:
# Start server in background
npm run daemon:start
# View real-time logs
npm run daemon:logs
# Check server status
npm run daemon:status
# Restart server
npm run daemon:restart
# Stop server
npm run daemon:stop
# Remove from PM2 process list
npm run daemon:deleteFeatures:
- β Runs in background without terminal window
- β Auto-restart on crash
- β Centralized log management (logs/pm2-*.log)
- β Memory limit protection (1GB max)
- β Production-ready process management
Configuration: Edit ecosystem.config.cjs to customize PM2 behavior (env vars, restart policy, etc.)
- π Installation Guide β Step-by-step setup
- π§ Configuration β Environment variables, security
- π‘ API Reference β Complete endpoint documentation
- π Notebook Library β Multi-notebook management
- β Testing Suite β Automated validation scripts
- π Troubleshooting β Common issues
Claude Code
claude mcp add notebooklm npx @roomi-fields/notebooklm-mcp@latestCodex
codex mcp add notebooklm -- npx @roomi-fields/notebooklm-mcp@latestGemini
gemini mcp add notebooklm npx @roomi-fields/notebooklm-mcp@latestCursor
Add to ~/.cursor/mcp.json:
{
"mcpServers": {
"notebooklm": {
"command": "npx",
"args": ["-y", "@roomi-fields/notebooklm-mcp@latest"]
}
}
}amp
amp mcp add notebooklm -- npx @roomi-fields/notebooklm-mcp@latestVS Code
code --add-mcp '{"name":"notebooklm","command":"npx","args":["@roomi-fields/notebooklm-mcp@latest"]}'Other MCP clients
Generic MCP config:
{
"mcpServers": {
"notebooklm": {
"command": "npx",
"args": ["@roomi-fields/notebooklm-mcp@latest"]
}
}
}-
Install the MCP server (see above)
-
Authenticate (one-time)
Say in your chat (Claude/Codex):
"Log me in to NotebookLM"
A Chrome window opens β log in with Google
- Create your knowledge base
Go to notebooklm.google.com β Create notebook β Upload your docs:
- π PDFs, Google Docs, markdown files
- π Websites, GitHub repos
- π₯ YouTube videos
- π Multiple sources per notebook
Share: βοΈ Share β Anyone with link β Copy
- Let Claude use it
"I'm building with [library]. Here's my NotebookLM: [link]"
That's it. Claude now asks NotebookLM whatever it needs, building expertise before writing code.
The original author PleasePrompto also created a Python-based Claude Code Skill as an alternative approach:
π NotebookLM Claude Code Skill - Python skill for Claude Code
| Feature | This Project (MCP + HTTP) | Original Skill (Python) |
|---|---|---|
| Protocol | MCP (Model Context Protocol) | Claude Skills |
| Installation | claude mcp add notebooklm npx @roomi-fields/notebooklm-mcp |
Clone to ~/.claude/skills/ |
| Sessions | β Persistent browser sessions | Fresh browser per query |
| Compatibility | β Claude Code, Cursor, Codex, any MCP client | Claude Code only |
| HTTP API | β Works with n8n, Zapier, Make.com | β Not available |
| Language | TypeScript | Python |
| Use case | Long conversations, automation workflows | Quick one-off queries |
-
Use this MCP project if you want:
- Persistent sessions (faster repeated queries)
- Compatibility with multiple tools (Cursor, Codex, etc.)
- HTTP REST API for n8n/Zapier automation
- TypeScript-based development
-
Use the original Skill if you prefer:
- Python-based workflow
- Simpler clone-and-use installation
- Stateless queries (no session management)
- Only using Claude Code locally
Both use the same Patchright browser automation technology and provide zero-hallucination answers from NotebookLM.
Challenge: n8n's API is new β Claude hallucinates node names and functions.
Solution:
- Downloaded complete n8n documentation β merged into manageable chunks
- Uploaded to NotebookLM
- Told Claude: "Build me a Gmail spam filter workflow. Use this NotebookLM: [link]"
Watch the AI-to-AI conversation:
Claude β "How does Gmail integration work in n8n?"
NotebookLM β "Use Gmail Trigger with polling, or Gmail node with Get Many..."
Claude β "How to decode base64 email body?"
NotebookLM β "Body is base64url encoded in payload.parts, use Function node..."
Claude β "How to parse OpenAI response as JSON?"
NotebookLM β "Set responseFormat to json, use {{ $json.spam }} in IF node..."
Claude β "What about error handling if the API fails?"
NotebookLM β "Use Error Trigger node with Continue On Fail enabled..."
Claude β β
"Here's your complete workflow JSON..."
Result: Perfect workflow on first try. No debugging hallucinated APIs.
NotebookLM refuses to answer if information isn't in your docs. No invented APIs.
Manage multiple NotebookLM notebooks with automatic validation, duplicate detection, and smart selection.
Claude asks follow-up questions automatically, building complete understanding before coding.
- Claude automatically asks follow-up questions to build complete understanding
- Each answer triggers deeper questions until Claude has all the details
- Example: For n8n workflow, Claude asked multiple sequential questions about Gmail integration, error handling, and data transformation
Use NotebookLM from n8n, Zapier, Make.com, or any HTTP client. No MCP required.
Set up once, use everywhere. Claude Code, Codex, Cursor, n8n β all can access the same library.
graph LR
A[Your Task] --> B[Claude/n8n/HTTP Client]
B --> C[MCP/HTTP Server]
C --> D[Chrome Automation]
D --> E[NotebookLM]
E --> F[Gemini 2.5]
F --> G[Your Docs]
G --> F
F --> E
E --> D
D --> C
C --> B
B --> H[Accurate Output]
| Intent | Say | Result |
|---|---|---|
| Authenticate | "Open NotebookLM auth setup" or "Log me in to NotebookLM" | Chrome opens for login |
| Add notebook | "Add [link] to library" | Saves notebook with metadata |
| List notebooks | "Show our notebooks" | Lists all saved notebooks |
| Research first | "Research this in NotebookLM before coding" | Multi-question session |
| Select notebook | "Use the React notebook" | Sets active notebook |
| Update notebook | "Update notebook tags" | Modify metadata |
| Remove notebook | "Remove [notebook] from library" | Deletes from library |
| View browser | "Show me the browser" | Watch live NotebookLM chat |
| Fix auth | "Repair NotebookLM authentication" | Clears and re-authenticates |
| Switch account | "Re-authenticate with different Google account" | Changes account |
| Clean restart | "Run NotebookLM cleanup" | Removes all data for fresh start |
- You: Download docs β Claude: "search through these files"
- Problem: Claude reads thousands of files β massive token usage, often misses connections
- NotebookLM: Pre-indexed by Gemini, semantic understanding across all docs
- You: "Research X online"
- Problem: Outdated info, hallucinated examples, unreliable sources
- NotebookLM: Only your trusted docs, always current, with citations
- You: Set up embeddings, vector DB, chunking strategy, retrieval pipeline
- Problem: Hours of setup, tuning retrieval, still gets "creative" with gaps
- NotebookLM: Upload docs β done. Google handles everything.
Is it really zero hallucinations? Yes. NotebookLM is specifically designed to only answer from uploaded sources. If it doesn't know, it says so.
What about rate limits? Free tier has daily query limits per Google account. Quick account switching supported for continued research.
How secure is this? Chrome runs locally. Your credentials never leave your machine. Use a dedicated Google account if concerned.
Can I see what's happening?
Yes! Say "Show me the browser" (MCP mode) or set HEADLESS=false (HTTP mode) to watch the live NotebookLM conversation.
What makes this better than Claude's built-in knowledge? Your docs are always current. No training cutoff. No hallucinations. Perfect for new libraries, internal APIs, or fast-moving projects.
Without NotebookLM: Write code β Find it's wrong β Debug hallucinated APIs β Repeat
With NotebookLM: Research first β Write correct code β Ship faster
Stop debugging hallucinations. Start shipping accurate code.
This tool automates browser interactions with NotebookLM to make your workflow more efficient. However, a few friendly reminders:
About browser automation: While I've built in humanization features (realistic typing speeds, natural delays, mouse movements) to make the automation behave more naturally, I can't guarantee Google won't detect or flag automated usage. I recommend using a dedicated Google account for automation rather than your primary accountβthink of it like web scraping: probably fine, but better safe than sorry!
About CLI tools and AI agents: CLI tools like Claude Code, Codex, and similar AI-powered assistants are incredibly powerful, but they can make mistakes. Please use them with care and awareness:
- Always review changes before committing or deploying
- Test in safe environments first
- Keep backups of important work
- Remember: AI agents are assistants, not infallible oracles
I built this tool for myself because I was tired of the copy-paste dance between NotebookLM and my editor. I'm sharing it in the hope it helps others too, but I can't take responsibility for any issues, data loss, or account problems that might occur. Use at your own discretion and judgment.
That said, if you run into problems or have questions, feel free to open an issue on GitHub. I'm happy to help troubleshoot!
π€ Auto-Discovery: Autonomous Resource Discovery
- β Automatically generate notebook name, description, and tags via NotebookLM
- β Progressive disclosure pattern inspired by Claude Skills best practices
- β Zero-friction notebook addition (30 seconds vs 5 minutes)
- β Validation of auto-generated metadata (kebab-case, description length, tags count)
- β Orchestrators discover relevant documentation autonomously
π See Auto-Discovery Documentation for details
Smart Metadata Refresh:
- Auto-detect when notebook content has changed
- Re-query NotebookLM to update metadata
- Endpoint:
PATCH /notebooks/:id/refresh
Semantic Matching:
- Use embeddings for advanced notebook matching beyond tags
- Endpoint:
GET /notebooks/match?query=gmail&semantic=true
Usage Analytics:
- Track which notebooks are queried together
- Suggest related notebooks based on usage patterns
- Endpoint:
GET /notebooks/:id/related
β PM2 Daemon Mode (v1.1.2):
- Cross-platform process manager with auto-restart
- Commands:
npm run daemon:start,daemon:logs,daemon:status - Built-in log rotation and monitoring
β Multi-Notebook Library (v1.1.2):
- Live validation of notebooks
- Duplicate detection
- Smart notebook selection
Open a discussion to suggest new features!
Found a bug? Have a feature idea? Open an issue or submit a PR!
See CONTRIBUTING.md for contribution guidelines.
MIT β Use freely in your projects.
See LICENSE for details.
Built with frustration about hallucinated APIs, powered by Google's NotebookLM
β Star on GitHub if this saves you debugging time!