HOW-TO GUIDE
How to connect Gemini to Google Workspace MCP servers from Apps Script
Based on a guide by Tanaike on DEV Community · Nov 26, 2026
You'll end with: An Apps Script project where Gemini lists your Drive files and builds a Google Sheet through the Workspace MCP servers, with no server to run.
Why it's worth having: The script runs under your own Google permissions, and the MCP servers are free up to 5,000 requests a day on the Standard tier.
At a glance
WHO IT'S FOR
Operations staff, analysts, and engineers who automate Gmail, Drive, and Sheets work.
LEVEL
Intermediate
COST
Free to read. Apps Script and the Standard tier are free; the Gemini API key is free to create in Google AI Studio.
YOU NEED
A Google account · A Google Cloud project · A Gemini API key · The GASADK and OAuth2 Apps Script libraries
The method, in short
- 1Use Google Cloud Personal mode onboarding to create a web OAuth client with Use this client for an AI-powered agent checked.
- 2Add the GASADK and OAuth2 libraries to a new Apps Script project, since ScriptApp.getOAuthToken does not work with these servers.
- 3Store the OAuth client ID, client secret, and Gemini API key in Script Properties, then authorize once in the browser.
- 4Run the Drive sample first, then the second sample, which mixes Drive and Sheets MCP tools with native Apps Script.
Read the full guide from Tanaike on DEV Community
The guide has both scripts, the manifest, the setup steps, and execution logs.
Credit: Tanaike on DEV Community