NotebookLM and OpenCode
NotebookLM can help organize source material, while OpenCode can use a NotebookLM MCP server as an external tool. The connection described here is a community-maintained integration, not a Google or OpenCode feature. Treat the server as software that can access your Google session and read notebook content.
What this workflow is for¶
Use NotebookLM to collect and question reference material, then ask OpenCode to apply a checked finding to a repository. This separates source research from implementation and makes it easier to show which documents informed a change.
NotebookLM answers are still generated by AI. Check important claims against the cited source before turning them into code or policy.
Review trust boundaries first
An MCP server is an external process. It can add tools to OpenCode and may handle browser sessions, notebook content, or API credentials. Read the server’s source, security policy, release notes, and Google account scopes before enabling it. Start with a test notebook containing non-sensitive material.
Prerequisites¶
- OpenCode installed and able to connect to a model.
- A Google account with access to NotebookLM.
- Node.js and
npx, if using the example local server command. - A small, non-sensitive notebook for the first connection.
Check the local tools before changing configuration:
opencode --version
node --version
npx --version
Configure the community MCP server¶
OpenCode defines MCP servers under the mcp key. The current OpenCode schema
uses a local server with a command array:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"notebooklm": {
"type": "local",
"command": ["npx", "-y", "@pan-sec/notebooklm-mcp@latest"],
"enabled": false
}
}
}
The package name and command are taken from the community project’s current
README. @latest is convenient for an experiment but is not reproducible:
for a serious project, select a reviewed version and record it in your setup
notes after checking the project’s releases and security history.
Enable the server only when you intend to use it. OpenCode also supports
project-local configuration, so keep personal credentials out of a committed
opencode.json file. Use environment-variable references or the server’s
documented authentication mechanism where available.
MCP terminology
MCP (Model Context Protocol) is a standard way for an AI client to discover and call tools exposed by another process. The server’s tool names and capabilities are not guaranteed to remain the same across releases.
After saving the configuration, start OpenCode and inspect the connection:
opencode mcp list
If the server is disabled, enable it in the configuration, restart OpenCode, and inspect the available tools. Do not assume that a tool shown in an older article is present in your installed release.
Authentication¶
Use the authentication flow documented by the server and NotebookLM. A browser login may be required because NotebookLM is a web application. Never copy a raw browser cookie header into a prompt, issue, or repository. If a server asks you to export cookies manually, pause and assess whether that is acceptable for the account and data involved; prefer a supported, revocable authentication method.
An optional Gemini API key may enable additional server features, but it does not replace reviewing the server’s permissions or Google’s current NotebookLM terms. Store keys in a secret manager or environment variable, not inline in JSON committed to source control.
A source-grounded development loop¶
- Create a NotebookLM notebook and add the official documentation, standards, or specifications you need.
- Ask NotebookLM a focused question and open the cited sources.
- In OpenCode, state the notebook and source scope explicitly. Ask for a summary with citations or source locations before requesting an edit.
- Compare the proposed change with the repository’s tests and local rules.
- Review the diff and run the relevant checks yourself.
Prompt pattern
Use the notebooklm tool only for the notebook named “API specification”.
Identify the source passages that define token expiry. Summarize them
first; do not edit files until I confirm the interpretation.
This staged pattern keeps research, interpretation, and code changes distinct.
Useful workflows¶
Research before implementation¶
Ask for a source-backed summary of an API or standard, then ask OpenCode to map that summary to the current codebase. Confirm the mapping before allowing an edit.
Specification review¶
Provide the relevant notebook and ask OpenCode to list requirements, unknowns, and conflicts with the implementation. This is more reliable than asking for a large rewrite in one step.
Documentation drafting¶
Use the notebook as a reference set, but have OpenCode mark any statement that is not directly supported by a source. Review links and examples before publishing.
Tool discovery and troubleshooting¶
The community server’s tools are release-dependent. Discover them from the connected MCP server rather than copying a permanent tool table from this article. If no tools appear:
- Run
opencode mcp listand confirm the server is enabled. - Run the server’s documented
--helpor diagnostic command separately. - Check Node.js, network access, and browser authentication.
- Inspect OpenCode’s logs for the first error, not only the final timeout.
- Disable the server again while investigating.
If authentication fails, revoke the relevant session or token using the provider’s account controls and retry the supported login flow. Do not solve a login problem by pasting more credentials into chat.
Limitations and safety checklist¶
- NotebookLM and the community MCP server can change independently.
- Source grounding helps, but does not prove that an answer is complete or correct.
- Tool output enters the model context and can increase context usage.
- Notebook and source contents may contain personal, confidential, or licensed material; confirm that external processing is allowed.
- Keep the server disabled when it is not needed and review its permissions after upgrades.
Resources¶
- OpenCode MCP servers
- Community NotebookLM MCP server
- NotebookLM
- NotebookLM Help
- Generate an Audio Overview
Verification¶
- Last reviewed: 2026-09-09
- Primary sources: OpenCode MCP documentation and Google NotebookLM Help.
- Community source: Pantheon Security’s
notebooklm-mcp-secureREADME was checked for the package name and OpenCode configuration shape. - Scope: configuration and safety guidance were checked. Authentication behavior, tool names, package releases, and NotebookLM limits remain release- and account-dependent.
Review this page after upgrading OpenCode or the MCP server.