NotebookLM API and MCP Server: Setup & Free Limits

Create research notebooks from scripts or AI coding agents, and check source imports before you open them in Gemini Notebook.

Google now offers an official API and MCP server for NotebookLM (formerly Gemini Notebook). You can now create notebooks from your own scripts or ask an AI coding agent to add research links, YouTube videos, and notes for you.

The public preview is free for personal Google accounts. Follow the setup below to create your first notebook from the terminal or connect Google’s MCP server to your coding agent.

What Are the NotebookLM API and MCP Server?

The Gemini Notebook API accepts HTTP requests at https://notebook.googleapis.com/v1. A script can create a notebook, add sources from a list of URLs, and check their import status.

The official MCP server provides these operations as tools that agents in Claude Code, Codex, and Grok Build (formerly Cursor) can call through the Model Context Protocol.

Both methods access notebooks under the Google account you authorize. Your Cloud project tracks request quotas.

TaskWhere to do it
Create, view, list, or rename notebooksREST and MCP
Import web pages, YouTube, text, or MarkdownREST and MCP
List sources or check import statusREST and MCP
Upload a local file from codeREST only
Ask questions with citations or retrieve source contentWeb app
Generate audio/video overviews, reports, or slidesWeb app
Delete notebooks or sourcesWeb app
Import from Google DriveWeb app

After importing sources, open your notebook in Gemini Notebook. Use Chat to ask questions and Studio to generate study materials.

How to Use the NotebookLM REST API

Create a notebook named CSS Grid Research and import the MDN CSS Grid guide. The example uses cURL to send requests and jq to extract resource names from the JSON responses.

1. Enable the API and Get an OAuth Token

You need a personal Google account that has signed in to Gemini Notebook at least once.

Google Workspace accounts are outside the preview, with access planned for a future release. Both the REST API and MCP server use Google OAuth 2.0 access tokens. They do not accept API keys, including Gemini API keys from Google AI Studio.

Open the Google Cloud Console, create or select a project, and copy the Project ID from its dashboard.

Install the Google Cloud CLI and open Bash with gcloud, jq, and cURL 7.82 or later.

On Windows, use WSL for these shell examples. Install Python 3 if you want to run the batch example later.

Replace YOUR_PROJECT_ID with the ID you copied. Sign in with a Cloud account that has permission to enable services in the project. The second sign-in stores Application Default Credentials (ADC) for your personal Gemini Notebook account (this replaces existing local ADC credentials).

export PROJECT_ID="YOUR_PROJECT_ID"
gcloud auth login
gcloud services enable notebook.googleapis.com \
  --project="$PROJECT_ID"
gcloud auth application-default login \
  --project="$PROJECT_ID" \
  --scopes="https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/notebook"
export ACCESS_TOKEN="$(gcloud auth application-default print-access-token)"
API_ROOT="https://notebook.googleapis.com/v1"

If the ADC sign-in rejects the notebook scope, create a desktop OAuth client in your Cloud project:

  1. Open Google Auth Platform → Branding and enter the app name and contact details.
  2. Under Audience, choose External. If the app is in Testing, add your personal Google account under Test users.
  3. Under Data Access, add the https://www.googleapis.com/auth/notebook and https://www.googleapis.com/auth/cloud-platform scopes.
  4. Under Clients, create a Desktop app OAuth client. Download the client JSON file as client_secret.json in your current folder.

Run the ADC sign-in again using your new OAuth client.

gcloud auth application-default login \
  --client-id-file=./client_secret.json \
  --project="$PROJECT_ID" \
  --scopes="https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/notebook"
export ACCESS_TOKEN="$(gcloud auth application-default print-access-token)"
API_ROOT="https://notebook.googleapis.com/v1"

The notebook OAuth scope grants read and write access. For a read-only REST script, use https://www.googleapis.com/auth/notebook.readonly in place of the write scope.

With ADC, each request needs the bearer token in the Authorization header and the Cloud project ID in x-goog-user-project.

2. Create the Notebook and Import a Web Page

The helper below adds both authentication headers to each request.

The first POST creates the notebook and returns a resource name starting with notebooks/. The second POST uses that name to import a web page.

Continue to step 3 after both resource names appear.

nb_request() {
  curl --silent --show-error --fail-with-body --max-time 30 \
    -H "Authorization: Bearer $ACCESS_TOKEN" \
    -H "x-goog-user-project: $PROJECT_ID" \
    "$@"
}
unset NOTEBOOK SOURCE
if notebook_json=$(nb_request --json \
    '{"displayName":"CSS Grid Research"}' "$API_ROOT/notebooks") &&
  NOTEBOOK=$(jq -er '.name' <<< "$notebook_json"); then
  printf 'Notebook: %s\n' "$NOTEBOOK"
  if source_json=$(nb_request --json '{
      "displayName": "MDN CSS Grid guide",
      "webContent": {
        "url": "https://developer.mozilla.org/en-US/docs/Learn_web_development/Core/CSS_layout/Grids"
      }
    }' "$API_ROOT/$NOTEBOOK/sources") &&
    SOURCE=$(jq -er '.name' <<< "$source_json"); then
    printf 'Source: %s\n' "$SOURCE"
  else
    printf '%s\n' "$source_json" >&2
  fi
else
  printf '%s\n' "$notebook_json" >&2
fi

To import a different web page, use a public HTTPS URL with no login or paywall. YouTube imports use a watch or share URL for a public or unlisted video that has captions.

To add text or Markdown, replace webContent with textContent containing a content string, and use mimeType of text/plain or text/markdown.

3. Check That the Source Is Ready

Google processes each source in the background. This loop checks the source up to 30 times at four-second intervals. It ends early if the source becomes ACTIVE or returns FAILED in which case it prints the error details.

for attempt in {1..30}; do
  status_json=$(nb_request "$API_ROOT/$SOURCE") || {
    printf '%s\n' "$status_json" >&2
    break
  }
  state=$(jq -er '.state' <<< "$status_json") || break
  printf '%s\n' "$state"
  case "$state" in
    ACTIVE) break ;;
    FAILED) jq '.error' <<< "$status_json"; break ;;
    PROCESSING) ;;
    *) break ;;
  esac
  if [ "$attempt" -lt 30 ]; then sleep 4; fi
done

Once the state changes to ACTIVE, open Gemini Notebook with the Google account used for ADC. Select CSS Grid Research and find the MDN guide in the Sources panel.

Upload a Local PDF

To import a local PDF, reuse the notebook name from step 2 and replace ./brief.pdf with your file path.

Set the source label with source.displayName in the URL (use %20 for spaces). The response contains the new resource name under source.name. Run the status check in step 3 once that name appears.

UPLOAD_ROOT="https://notebook.googleapis.com/upload/v1"
unset SOURCE
if upload_json=$(nb_request --max-time 300 \
    -H "Content-Type: application/pdf" \
    --data-binary @./brief.pdf \
    "$UPLOAD_ROOT/$NOTEBOOK/sources:upload?uploadType=media&source.displayName=Grid%20brief"); then
  SOURCE=$(jq -er '.source.name' <<< "$upload_json") &&
    printf 'Source: %s\n' "$SOURCE"
else
  printf '%s\n' "$upload_json" >&2
fi

Besides PDFs, the upload endpoint accepts DOCX, PPTX, ODT, EPUB, RTF, HWP, CSV, plain text, Markdown, audio (audio/* or application/x-ogg), images (image/*), and 3GPP/3GPP2 video.

Use the MIME type of the file as the Content-Type header. Large files can also use Google’s resumable upload protocol.

Check a Batch of Imports With Python

Use this Python 3 script to check every source in the notebook at once. It uses the token and project from step 1 and the notebook name from step 2. The loop follows nextPageToken until it has printed each source’s name and processing state.

python3 - "$NOTEBOOK" <<'PYTHON'
import json
import os
import sys
from urllib.parse import urlencode
from urllib.request import Request, urlopen
url = f"https://notebook.googleapis.com/v1/{sys.argv[1]}/sources"
headers = {
    "Authorization": f"Bearer {os.environ['ACCESS_TOKEN']}",
    "x-goog-user-project": os.environ["PROJECT_ID"],
}
params = {"pageSize": 100}
while True:
    request = Request(f"{url}?{urlencode(params)}", headers=headers)
    with urlopen(request, timeout=30) as response:
        page = json.load(response)
    for source in page.get("sources", []):
        print(source["state"], source.get("displayName") or source["name"])
    token = page.get("nextPageToken")
    if not token:
        break
    params["pageToken"] = token
PYTHON

List, Find, and Rename Notebooks

The REST API also enables you to list your notebooks, fetch one notebook’s metadata, and change the title. Use the helper from step 2 and the notebook resource name you saved:

# List notebooks (up to 100 per page)
nb_request "$API_ROOT/notebooks?pageSize=100" | jq .
# Get metadata for one notebook
nb_request "$API_ROOT/$NOTEBOOK" | jq .
# Rename that notebook
nb_request -X PATCH --json '{"displayName":"CSS Grid Notes"}' \
  "$API_ROOT/$NOTEBOOK?updateMask=displayName" | jq .

To list more than 100 notebooks, pass the returned nextPageToken as pageToken in the next request. Add filter=notebook.is_owner%20%3D%20true to the list URL to return only notebooks you own.

How to Connect the Official NotebookLM MCP Server

For an agent-driven workflow, connect directly to Google’s hosted MCP server at https://notebook.googleapis.com/mcp over Streamable HTTP.

Complete only step 1 of the REST section to obtain your token and project ID. Choose one of the client configurations below, and merge the server entry into your existing configuration if it already contains other servers.

The ADC access token expires after one hour. Run export ACCESS_TOKEN="$(gcloud auth application-default print-access-token)" to refresh it and restart the client from that shell.

If you set up ADC in WSL but run a Windows-native MCP client, open PowerShell and set the variables there. Launch the client from that PowerShell session:

$env:PROJECT_ID = "YOUR_PROJECT_ID"
$env:ACCESS_TOKEN = (wsl gcloud auth application-default print-access-token).Trim()

Claude Code

In Claude Code, add the server to .mcp.json in your project root.

Launch claude from the terminal with ACCESS_TOKEN and PROJECT_ID exported. Approve the server if asked and run /mcp to check its connection.

{
  "mcpServers": {
    "gemini-notebook-api": {
      "type": "http",
      "url": "https://notebook.googleapis.com/mcp",
      "headers": {
        "Authorization": "Bearer ${ACCESS_TOKEN}",
        "x-goog-user-project": "${PROJECT_ID}"
      }
    }
  }
}

Grok Build (Formerly Cursor)

The Grok Build desktop Agents Window uses the existing .cursor/mcp.json format. Save this entry in your project’s .cursor/mcp.json or in ~/.cursor/mcp.json for all local projects. Quit all Grok Build windows and launch the desktop executable from the shell with both variables set. Open Customize -> MCPs to enable the server.

{
  "mcpServers": {
    "gemini-notebook-api": {
      "url": "https://notebook.googleapis.com/mcp",
      "headers": {
        "Authorization": "Bearer ${env:ACCESS_TOKEN}",
        "x-goog-user-project": "${env:PROJECT_ID}"
      }
    }
  }
}

For the Grok Build TUI, add the following entry to ~/.grok/config.toml.

Start grok in the terminal where you set the variables and run /mcps to check the server. The TUI also reads .cursor/mcp.json if you already use the desktop configuration.

[mcp_servers.gemini-notebook-api]
url = "https://notebook.googleapis.com/mcp"
headers = { Authorization = "Bearer ${ACCESS_TOKEN}", "x-goog-user-project" = "${PROJECT_ID}" }

OpenAI Codex CLI

For Codex CLI, add this entry to ~/.codex/config.toml. Start codex in the shell with both variables exported and run /mcp to view the server.

[mcp_servers.gemini-notebook-api]
url = "https://notebook.googleapis.com/mcp"
bearer_token_env_var = "ACCESS_TOKEN"
env_http_headers = { "x-goog-user-project" = "PROJECT_ID" }

Check the Tool List and Create a Notebook

The official MCP server currently exposes 7 tools. Send this JSON-RPC discovery request from your setup shell to check that the server responds.

curl --silent --show-error --fail-with-body \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "x-goog-user-project: $PROJECT_ID" \
  -H "MCP-Protocol-Version: 2026-07-28" \
  -H "Mcp-Method: tools/list" \
  --json '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/list",
    "params": {
      "_meta": {
        "io.modelcontextprotocol/protocolVersion": "2026-07-28"
      }
    }
  }' https://notebook.googleapis.com/mcp |
  jq -er '.result.tools[].name'
MCP toolAction
create_notebookCreate a notebook
get_notebookRead notebook metadata
list_notebooksList accessible notebooks
update_notebookRename a notebook
create_sourceImport a link, text, or Markdown
get_sourceCheck source metadata and state
list_sourcesList sources in a notebook

Seeing the tools confirms discovery. To verify account access, ask your agent to call list_notebooks on gemini-notebook-api. An empty list is valid if you have no notebooks. After this call succeeds, send the following prompt and approve the notebook and source creation calls if asked.

Use only the gemini-notebook-api MCP server for this task.
1. Call create_notebook with notebook.displayName set to
   "CSS Grid Research (MCP)".
2. Pass the returned notebook name as parent to create_source.
   Set the source displayName to "MDN CSS Grid guide" and
   webContent.url to:
   https://developer.mozilla.org/en-US/docs/Learn_web_development/Core/CSS_layout/Grids
3. Call get_source with the returned source name. If the state
   is PROCESSING, wait a few seconds and check again. Stop at
   ACTIVE or FAILED and report the source name and final state.

When the source reaches ACTIVE, open CSS Grid Research (MCP) in Gemini Notebook and find the MDN guide under Sources. You can now ask NotebookLM questions about the imported page or generate an overview in Studio.

NotebookLM API Pricing and Free Limits

The Gemini Notebook API and MCP server are free during Public Preview, including for users on the free personal plan.

API Requests per Minute

The project-wide read quota includes get and list calls. Create, update, and upload calls share the write quota. Each method also has a per-user rate limit.

Scope and operationLimit per minute
Project · all reads100 requests
Project · all writes100 requests
User · CreateSource20 requests
User · UploadSource20 upload starts
User · each other method60 requests

Notebook, Source, and File Size Limits

The API counts notebooks per Google account and sources per notebook. In addition to the plan quotas below, every source has a 500,000-word limit. Inline text or Markdown has a 1,000,000-byte limit, and file uploads are capped at 200 MiB (209,715,200 bytes). Notebook and source titles have a 500-character limit.

API tierNotebooksSources
Free10050
Plus200100
Pro500300
Ultra500600

Web App Chat and Studio Limits

In the web app’s plan limits, the Ultra 20 TB and Ultra 30 TB plans have limits of 500 and 600 regular sources per notebook, respectively. The API currently publishes a single Ultra quota of 600. For Chat and Studio features on compute-based limits, the usage budget refreshes every five hours up to the weekly cap. Open Settings -> Usage to check your balance.

Official NotebookLM API vs. Unofficial Tools

Google’s API and MCP server use OAuth to create notebooks and import sources. For notebook chat or Studio generation directly from an agent, the following community projects use the web app’s internal endpoints or browser automation.

  • notebooklm-py offers a Python library, CLI, and agent skill for querying sources and generating artifacts such as Audio Overviews. It uses Google’s private web RPCs and a saved browser login.
  • gemini-notebook-mcp-cli offers a CLI, MCP server, and skills with browser-session authentication. It exposes notebook chat and Studio generation to agents.

Troubleshoot NotebookLM API and MCP Errors

The API Won’t Enable on My Cloud Project

Check the project ID and the permissions of the account that ran gcloud auth login. Enabling the API requires serviceusage.services.enable, included in the Service Usage Admin role. This command should list notebook.googleapis.com after you enable it:

gcloud services list --enabled --project="$PROJECT_ID" \
  --filter='config.name=notebook.googleapis.com'

401 or 403 After Sign-In

A 401 UNAUTHENTICATED error usually means the bearer token is missing or expired. Mint a new ADC token and retry. For 403 PERMISSION_DENIED, inspect the error reason. WORKSPACE_ACCOUNT_NOT_SUPPORTED requires a personal Google account. If a write fails for lack of scope, repeat the ADC sign-in with the notebook scope.

For an error involving the quota project, check that x-goog-user-project contains the ID of the Cloud project with the API enabled. The authorizing user needs serviceusage.services.use on that project, which the Service Usage Consumer role grants. For a notebook access error, sign in with a Google account that has access to that notebook.

404 on Notebook Creation or Source Lookup

If notebook creation returns Account not found for user., open Gemini Notebook on the web with your ADC account and retry. For a 404 NOT_FOUND on source lookup, use the complete notebooks/{notebook}/sources/{source} name and check that the source still exists in that account.

429 While Importing Sources

A 429 RESOURCE_EXHAUSTED error may indicate either a request-rate limit or a full notebook or account. For a rate limit, slow your requests and retry with exponential backoff and jitter. If an upload returns a RetryInfo.retryDelay, wait at least that long before starting another upload. If you reached the notebook or source capacity, delete unused items in the web app or choose a notebook with room for another source.

The MCP Server Connects but Tool Calls Fail

Run the direct discovery request from the MCP section. If it lists tools but your client does not, enable the server and check its remote HTTP configuration. If tools appear, try list_notebooks. For an authentication failure, refresh your access token, restart the client from the shell with both variables, and check the 401 or 403 error reason.

The Source Stays in Processing or Fails

For a source that stays in PROCESSING, wait and poll its existing resource name. For FAILED, read error.message to identify the import problem. If a web page cannot be fetched, check it in a private browser window and choose a public URL. For YouTube, use a video with captions or import a transcript as text. Split material that exceeds the source size or word limit.

400 When Adding a Source

If a create or upload request returns 400 INVALID_ARGUMENT before giving you a resource name, check the request body. Supply exactly one input field (webContent or textContent) when creating a source, or send the file bytes and its MIME type when uploading. Add Drive and Google Docs links from the Sources panel in the web app.

FAQs

Can I use the NotebookLM API with my existing notebooks?

Yes. The list_notebooks MCP tool and GET /v1/notebooks return notebooks you own and notebooks shared with your Google account, including ones created in the web app. To list only shared notebooks, set the MCP filter argument to notebook.is_owner = false or add filter=notebook.is_owner%20%3D%20false to the REST list URL.

Can I use the NotebookLM API without the Google Cloud CLI?

Yes. Register a desktop or web application OAuth client in the Cloud project where you enabled the API. Use the OAuth 2.0 sign-in flow for your application to request the https://www.googleapis.com/auth/notebook scope from a personal Google account. Send the resulting access token in the Authorization: Bearer header of each HTTP request.

Can I import multiple URLs into NotebookLM at once?

The API accepts one URL per source creation request. To import a list of URLs, loop over them and send a separate POST to /v1/{notebook_name}/sources for each, keeping the source creation rate at or below 20 requests per minute per user. To avoid importing the same link on each run, compare your URL list with the originalUrl values returned by ListSources before creating new sources.

Can I update an existing NotebookLM source through the API?

The official API has no source update or refresh method at present. To replace an outdated source, import the new version into the same notebook, wait for it to reach ACTIVE, and remove the outdated copy in the web app.

Will my notebooks disappear when the MCP access token expires?

No. Notebooks and successfully imported sources are stored in your Google account. An expired token interrupts API and MCP requests, but you can still open those notebooks in the web app. Refresh the token and reconnect your agent to resume working with them.

Related Resources

Official Sources

Leave a Reply

Your email address will not be published. Required fields are marked *

Get the latest & top AI tools sent directly to your email.

Subscribe now to explore the latest & top AI tools and resources, all in one convenient newsletter. No spam, we promise!