Google Drive
Files and folders in Google Drive.
Overview
Browse and download files from Google Drive through AI clients.
Prerequisites
- A Google account with Drive
- A stackgate.ai account
Getting credentials
- Open Integrations → Google Drive in stackgate.ai.
- Click Activate, then Connect Google Drive.
- Sign in with Google and grant the requested Drive scope (
drive.readonly). - Choose which folders AI clients may access (My Drive root and/or specific folders).
stackgate.ai uses the same Google OAuth app as Gmail, Google Calendar, and Search Console where applicable.
Scopes and revocation
- Scope:
https://www.googleapis.com/auth/drive.readonly— read-only access to files and exports; no upload or delete. - Revocation: disconnect Google Drive on the integration page, or revoke stackgate.ai in your Google Account permissions.
Folder selection
After OAuth, pick My Drive and/or individual top-level folders. MCP tools only search and download within enabled folders. Refresh the folder list from Google when you add new top-level folders.
Using with AI clients
- Dedicated endpoint:
POST /mcp/drive - Private gateway:
drive__*tools
Example prompts
- “Search my Drive for PDFs about Q4 budget.”
- “List files in the folder I enabled for MCP.”
- “Get metadata for file ID
1abc…and export the Google Doc as PDF.” - “Download this spreadsheet and store it in Temp Storage for WordPress upload.”
Set mode=temp-storage on download_file to store a file in Temp Storage and receive a file_id for cross-tool handoff. Omit mode or use mode=download for inline bytes or a resource link. Requires Temp Storage activated on My Integrations.
Files under 10 MB return embedded binary content; larger files return a resource_link — fetch bytes with resources/read.
Troubleshooting
- File not found — confirm the file is in a folder you enabled, and the connected account has access.
- No folders enabled — open folder preferences on the integration page and enable at least one folder.
- Insufficient scopes — disconnect and reconnect Google Drive to refresh OAuth permissions.
- Export errors — some Google Workspace file types only support specific export formats (PDF, XLSX, etc.).
Available tools
-
list_folders
List Google Drive folders enabled for MCP access in My Integrations.
-
search_files
Search files in Google Drive using Google Drive query syntax within folders enabled in My Integrations.
-
list_files
List files in Google Drive within folders enabled in My Integrations. Optional query uses Google Drive search syntax.
-
get_file_metadata
Get metadata for a Google Drive file by ID within folders enabled in My Integrations.
-
download_file
Download or export a Google Drive file. Google Workspace files are exported (PDF, XLSX, etc.). Default mode returns inline bytes for files under 10 MB or a resource_link for larger files. Use mode=temp-storage to store in temp storage and receive a file_id for cross handoff.
MCP endpoint:
https://stackgate.ai/mcp/drive
(HTTP) or via the
private gateway.