Google Docs and Google Slides are supported. Spreadsheets, PDFs and other file types in a selected folder are skipped. The picker marks them as not supported.
Set up Google Cloud
Context7 reads Drive with a service account and one read-only scope:
The Set up Google Cloud panel in the Google Drive card (Settings → Integrations) shows these steps. Enter your project ID there, and the panel fills it into the commands.
1
Create the service account
Run these commands in Cloud Shell or with the gcloud CLI. Replace
PROJECT_ID with your project ID. The first command enables the Google Drive API and the Google Slides API. The service account needs no IAM roles in the project.2
Create a key, or use workload identity
To use a key, download one:Organizations created on or after May 3, 2024 block service account keys by default. If Google refuses to create the key, ask an organization admin to allow keys for this project, or use Server credentials without a key (see Connect Google Drive).
3
Share the content
In Google Drive, share each folder you want to sync with the service account’s email address, with Viewer access. For a Shared Drive, add the service account as a member with the Viewer role. If Drive does not allow sharing outside your organization, ask a Workspace admin to allow it for the service account, or use domain-wide delegation.
Domain-wide delegation (optional)
If sharing with the service account is not practical, the service account can act as one Workspace user and see what that user sees.- Copy the service account’s client ID. It is
client_idin the JSON key, and the Set up Google Cloud panel shows it after you paste the key. - In the Google Workspace Admin console, open Security → Access and data control → API controls → Manage Domain Wide Delegation.
- Add a new client with that ID and the scope
https://www.googleapis.com/auth/drive.readonly. - In Context7, enter the user’s email address in Act as user.
Without delegation, the service account can read only what is explicitly shared with it. This keeps the approved content small and visible in Drive’s sharing settings, so prefer it when you can.
Connect Google Drive
Open Settings → Integrations and choose how Context7 authenticates in the Google Drive card.- Service account key
- Server credentials
Paste the JSON key, and optionally the user for domain-wide delegation. Click Test connection, then click Connect.Context7 checks the key with Google before it saves it, stores it encrypted, and never returns it from any API. The settings page shows only the service account’s email and the last characters of the key ID. To rotate the key, paste the new key and save.
Add a Google Drive library
Go to Add and choose Google Drive.- Shared with the connector lists the folders, Docs and presentations shared with the service account. Click a folder to open it.
- Shared Drives lists the Shared Drives the service account is a member of.
https://docs.google.com/document/d/<id>/edit. That link is the Source: of every result, so an agent can point people to the original document.
Google Slides
Each slide of a presentation is indexed as its own page, with a link that opens that slide:https://docs.google.com/presentation/d/<id>/edit#slide=id.<slide id>. The slide’s title becomes its heading, and its text, lists, links, tables and speaker notes follow. Hidden (skipped) slides are not indexed. Images, charts and diagrams are not indexed, and neither is text inside images.
When a presentation changes, Context7 reads the whole presentation again:
- A slide that did not change reuses its last extraction.
- A deleted slide leaves the results.
- If one slide fails to index, its last indexed version stays.
- If the presentation cannot be read, all its slides keep their last indexed version.
- A presentation with no visible slides counts as empty and leaves the results.
How syncing works
Every sync lists the selected folders again and compares each file with the last sync:
A sync builds the new index next to the live one and swaps it in only when it finishes, so queries always see a complete library.
Failures keep valid content
- One file fails (for example it is larger than Drive’s 10 MB export limit, or the LLM times out while extracting it): the last indexed version of that file stays in the results. The library page shows a warning, its logs list the file and the reason, the Libraries list in Settings shows the failed files, and the next sync tries it again.
- The whole sync fails (for example Google refuses access because the Drive API is disabled, or Google cannot be reached): all live content stays as it was, and the error is shown in the library’s logs.
Scheduled sync
Google Drive libraries sync every day at 03:00 server time by default. Under Sync schedule in the Google Drive card (Settings → Integrations), you can:- turn the scheduled sync off,
- change the schedule: pick a preset such as Every 6 hours, or enter a cron expression such as
0 */6 * * *, - click Sync all now to queue every Google Drive library at once.
Monitor libraries
The Libraries list in the Google Drive card (Settings → Integrations) shows every Google Drive library with its selection, its last sync, and a status:
Expanding a row shows the most common failure reasons and up to 50 failed files, each linked to Drive. Download CSV exports every failed file. Problem libraries sort to the top, and Needs attention filters the list to them.
Authority labels
Authority labels can match Google Drive content by path or by URL:- A path pattern matches the Drive folder path inside the selection, for example
/QA/Standards/for every file in the Standards folder of a selected QA folder. For a Shared Drive, the path starts with the Shared Drive’s name. - A URL pattern matches the Doc’s Google URL, for example
https://docs.google.com/document/d/<id>.
- A URL prefix
https://docs.google.com/presentation/d/<id>matches every slide of that presentation. - A path rule matches the presentation’s folder path, for example
/QA/Standards/Release review, and applies to all its slides.
Network access
The server talks only to Google:
Set
GOOGLE_DRIVE_API_URL and GOOGLE_SLIDES_API_URL to send Drive and Slides API calls through another endpoint, such as a Private Google Access address or a proxy. Each value must include the API path, for example https://www.googleapis.com/drive/v3 and https://slides.googleapis.com/v1.