01
ทำอะไรได้
ถาม-ตอบจาก Notebook
Agent ถามคำถามเข้า NotebookLM ได้โดยตรง รับคำตอบพร้อม citation จาก Gemini 2.5
เพิ่ม Source
ใส่ URL หรือ text เข้า Notebook ผ่าน tool call ได้เลย ไม่ต้องเปิดเบราว์เซอร์
Audio Overview
สั่ง generate และ download Audio Overview (podcast-style summary) จาก notebook
Library จัดการ Notebook
บันทึก จัดหมวด ค้นหา และ switch ระหว่าง notebook ได้ใน local library
Auth แบบ Persistent
Login Google ครั้งเดียว cookies ถูก save ใน Chrome profile ใช้ได้ทุกครั้งหลังนั้น
Multi-client Support
รองรับ stdio และ HTTP transport — ใช้ได้กับ Claude Code, Cursor, n8n, Zapier
How it works: Server นี้ขับ Chrome จริง (ผ่าน Patchright stealth mode) เปิด notebooklm.google.com ใน background แล้ว automate การคลิก-พิมพ์-อ่าน DOM — ไม่ใช่ official API ของ Google
02
Requirements
Node.js ≥ 18
Chrome (stable)
Linux ✓
macOS ✓
Windows ✓
WSL2 + WSLg ✓
WSL1 ✗
Headless Linux server: ขั้นตอน setup_auth ต้องการ display จริง เพราะต้องให้ user login Google — ใช้ xvfb-run -a npx notebooklm-mcp ครั้งแรก หลังจากนั้นรันแบบ headless ได้ปกติ
03
ติดตั้ง
1
ติดตั้งผ่าน npx (แนะนำ)
terminal
npx notebooklm-mcp@latest
npx cache ไว้ในเครื่องและ auto-update ทุกครั้งที่ใช้ @latest
2
หรือ build จาก source
terminal
git clone https://github.com/PleasePrompto/notebooklm-mcp cd notebooklm-mcp npm install npm run build node dist/index.js
🔑
ตั้งค่า Auth (ครั้งแรก)
หลัง server รัน ให้ agent หรือ client เรียก tool setup_auth → Chrome จะเปิดขึ้น → Login Google → cookies ถูก save อัตโนมัติ
📁 Profile location:
Linux: ~/.local/share/notebooklm-mcp/chrome_profile/
macOS: ~/Library/Application Support/notebooklm-mcp/chrome_profile/
Windows: %APPDATA%\notebooklm-mcp\chrome_profile\
Linux: ~/.local/share/notebooklm-mcp/chrome_profile/
macOS: ~/Library/Application Support/notebooklm-mcp/chrome_profile/
Windows: %APPDATA%\notebooklm-mcp\chrome_profile\
04
เชื่อมต่อกับ MCP Client
🤖 Claude Code (CLI)
claude mcp add notebooklm \ -- npx notebooklm-mcp@latest
📄 Claude Code (~/.claude.json)
{
"mcpServers": {
"notebooklm": {
"command": "npx",
"args": ["notebooklm-mcp@latest"]
}
}
}
🖱️ Cursor (~/.cursor/mcp.json)
{
"mcpServers": {
"notebooklm": {
"command": "npx",
"args": ["notebooklm-mcp@latest"]
}
}
}
⚡ n8n / Zapier / Make (HTTP Mode)
# เปิด HTTP transport npx notebooklm-mcp@latest \ --transport http \ --port 3000 \ --host 0.0.0.0 # POST JSON-RPC ไปที่: # http://host:3000/mcp
05
Tools ทั้งหมด
Q&A
ถาม-ตอบ
ask_question
ถามคำถามเข้า notebook รองรับ session reuse, citation extraction (source_format) และ per-call browser override คืนค่า answer + _provenance
Sources & Studio
จัดการ Source และ Audio
add_source
เพิ่ม source เข้า notebook — รองรับ type=url (web crawl) และ type=text (paste)
generate_audio
สั่ง generate Audio Overview รองรับ custom_prompt และ timeout_ms (default 600,000ms)
download_audio
Download Audio Overview ล่าสุดไปยัง destination_dir ที่กำหนด
Library
จัดการ Notebook Library
add_notebook
เพิ่ม NotebookLM share-URL เข้า local library พร้อม metadata — ต้องมี user confirmation
list_notebooks
แสดง notebook ทั้งหมดใน library พร้อม metadata
get_notebook
ดึง notebook เดี่ยวตาม id
select_notebook
ตั้ง notebook เป็น default สำหรับ ask_question
update_notebook
แก้ไข name, description, topics, tags, url
remove_notebook
ลบออกจาก local library (ไม่ได้ลบ notebook บน NotebookLM จริง)
search_notebooks
ค้นหาตาม name, description, topics, tags
get_library_stats
สถิติและ usage ของ library
Sessions
จัดการ Browser Sessions
list_sessions
ดู active sessions ทั้งหมด พร้อม age และ message count
close_session
ปิด session ตาม session_id
reset_session
ล้าง chat history แต่คง session_id ไว้
System
ระบบ / Auth
get_health
ตรวจ auth state, session count, config snapshot
setup_auth
Login Google ครั้งแรก (เปิด Chrome ให้ user กรอก)
re_auth
ล้าง auth และ login ใหม่ — ใช้ตอนเปลี่ยน account
cleanup_data
ลบข้อมูลทั้งหมด — ใช้ preserve_library=true เพื่อเก็บ library.json ไว้
06
Citations (การอ้างอิงแหล่งที่มา)
ส่ง source_format เข้าไปใน ask_question เพื่อเลือกรูปแบบ citation ที่ต้องการ
| Mode | พฤติกรรม |
|---|---|
| none (default) | คำตอบ plain text ไม่มี sources field |
| inline | แทน [N] ด้วย (ชื่อแหล่ง — excerpt) ในเนื้อหาตอบ |
| footnotes | คำตอบปกติ + ต่อท้าย section "Sources" แบบมีหมายเลข |
| json | คำตอบปกติ + sources[] array ใน response (structured) |
07
Tool Profiles
ลด tool ที่แสดงต่อ agent เพื่อประหยัด context budget
| Profile | Tools ที่เปิดใช้ |
|---|---|
| minimal | ask_question, get_health, list_notebooks, select_notebook, get_notebook |
| standard | minimal + setup_auth, list_sessions, add_notebook, update_notebook, search_notebooks |
| full (default) | ทุก tool ทั้งหมด |
terminal — เปลี่ยน profile
npx notebooklm-mcp config set profile minimal
NOTEBOOKLM_PROFILE=standard npx notebooklm-mcp@latest
# ปิด tool เฉพาะ
NOTEBOOKLM_DISABLED_TOOLS=cleanup_data,re_auth npx notebooklm-mcp@latest
08
Provenance & AI Marker
ทุก response จาก ask_question มี _provenance envelope บอก agent ว่าคำตอบนี้มาจากไหน
{
"_provenance": {
"provider": "google-notebooklm",
"model": "gemini-2.5",
"via": "chrome-automation",
"grounding": "user-uploaded-documents",
"ai_generated": true
}
}
คำตอบจะมี prefix เตือนเสมอ (default on) ว่าเป็น AI-generated — ปิดได้ด้วย NOTEBOOKLM_AI_MARKER=false
09
Environment Variables สำคัญ
| Variable | Default | หน้าที่ |
|---|---|---|
| HEADLESS | true | รัน Chrome แบบ headless |
| NOTEBOOKLM_TRANSPORT | stdio | เลือก transport: stdio หรือ http |
| NOTEBOOKLM_PORT | 3000 | Port สำหรับ HTTP mode |
| NOTEBOOKLM_HOST | 127.0.0.1 | Bind address — ใช้ 0.0.0.0 ถ้าต้องการ public |
| NOTEBOOKLM_ACCOUNT | — | ชื่อ account สำหรับ multi-account |
| NOTEBOOKLM_PROFILE | full | Tool profile (minimal/standard/full) |
| NOTEBOOKLM_DISABLED_TOOLS | — | comma-separated ชื่อ tool ที่ต้องการปิด |
| NOTEBOOKLM_AI_MARKER | true | แสดง AI-generated prefix ในคำตอบ |
| ANSWER_TIMEOUT_MS | 600000 | timeout รอคำตอบ NotebookLM (ms) |
| MAX_SESSIONS | 10 | จำนวน browser sessions สูงสุด |
| SESSION_TIMEOUT | 900 | วินาที idle ก่อน session ถูก GC |
| BROWSER_CHANNEL | chrome | ใช้ chromium เพื่อ force Patchright bundled |