# Installation Guide - NotebookLM MCP HTTP Server
> Complete installation from scratch on Windows 10/11
---
## π Table of Contents
1. [Prerequisites](#-prerequisites)
2. [Node.js Installation](#-nodejs-installation)
3. [Project Cloning](#-project-cloning)
4. [Dependencies Installation](#-dependencies-installation)
5. [Compilation](#-compilation)
6. [Authentication Configuration](#-authentication-configuration)
7. [Notebooks Configuration](#-notebooks-configuration)
8. [Verification](#-verification)
9. [Startup](#-startup)
---
## π Prerequisites
Before starting, you need:
### Hardware
- **RAM:** 2 GB minimum (4 GB recommended)
- **Disk:** 500 MB free space
- **Network:** Stable Internet connection
### Software
- **Windows 10/11** (64-bit)
- **PowerShell 5.1+** (included in Windows)
- **Browser:** Chrome installed (Playwright will use it)
### Accounts
- **Google Account** with access to https://notebooklm.google.com
- At least **1 NotebookLM notebook** already created
---
## π₯ Node.js Installation
### Check if Node.js is already installed
```powershell
node --version
npm --version
```
If you see version numbers (e.g., `v20.9.0` and `10.1.0`), Node.js is installed. β
If not, continue below. β¬οΈ
### Download Node.js
1. Go to https://nodejs.org/
2. Download the **LTS** (Long Term Support) version for Windows
3. Run the `.msi` installer
4. Follow the installation wizard:
- β
Accept the license
- β
Standard installation (default path: `C:\Program Files\nodejs\`)
- β
Check "Automatically install the necessary tools" if offered
5. Restart PowerShell and verify:
```powershell
node --version # Should display: v20.x.x or higher
npm --version # Should display: 10.x.x or higher
```
---
## π Project Cloning
### Method 1: With Git
```powershell
# Install Git if not already done: https://git-scm.com/download/win
# Clone the repository
cd D:\
git clone https://github.com/PleasePrompto/notebooklm-mcp.git notebooklm-http
cd notebooklm-http
```
### Method 2: ZIP Download
1. Download the ZIP from GitHub
2. Extract to `D:\notebooklm-http\`
3. Open PowerShell in this folder
---
## π¦ Dependencies Installation
```powershell
# Make sure you're in the right directory
cd D:\notebooklm-http
# Install all npm dependencies
npm install
```
**What gets installed:**
- `express` - HTTP server
- `patchright` - Stealth Playwright to automate Chrome
- `@anthropic-ai/sdk` - MCP SDK
- And ~50 other necessary packages
**Duration:** 2-5 minutes depending on your Internet connection
**Expected result:**
```
added 150 packages in 3m
```
---
## π¨ Compilation
The project is written in TypeScript and must be compiled to JavaScript:
```powershell
npm run build
```
**Expected result:**
```
> notebooklm-mcp@1.1.2 build
> tsc
> notebooklm-mcp@1.1.2 postbuild
> chmod +x dist/index.js
β Compilation successful
```
**Verification:**
```powershell
ls dist\http-wrapper.js
```
If the file exists, compilation is OK! β
---
## π Authentication Configuration
**IMPORTANT:** This step is done **ONLY ONCE**.
Authentication will be saved and valid for ~399 days.
### PowerShell Script (Recommended)
**Note:** The path depends on your current directory.
**If you're at the project root:**
```powershell
.\deployment\scripts\setup-auth.ps1
```
**If you're in the deployment folder:**
```powershell
.\scripts\setup-auth.ps1
```
**Or use npm (works everywhere):**
```powershell
npm run setup-auth
```
**What will happen:**
1. The script checks if authentication already exists
- If yes: asks for confirmation to reset
- If no: continues directly
2. Chrome opens (visible window)
3. **Actions to do in Chrome:**
- Sign in to your Google account
- Go to https://notebooklm.google.com
- Wait for the page to load completely
- You should see your notebooks
- **Close Chrome** (click the red X)
4. The script verifies that files are correctly created
**Expected result:**
```
β
Authentication configured successfully!
π‘ Google session valid for ~399 days
Files created:
β
state.json created (X KB)
β
Cookies created (XXX KB)
```
### π Authentication Files Location
**IMPORTANT:** Authentication files are NOT stored in the project directory, but in the Windows user directory:
**Full path:**
```
C:\Users\<YOUR_NAME>\AppData\Local\notebooklm-mcp\Data\
```
**File structure:**
```
C:\Users\<YOUR_NAME>\AppData\Local\notebooklm-mcp\Data\
βββ chrome_profile\ β Complete Chrome profile (Google cookies)
β βββ Default\
β βββ Cookies β Cookies file (must be >10KB)
β
βββ browser_state\
β βββ state.json β Authentication state (16 critical cookies)
β
βββ library.json β Library of configured notebooks
```
**To verify on your PC:**
```powershell
# Display the path
echo $env:LOCALAPPDATA\notebooklm-mcp\Data
# List files
dir $env:LOCALAPPDATA\notebooklm-mcp\Data
dir $env:LOCALAPPDATA\notebooklm-mcp\Data\chrome_profile\Default\Cookies
dir $env:LOCALAPPDATA\notebooklm-mcp\Data\browser_state\state.json
```
**Expected files:**
- `Cookies` - SQLite database (>10 KB) - **Contains your Google cookies**
- `state.json` - JSON file with 16 critical cookies - **Valid for 399 days**
- `library.json` - Library of your NotebookLM notebooks (created automatically)
---
## π Notebooks Configuration
Once authentication is configured, you must add at least one notebook to your library.
### Option 1: Via HTTP API (Recommended)
**Prerequisite:** Start the HTTP server first
```powershell
# In a first terminal
npm run start:http
```
**In a second PowerShell terminal:**
```powershell
# Prepare notebook data
$body = @{
url = "https://notebooklm.google.com/notebook/74912e55-34a4-4027-bdcc-8e89badd0efd"
name = "CNV"
description = "Communication NonViolente"
topics = @("communication", "empathie", "besoins")
} | ConvertTo-Json
# Add the notebook (automatic validation)
Invoke-RestMethod -Uri "http://localhost:3000/notebooks" `
-Method Post `
-Body $body `
-ContentType "application/json"
```
**β±οΈ Note:** Adding takes 15-30 seconds because the server validates that the notebook actually exists.
**Automatic validations:**
- β
NotebookLM URL format
- β
Notebook actually accessible (live check)
- β
No duplicate name
- β
Valid Google session
**How to get a notebook URL:**
1. Go to https://notebooklm.google.com
2. Open your notebook
3. Copy the URL from the address bar
Expected format: `https://notebooklm.google.com/notebook/[id]`
### Option 2: Manual Modification (Advanced)
Edit `library.json` directly:
```powershell
# Open the file
code "$env:LOCALAPPDATA\notebooklm-mcp\Data\library.json"
```
**β οΈ Warning:** This method bypasses automatic validations.
**Example structure:**
```json
{
"notebooks": [
{
"id": "cnv",
"url": "https://notebooklm.google.com/notebook/74912e55-34a4-4027-bdcc-8e89badd0efd",
"name": "CNV",
"description": "Communication NonViolente",
"topics": ["communication", "empathie", "besoins"],
"content_types": ["documentation", "examples"],
"use_cases": ["Learning about CNV"],
"added_at": "2025-11-22T08:49:16.735Z",
"last_used": "2025-11-22T08:49:16.735Z",
"use_count": 0,
"tags": []
}
],
"active_notebook_id": "cnv",
"last_modified": "2025-11-22T08:49:16.735Z",
"version": "1.0.0"
}
```
**Restart the server after manual modification.**
### Verify Configuration
```powershell
# List configured notebooks
Invoke-RestMethod -Uri "http://localhost:3000/notebooks"
```
**Expected result:**
```json
{
"success": true,
"data": {
"notebooks": [
{
"id": "cnv",
"name": "CNV",
"url": "https://notebooklm.google.com/notebook/xxx",
"active": true
}
],
"count": 1
}
}
```
**π For more details on notebook management, see [06-NOTEBOOK-LIBRARY.md](./06-NOTEBOOK-LIBRARY.md)**
---
### β οΈ AUTHENTICATION FILES SECURITY
- These files contain your **authenticated Google cookies**
- **NEVER** share these files
- **NEVER** commit them to Git (already protected by .gitignore)
- To reset auth: delete the `Data\` folder and run `npm run setup-auth` again
If all files are present and not empty, authentication is configured! β
---
## β
Verification
Before starting the server, let's verify that everything is OK:
### Complete Checklist
```powershell
# 1. Node.js installed
node --version
# β
Should display v20.x.x or higher
# 2. Dependencies installed
ls node_modules\express
# β
The folder must exist
# 3. Code compiled
ls dist\http-wrapper.js
# β
The file must exist
# 4. Authentication configured
ls Data\chrome_profile\Default\Cookies
ls Data\browser_state\state.json
# β
Both files must exist and not be empty
# 5. Port 3000 free
netstat -ano | findstr :3000
# β
No result = port free
# β A result = port occupied (see TROUBLESHOOTING.md)
```
If all checks are β
, you're ready! π
---
## βΆοΈ Startup
### Method 1: Foreground Mode (Development)
```powershell
npm run start:http
```
**Expected result:**
```
β
[14:30:15] π HTTP Wrapper listening on 0.0.0.0:3000
βΉοΈ [14:30:15] Health check: http://localhost:3000/health
βΉοΈ [14:30:15] Ask question: POST http://localhost:3000/ask
βΉοΈ [14:30:15] List notebooks: GET http://localhost:3000/notebooks
βΉοΈ [14:30:15] π API Documentation:
βΉοΈ [14:30:15] POST /ask - Ask a question to NotebookLM
βΉοΈ [14:30:15] GET /health - Check server health
βΉοΈ [14:30:15] GET /notebooks - List all notebooks
```
**The server is started!** π
β οΈ **Note:** The terminal must stay open. Press `Ctrl+C` to stop.
---
### Method 2: Background Daemon Mode (Production) β
**For production use, run the server in background without keeping the terminal open:**
```powershell
# Start server in background
npm run daemon:start
# Check status
npm run daemon:status
# View logs in real-time
npm run daemon:logs
# Stop server
npm run daemon:stop
```
**Expected result:**
```
[PM2] App [notebooklm-mcp] launched (1 instances)
ββββββ¬βββββββββββββββββ¬βββββββ¬ββββββββββ¬βββββββββ
β id β name β mode β status β uptime β
ββββββΌβββββββββββββββββΌβββββββΌββββββββββΌβββββββββ€
β 0 β notebooklm-mcp β fork β online β 0s β
ββββββ΄βββββββββββββββββ΄βββββββ΄ββββββββββ΄βββββββββ
```
**Advantages of daemon mode:**
- β
Runs in background (no terminal window)
- β
Auto-restart on crash
- β
Logs saved to `logs/pm2-*.log`
- β
Survives terminal close
**Daemon management commands:**
```powershell
npm run daemon:start # Start server
npm run daemon:stop # Stop server
npm run daemon:restart # Restart server
npm run daemon:logs # View logs (Ctrl+C to exit)
npm run daemon:status # Check status
npm run daemon:delete # Remove from PM2 list
```
### Health Test
Open a **new PowerShell terminal** and test:
```powershell
curl http://localhost:3000/health
```
**Expected response:**
```json
{
"success": true,
"data": {
"authenticated": true,
"sessions": 0,
"library_notebooks": 1,
"context_age_hours": 0.0
}
}
```
If `"authenticated": true`, everything works! β
### Complete Test with Question
```powershell
curl -X POST http://localhost:3000/ask `
-H "Content-Type: application/json" `
-d '{"question":"Liste 1 besoin en CNV","notebook_id":"cnv"}'
```
**Wait 30-60 seconds** (NotebookLM generation time).
**Expected response:**
```json
{
"success": true,
"data": {
"status": "success",
"question": "Liste 1 besoin en CNV",
"answer": "Votre requΓͺte concernant la liste des besoins...",
"session_id": "abc123",
"notebook_url": "https://notebooklm.google.com/notebook/...",
"session_info": {
"age_seconds": 35,
"message_count": 1
}
}
}
```
If you receive a JSON response with `"success": true` and an `"answer"`, **congratulations!** π
Your NotebookLM HTTP server is operational!
### Automated Tests (Recommended)
For complete validation, use the test scripts:
```powershell
# Quick test (30 seconds)
.\deployment\scripts\test-server.ps1
# Complete tests (5-10 minutes)
.\deployment\scripts\test-api.ps1
```
**Expected result:**
```
β
ALL TESTS PASSED!
Total tests: 10
Successful tests: 10
Failed tests: 0
Success rate: 100%
```
**π Complete test documentation:** [Test Scripts](../scripts/README.md)
---
## πͺ Stop the Server
In the terminal where the server is running, press:
```
Ctrl + C
```
The server stops gracefully with:
```
SIGINT received, shutting down gracefully...
```
---
## β‘οΈ Next Steps
β
Installation complete!
**Now you can:**
1. **[Advanced Configuration](./02-CONFIGURATION.md)** - Environment variables, firewall, security
2. **[API Documentation](./03-API.md)** - All available endpoints
3. **[n8n Integration](./04-N8N-INTEGRATION.md)** - Connect with n8n step-by-step
4. **[Troubleshooting](./05-TROUBLESHOOTING.md)** - Solutions to common problems
---
## π Problems?
If something doesn't work:
1. Consult **[05-TROUBLESHOOTING.md](./05-TROUBLESHOOTING.md)**
2. Check server logs
3. Test with `npm run setup-auth` again
4. Open a GitHub issue with the logs
---
**Congratulations! Your NotebookLM HTTP server is installed and operational! π**