Overview
Installation
Content Details
Alternatives
What is an MCP server?
An MCP server is a tool that interacts with AI models (such as Gemini) through the Model Context Protocol (MCP). It allows AI models to call external services and APIs to perform complex tasks.How to use an MCP server?
By deploying a Google Apps Script project as a Web App and configuring Gemini CLI to connect to the server, users can easily enable Gemini to call Google Workspace services (such as Gmail, Drive, Calendar, etc.).Use cases
Suitable for automating daily tasks, such as managing calendar events, sending emails, processing documents and files, etc. Ideal for developers and general users who want to enhance productivity with AI.Main Features
How to Use
Usage Examples
Frequently Asked Questions
Related Resources
Installation
{
"theme": "Default",
"selectedAuthType": "###",
"mcpServers": {
"gas_web_apps": {
"command": "npx",
"args": [
"mcp-remote",
"https://script.google.com/macros/s/###/exec?accessKey=sample"
],
"env": {}
}
}
}🚀 Gemini CLI with MCP Server: Expanding Possibilities with Google Apps Script
The Gemini CLI verifies that the MCP server built with Google Apps Script (GAS), a low - code platform, offers vast possibilities. If you've created snippets for GAS, they can be revitalized and/or utilized in new ways by serving as the MCP server. The Gemini CLI and other MCP clients will be helpful in achieving this.
🚀 Quick Start
The Gemini CLI offers a powerful command - line interface to interact with Google's Gemini models. By leveraging the Model Context Protocol (MCP), the CLI can be extended with custom tools. This report explores integrating the Gemini CLI with an MCP server built using Google Apps Script Web Apps, demonstrating how it simplifies authorization for Google Workspace APIs and enables Gemini to execute complex tasks within the Google ecosystem.
✨ Features
- Seamless Google API Authorization: Google Apps Script provides seamless authorization for Google APIs, especially those in Google Workspace, reducing development overhead.
- Extensive Toolset: The ToolsForMCPServer offers 41 pre - built tools for interacting with Google Workspace services such as Gmail, Drive, Calendar, etc.
- Customization: Developers can add custom tools to the MCP server, expanding the functionality of the Gemini CLI.
- Automation: Combine the Gemini CLI with the MCP server to achieve powerful automation across Google Workspace.
📦 Installation
Preparing the MCP Server
- Create a Google Apps Script Project: Visit script.google.com to create a new standalone Google Apps Script project. Ref
- Install Libraries:
- MCPApp: Manages the MCP server lifecycle and communication protocols.
- Installation Guide
- Project Key:
1TlX_L9COAriBlAYvrMLiRFQ5WVf1n0jChB6zHamq2TNwuSbVlI5sBUzh - Identifier:
MCPApp - Repository: https://github.com/tanaikech/MCPApp
- ToolsForMCPServer: Provides a suite of pre - built tools for interacting with Google Workspace services.
- Installation Guide
- Project Key:
1lnE7UL1jQgPDbTB9yjhiwZM0SaS9MObhzvWUWb_t8FisO6A3bLepvM2j - Identifier:
ToolsForMCPServer - Repository: https://github.com/tanaikech/ToolsForMCPServer
- MCPApp: Manages the MCP server lifecycle and communication protocols.
- Script: Copy and paste the following script into the script editor, replacing any existing code, and save the project.
const apiKey = "###"; // API key for Gemini API
/**
* This function is automatically run when the MCP client accesses Web Apps.
*/
const doPost = e => main(e);
function main(eventObject) {
const m = ToolsForMCPServer;
m.apiKey = apiKey;
const object = { eventObject, items: m.getTools() };
return new MCPApp
.mcpApp({ accessKey: "sample" })
.setServices({ lock: LockService.getScriptLock() })
.server(object);
}
Note:
- If you want to use tools like
generate_roadmap_to_google_sheets,generate_description_on_google_drive,generate_image_on_google_drive,summarize_file_on_google_drive,description_web_site, uncomment theapiKeyline and provide a valid API key for the Gemini API. - If a Drive API - related error occurs, enable Drive API at Advanced Google services.
- If you want to manage Docs, Sheets, and Slides using the batch update methods of API, enable Docs API, Sheets API, and Slides API at Advanced Google services.
Show all tools
function showAlltools() {
const res = ToolsForMCPServer.getToolList();
console.log(res);
}
Filter tools
// Use only the tool get_exchange_rate
function main(eventObject) {
const enables = ["get_exchange_rate"];
const m = ToolsForMCPServer;
m.apiKey = apiKey;
const object = { eventObject, items: m.getTools({ enables }) };
return new MCPApp
.mcpApp({ accessKey: "sample" })
.setServices({ lock: LockService.getScriptLock() })
.server(object);
}
// Use all tools except for the tool get_exchange_rate
function main(eventObject) {
const disables = ["get_exchange_rate"];
const m = ToolsForMCPServer;
m.apiKey = apiKey;
const object = { eventObject, items: m.getTools({ disables }) };
return new MCPApp
.mcpApp({ accessKey: "sample" })
.setServices({ lock: LockService.getScriptLock() })
.server(object);
}
- Deploy Web Apps:
- In the script editor, click Deploy -> New deployment.
- Click Select type -> Web App.
- Enter a description for the Web App.
- Select "Me" for "Execute as" and "Anyone" for "Who has access".
- Click Deploy and copy the Web app URL after authorization. It will look like
https://script.google.com/macros/s/###/exec. - When modifying the Apps Script code, create a new deployment version to publish changes. More info here
Preparing Gemini CLI
- Install Gemini CLI: Follow the official documentation to install the Gemini CLI on your system. Ref
- Modify
settings.json: Edit thesettings.jsonfile (typically at~/.gemini/settings.jsonon macOS/Linux or%USERPROFILE%\.gemini\settings.jsonon Windows). Add themcpServersconfiguration block:
{
"theme": "Default",
"selectedAuthType": "###",
"mcpServers": {
"gas_web_apps": {
"command": "npx",
"args": [
"mcp-remote",
"https://script.google.com/macros/s/###/exec?accessKey=sample"
],
"env": {}
}
}
}
Replace https://script.google.com/macros/s/###/exec with the Web App URL and ensure the accessKey matches the one in the Google Apps Script.
3. Transfer file content (Added on July 9, 2025):
- ggsrun Setup Guide:
- Download ggsrun from the ggsrun releases page.
- Create a Google Cloud Project at Google Cloud Platform Resource Manager.
- Enable Drive API in the new project.
- Create credentials, configure OAuth Client ID, set the redirect URI to http://localhost:8080, and download the JSON file, renaming it to client_secret.json.
- Authenticate ggsrun by running ggsrun auth and following the prompts.
- Configuring Gemini CLI for ggsrun: Add the following tool definitions to your GEMINI.md file (usually at ~/.gemini/GEMINI.md on macOS/Linux or %USERPROFILE%\.gemini\GEMINI.md on Windows).
# Transferring file content between local PC and Google Drive using ggsrun
* GitHub Repository: [https://github.com/tanaikech/ggsrun](https://github.com/tanaikech/ggsrun)
* To download a file from Google Drive by filename, use this command:
```bash
ggsrun d -f [filename]
- To download a file from Google Drive by file ID, use this command:
ggsrun d -i [fileId] - To upload files from the local PC to the root directory of Google Drive, use this command:
ggsrun u -f "[filename1],[filename2],,," - To upload files from the local PC to a specific directory of Google Drive, use this command:
ggsrun u -p [folderId] -f "[filename1],[filename2],,," - To search for files and folders on Google Drive, use this command:
ggsrun sf -q "[search query of Drive API v3 ([https://developers.google.com/workspace/drive/api/guides/search-shareddrives](https://developers.google.com/workspace/drive/api/guides/search-shareddrives))]" - To search for files and folders on Google Drive, use this command:
ggsrun ls -s [filename]
## 💻 Usage Examples
### Confirm Connected MCP Servers
**Prompt**
```text
> /mcp
Answer
ℹ Configured MCP servers:
🟢 gas_web_apps - Ready (41 tools)
- get_exchange_rate
- get_current_weather
- get_specific_date_weather
- get_current_date_time
- search_schedule_on_Google_Calendar
- create_schedule_to_Google_Calendar
- get_values_from_google_docs
- put_values_into_google_docs
- get_google_doc_object_using_docs_api
- manage_google_docs_using_docs_api
- search_file_in_google_drive
- get_file_from_google_drive
- put_file_to_google_drive
- create_file_to_google_drive
- rename_files_on_google_drive
- move_files_on_google_drive
- convert_mimetype_of_file_on_google_drive
- change_permission_of_file_on_google_drive
- generate_survey_with_google_forms
- generate_quiz_with_google_forms
- get_massages_by_time_from_Gmail
- get_massages_by_search_from_Gmail
- get_attachment_files_from_Gmail
- add_label_to_Gmail
- auto_reply_draft_creation_Gmail
- auto_new_draft_creation_Gmail
- send_mails_Gmail
- remove_mails_Gmail
- get_values_from_google_sheets
- put_values_to_google_sheets
- search_values_from_google_sheets
- get_google_sheet_object_using_sheets_api
- manage_google_sheets_using_sheets_api
- generate_presentation_with_google_slides
- get_google_slides_object_using_slides_api
- manage_google_slides_using_slides_api
- generate_description_on_google_drive
- generate_image_on_google_drive
- summarize_file_on_google_drive
- generate_roadmap_to_google_sheets
- description_web_site
Search Files in Google Drive
Prompt
Search for files with the filename of "sample file" from Google Drive.
Answer
✔ search_file_in_google_drive (gas_web_apps MCP Server) {"query":"name = 'sample file'"}
✦ I found a file named "sample file" on Google Drive. It's a Google Sheet, and here's its link:
https://docs.google.com/spreadsheets/d/###/edit?usp=drivesdk
Show Schedule from Google Calendar
Prompt
Tell me my today's schedule.
Answer
✔ search_schedule_on_Google_Calendar (gas_web_apps MCP Server) {"start":"2025-07-03","end":"2025-07-03"}
✦ Today, July 3, 2025, you have two events:
- 12:00 PM - 1:00 PM: "sample event 1" (Lunch) at Shinagawa Station.
- 7:00 PM - 8:00 PM: "sample event 2" (Dinner) at Osaka Station.
Show Today's Emails
Prompt
Tell me my today's emails from tanaike@hotmail.com.
Answer
✔ get_messages_by_search_from_Gmail (gas_web_apps MCP Server) {"query":"from:tanaike@hotmail.com after:2025/07/03"}
✦ Here are your emails from tanaike@hotmail.com for today:
1. From: Tanaike Kanshi <tanaike@hotmail.com>
Subject: sample mail 2
Body: This is a sample mail of No.2.
2. From: Tanaike Kanshi <tanaike@hotmail.com>
Subject: sample mail 1
Body: This is a sample mail of No.1.
Send an Email
Prompt
I received a souvenir from my friend Tanaike. Create an email to thank him for it. Tanaike's email address is tanaike@hotmail.com.
Answer
✔ auto_new_draft_creation_Gmail (gas_web_apps MCP Server) {"obj":[{"body":"Dear Tanaike,\n\nThank you so much for the wonder…
A draft email was successfully created. The draft ID is "r-###".
✔ send_mails_Gmail (gas_web_apps MCP Server) {"draftIds":["r-###"]}
Message of "Thank you for the souvenir!" was correctly sent.
✦ I have already sent the email to Tanaike thanking him for the souvenir.
Check Weather and Create a Schedule in Google Calendar
Prompt
Check tomorrow's weather conditions at 12 PM around Shinagawa Station and exchange 100 US Dollars for Japanese Yen. Under this condition, will we enjoy eating lunch outside for 1 hour at the retrieved location and that day? Finally, create it as a schedule in Google Calendar.
Answer
✔ GoogleSearch Searching the web for: "latitude and longitude of Shinagawa Station"
Search results for "latitude and longitude of Shinagawa Station" returned.
✔ get_current_date_time (gas_web_apps MCP Server) {"timezone":"Asia/Tokyo"}
The current date and time are "2025-07-03 11:04:42". Timezone is "Asia/Tokyo".
✔ get_exchange_rate (gas_web_apps MCP Server) {"currency_from":"USD","currency_to":"JPY"}
The raw data from the API is {"amount":1.0,"base":"USD","date":"2025-07-02","rates":{"JPY":144.15}}. The detailed result is as follows. The currency rate at latest from "USD" to "JPY" is 144.15.
✔ get_current_weather (gas_web_apps MCP Server) {"date":"2025-07-04 12:00","longitude":139.73917,"latitude":35.62861,"timezo…
Mainly clear, partly cloudy, and overcast
✦ Tomorrow's weather around Shinagawa Station at 12 PM is expected to be mainly clear, partly cloudy, and overcast. The exchange rate for 100 US Dollars is 14415 Japanese Yen (1 USD = 144.15 JPY).
Given the weather conditions, it might be enjoyable to eat lunch outside, but there's a chance of it being overcast.
✔ create_schedule_to_Google_Calendar (gas_web_apps MCP Server) {"description":"Lunch at Shinagawa Station. Weather: Mainly c…
An event was created as Start: 2025-07-04 12:00:00, End: 2025-07-04 13:00:00, Title: Outdoor Lunch at Shinagawa Station, Description: Lunch at Shinagawa Station. Weather: Mainly clear, partly cloudy, and overcast. Exchange rate: 1 USD = 144.15 JPY.
✦ The schedule for an outdoor lunch at Shinagawa Station tomorrow, July 4, 2025, from 12:00 PM to 1:00 PM, has been created in your Google Calendar. The description includes the weather forecast (mainly clear, partly cloudy, and overcast) and the exchange rate (1 USD = 144.15 JPY).
Add Text to an Existing Google Document (or Spreadsheet)
Prompt
Append the following text to the document "sample document 20250703".
<Text>
sample text 1
sample text 2
sample text 3
sample text 4
sample text 5
</Text>
Answer
✔ search_file_in_google_drive (gas_web_apps MCP Server) {"query":"sample document 20250703"}
"isError": true
✔ search_file_in_google_drive (gas_web_apps MCP Server) {"query":"name = 'sample document 20250703'"}
1 files were found.
✔ put_values_into_google_docs (gas_web_apps MCP Server) {"text":"sample text 1\nsample text 2\nsample text 3\nsample text 4\…
Text is appended successfully to Google Docs.
✦ The text has been successfully appended to the document "sample document 20250703".
Create a New Google Document and Add Text
Prompt
Create a new Google Document and put the following text into the Google Document.
<Text>
sample text 1
sample text 2
sample text 3
sample text 4
sample text 5
</Text>
Answer
✔ create_file_to_google_drive (gas_web_apps MCP Server) {"mimeType":"application/vnd.google-apps.document","filename":"New D…
A file was created on the root folder. The file URL is "https://docs.google.com/document/d/###/edit?usp=drivesdk".
✔ put_values_into_google_docs (gas_web_apps MCP Server) {"documentId":"###","text":…
Text is appended successfully to Google Docs.
✦ I have already created a new Google Document named "New Document 2025-07-03" and put the specified text into it.
Generate Presentation
Prompt
Please create a 3 - minute presentation. The title will be "Cooking miso soup". My name is Tanaike. The purpose of the presentation is to explain how to make delicious miso soup.
Answer
✔ generate_presentation_with_google_slides (gas_web_apps MCP Server) {"name":"Tanaike","text":"This presentation will guide …
Presentation was successfully created. The url is "https://docs.google.com/open?id=###".
✦ The presentation "Cooking misosoup" has been created. You can access it at:
https://docs.google.com/open?id=###
Generate a Survey Using Google Forms and Send the URL via Email
Prompt
I want to conduct a survey about favorite Japanese foods. Your mission is as follows:
* Generate a survey using Google Forms.
* Send an email to tanaike@hotmail.com including the published URL of the Google Form.
* The email's subject line should be "Request for a survey about your favorite Japanese foods."
* Create the email's body from the subject.
Answer
✔ generate_survey_with_google_forms (gas_web_apps MCP Server) {"title":"Favorite Japanese Foods Survey","itemList":[{"requir…
The survey was successfully generated as a Google Form. The edit URL and published URL of the form are "https://docs.google.com/forms/d/###/edit" and "https://docs.google.com/forms/d/e/#####/viewform", respectively.
✔ auto_new_draft_creation_Gmail (gas_web_apps MCP Server) {"obj":[{"body":"Request for a survey about your favorite Japanese…
A draft email was successfully created. The draft ID is "r###".
✔ send_mails_Gmail (gas_web_apps MCP Server) {"draftIds":["r###"]}
Message of "Request for a survey about your favorite Japanese foods." was correctly sent.
✦ I have successfully generated the survey and sent the email with the published URL of the Google Form to tanaike@hotmail.com.
Generate a Quiz Using Google Forms
Prompt
Suggest 5 questions and answers for a quiz with multiple - choice questions for learning Google Apps Script for beginners. Generate the quiz in Google Forms using the questions. The number of choices for each question is 5. The title of the quiz is "Learning Google Apps Script".
Answer
✔ generate_quiz_with_google_forms (gas_web_apps MCP Server) {"title":"Learning Google Apps Script","itemList":[{"required":t…
The quiz was successfully generated as a Google Form. The edit URL and published URL of the form are "https://docs.google.com/forms/d/###/edit" and "https://docs.google.com/forms/d/e/#####/viewform", respectively.
✦ The quiz "Learning Google Apps Script" has been generated in Google Forms.
* Edit URL: https://docs.google.com/forms/d/###/edit
* Published URL: https://docs.google.com/forms/d/e/#####/viewform
Download an image from Google Drive
Prompt
Download the file "sample.png" from Google Drive using ggsrun.
Answer
✔ Shell ggsrun d -f sample.png (Download "sample.png" from Google Drive.)
{"id":"###","name":"sample.png",,,
✦ The file "sample.png" has been downloaded.
Download an image file from a website and upload it to Google Drive
Prompt
The image at https://www.gstatic.com/marketing-cms/assets/images/7e/a4/253561a944f4a8f5e6dec4f5f26f/gemini.webp=s96-fcrop64=1,00000000ffffffff-rw is the Gemini icon from the official brand resource center. Ref
Download an image from the URL "https://www.gstatic.com/marketing-cms/assets/images/7e/a4/253561a944f4a8f5e6dec4f5f26f/gemini.webp=s96-fcrop64=1,00000000ffffffff-rw" and upload it to Google Drive using ggsrun.
Answer
✔ Shell wget -O /home/adsam/temp/workspace/gemini.webp "https://www.gstatic.com/marketing-cms/assets/images/7e/a4/253561a944…
✔ Shell ggsrun u -f "gemini.webp" (Upload the downloaded image to Google Drive using ggsrun.)
Error: Extension of '.webp' cannot be uploaded.
✔ Shell convert /home/adsam/temp/workspace/gemini.webp /home/adsam/temp/workspace/gemini.png (Convert the downloaded .webp image...)
✔ Shell ggsrun u -f "gemini.png" (Upload the converted .png image to Google Drive using ggsrun.)
{"upload_file_name":["gemini.png"],"uploaded_files":[{"id":"###","name":"gemini.png","mimeType":"image/png",,,
✦ The image has been successfully downloaded from the URL, converted to PNG format, and uploaded to Google Drive.
Upload a file to Google Drive and rename it
Prompt
Upload the file "sample.png" to Google Drive using ggsrun with the filename "test.png". And, show the file ID of the uploaded file.
Answer
✔ Shell ggsrun u -f "sample.png:test.png" (Attempt to upload "sample.png" to Google Drive as "test.png"...)
Error: open sample.png:test.png: no such file or directory.
✔ Shell ggsrun u -f "sample.png" (Upload "sample.png" to Google Drive.)
{"upload_file_name":["sample.png"],"uploaded_files":[{"id":"###","name":"sample.png",,,
✔ rename_files_on_google_drive (gas_web_apps MCP Server) {"fileList":[{"fileId":"###","newName…
FileId: "###". Renamed successfully from "sample.png" to "test.png".
✦ The file "sample.png" has been uploaded to Google Drive and renamed to "test.png". The file ID of the uploaded file is ###.
Upload a file to Google Drive and send it as an email attachment
Prompt
Upload the file "sample.png" using ggsrun, create a draft email with the uploaded file as an attachment, and send the email to "tanaike@hotmail.com".
Answer
✔ Shell ggsrun u -f "sample.png" (Uploads "sample.png" to Google Drive.)
{"upload_file_name":["sample.png"],"uploaded_files":[{"id":"###","name":"sample.png",,,
✔ auto_new_draft_creation_Gmail (gas_web_apps MCP Server) {"obj":[{"to":"tanaike@hotmail.com","attachmentFiles":["###…
A draft email was successfully created. The draft ID is "r###".
✔ send_mails_Gmail (gas_web_apps MCP Server) {"draftIds":["r###"]}
Message of "Uploaded File: sample.png" was correctly sent.
✦ I have uploaded the file "sample.png", created a draft email with the uploaded file as an attachment, and sent the email to "tanaike@hotmail.com".
Move a file in Google Drive
Prompt
Move the file "sample.png" to the folder "temp_folder" on Google Drive.
Answer
✔ search_file_in_google_drive (gas_web_apps MCP Server) {"query":"name = 'sample.png'"}
1 files were found.
The list of found files is returned in the "FileList" JSON array.
✔ search_file_in_google_drive (gas_web_apps MCP Server) {"query":"name = 'temp_folder' and mimeType = 'application/vnd.googl…
1 files were found.
The list of found files is returned in the "FileList" JSON array.
✔ move_files_on_google_drive (gas_web_apps MCP Server) {"fileList":[{"dstId":"###","srcId":"1j…
File "sample.png" was moved to the folder "temp_folder".
✦ I have moved the file "sample.png" to the folder "temp_folder" on Google Drive.
Upload a PDF file to Google Drive and add a description
Prompt
Upload the PDF file PhysRev.48.73.pdf to Google Drive using ggsrun and set the description for the file.
Answer
✔ Shell ggsrun u -f "PhysRev.48.73.pdf" (Uploads the PDF file "PhysRev.48.73.pdf" to Google Drive.)
{"upload_file_name":["PhysRev.48.73.pdf"],"uploaded_files":[{"id":"###",,,
✔ generate_description_on_google_drive (gas_web_apps MCP Server) {"fileId":"###"}
The created description is "This file is a scientific paper titled "The Particle Problem in the General Theory of Relativity" authored by A. Einstein and N. Rosen, published in Physical Review, Volume 48, pages 73 - 77, on July 1, 1935...
✦ The PDF file PhysRev.48.73.pdf has been uploaded to Google Drive and its description has been set.
Generate an image
Prompt
Generate an image of orange juice being poured into a glass, and download it.
Answer
✔ generate_image_on_google_drive (gas_web_apps MCP Server) {"prompt":"orange juice is poured into a glass"}
An image was successfully generated from a prompt "orange juice is poured into a glass" as a file on Google Drive. The file URL and ID are "https://drive.google.com/file/d/###/view?usp=drivesdk" and "###", respectively.
✔ Shell ggsrun d -i ### -o "orange juice is poured into a glass" (Downloads the generated image...)
{"id":"###","name":"orange juice is poured into a glass",,,,
✦ The image "orange juice is poured into a glass" has been generated and downloaded to your current directory.
Describe a website
Prompt
Describe the website "https://tanaikech.github.io/about/".
Answer
✔ description_web_site (gas_web_apps MCP Server) {"urls":["https://tanaikech.github.io/about/"]}
The website "About · tanaike" belongs to a Japanese scientist with a Ph.D. in Physics, who is also a Google Developer Expert (GDE) in Google Workspace and a Google Cloud Champion Innovator. The individual focuses on creating novel solutions, with some inventions finding practical applications in various industries such as electronics, industrial machinery, architecture, and aerospace. The site provides contact information, including a developer profile, and links to their posts on the Google Cloud Blog, Medium, and Zenn. It also lists their activities on platforms like GitHub, Gists, Qiita, Stack Overflow, and X, showcasing applications, tips, and summaries of Google Apps Script related repositories. The site also includes information about donations via PayPal.Me.
✦ The website "About · tanaike" describes a Japanese scientist with a Ph.D. in Physics, who is also a Google Developer Expert (GDE) in Google Workspace and a Google Cloud Champion Innovator. The individual focuses on creating novel solutions, with some inventions finding practical applications in various industries. The site provides contact information and links to their posts on various platforms like Google Cloud Blog, Medium, Zenn, GitHub, and Stack Overflow, showcasing applications, tips, and summaries of Google Apps Script related repositories.
Describe a PDF file on the local PC
Prompt
Upload the PDF file PhysRev.48.73.pdf to Google Drive using ggsrun and return a summary of the PDF file within 100 words.
Answer
✔ Shell ggsrun u -f "PhysRev.48.73.pdf" (Uploads the PDF file to Google Drive.)
{"upload_file_name":["PhysRev.48.73.pdf"],"uploaded_files":[{"id":"###",,,
✔ summarize_file_on_google_drive (gas_web_apps MCP Server) {"prompt":"Summarize this PDF file within 100 words.","fileId":"1…
Einstein and Rosen investigate the particle problem in general relativity, aiming to describe elementary particles without singularities. They propose a slight modification to the gravitational equations, allowing for regular solutions. In this framework, particles are represented as "bridges" connecting two identical "sheets" of space. This approach provides a singularity - free description for neutral and charged particles. The most natural charged particle in this model is found to have zero gravitational mass. The theory offers a unified, consistent view using only gravitational and electromagnetic fields, explaining the atomistic nature of matter and the absence of negative neutral mass.
✦ The PDF file "PhysRev.48.73.pdf" has been uploaded to Google Drive and summarized as follows:
"Einstein and Rosen investigate the particle problem in general relativity, aiming to describe elementary particles without singularities. They propose a slight modification to the gravitational equations, allowing for regular solutions. In this framework, particles are represented as 'bridges' connecting two identical 'sheets' of space. This approach provides a singularity - free description for neutral and charged particles. The most natural charged particle in this model is found to have zero gravitational mass. The theory offers a unified, consistent view using only gravitational and electromagnetic fields, explaining the atomistic nature of matter and the absence of negative neutral mass."
Generate a roadmap and download it as a PDF file
Prompt
I want to cook miso soup. To achieve this goal, create a new Google Spreadsheet, generate a roadmap for cooking miso soup in the spreadsheet, and download it as a PDF file using ggsrun.
Answer
✔ create_file_to_google_drive (gas_web_apps MCP Server) {"filename":"Miso Soup Roadmap","mimeType":"application/vnd.google-a…
A file was created on the root folder. The file URL is "https://docs.google.com/spreadsheets/d/###/edit?usp=drivesdk".
✔ generate_roadmap_to_google_sheets (gas_web_apps MCP Server) {"spreadsheetId":"###…
Roadmap was successfully generated in Google Sheets. The spreadsheet ID and the sheet name are "###" and "Sheet1" (sheet ID: "0"), respectively. The URL is "https://docs.google.com/spreadsheets/d/###/edit". The file ID of the converted PDF file is "###".
✦ I can run ggsrun d -i ###. This will download the PDF file of the miso soup roadmap from Google Drive to your local machine.
✔ Shell ggsrun d -i ### (Download the generated PDF roadmap from Google Drive.)
✦ I have successfully created the Google Spreadsheet, generated the roadmap for cooking miso soup, and downloaded it as a PDF file named Cook Miso Soup.pdf.
Generate presentation based on a web site and send it as an email
Prompt
Describe the Web site of "https://blog.google/technology/developers/introducing-gemini-cli-open-source-ai-agent/", and think of a title and create a new Google Document and put the generated description into the document by giving the title. And, generate a presentation of Google Slides using the title and document. And, create an email including the URL of the presentation and send it to "tanaike@hotmail.com".
Answer
✔ description_web_site (gas_web_apps MCP Server) {"urls":["https://blog.google/technology/developers/introducing-gemini-cli-…
The site describes the introduction of Gemini CLI, an open - source AI agent that integrates Gemini directly into
developers' terminals. This tool offers free access to Gemini 2.5 Pro for individual Google account holders,
with high usage limits for model requests. Gemini CLI aims to enhance the command - line experience by enabling
coding, problem - solving, content generation, and task management using natural language. It shares technology
with Gemini Code Assist, providing AI assistance in both the terminal and VS Code. The article highlights
Gemini CLI's open and extensible nature, encouraging community contributions.
✔ create_file_to_google_drive (gas_web_apps MCP Server) {"mimeType":"application/vnd.google-apps.document","filename":"Intro…
A file was created on the root folder. The file URL is "https://docs.google.com/document/d/###/edit?usp=drivesdk".
✔ put_values_into_google_docs (gas_web_apps MCP Server) {"text":"The site describes the introduction of Gemini CLI, an open-…
Text is appended successfully to Google Docs.
✔ generate_presentation_with_google_slides (gas_web_apps MCP Server) {"name":"Kanshi Tanaike","title":"Introducing Gemini CL…
Presentation was successfully created. The url is "https://docs.google.com/open?id=###".
✔ auto_new_draft_creation_Gmail (gas_web_apps MCP Server) {"obj":[{"body":"Here is the presentation on Introducing Gemini CL…
A draft email was successfully created. The draft ID is "r-###".
✔ send_mails_Gmail (gas_web_apps MCP Server) {"draftIds":["r-###"]}
Message of "Presentation: Introducing Gemini CLI: An Open - Source AI Agent" was correctly sent.
✦ I have successfully described the website, created a Google Document with the description and a title, generated a Google Slides presentation, and sent an email with the presentation URL to "tanaike@hotmail.com".
Generate presentation based on a web site and send it as an email (July 10, 2025)
Prompt
Create a new Google Document and send an email to tanaike@hotmail.com that includes the document. Grant the user edit permission for the Google Document.
Answer
✔ create_file_to_google_drive (gas_web_apps MCP Server) {"filename":"New Google Document","mimeType":"application/vnd.google…
A file was created on the root folder. The file URL is "https://docs.google.com/document/d/###/edit?usp=drivesdk".
✔ change_permission_of_file_on_google_drive (gas_web_apps MCP Server) {"role":"editor","fileId":"###…
Permission for the file 'New Google Document' (ID: ###) was successfully updated. User 'tanaike@hotmail.com' has been granted 'editor' access.
✔ auto_new_draft_creation_Gmail (gas_web_apps MCP Server) {"obj":[{"title":"New Google Document","to":"tanaike@hotmail.com",…
A draft email was successfully created. The draft ID is "r###".
✔ send_mails_Gmail (gas_web_apps MCP Server) {"draftIds":["r###"]}
Message of "New Google Document" was correctly sent.
✦ I have created a new Google Document, granted edit permission to tanaike@hotmail.com, and sent an email to them with the
document link.
📚 Documentation
The above examples demonstrate that combining the Gemini CLI with an MCP server built using Google Apps Script Web Apps enables powerful automation across Google Workspace. By leveraging Google Apps Script's inherent authorization capabilities, we can easily give Gemini access to Gmail, Calendar, Drive, Docs, Sheets, and Slides.
The samples provided are just a small subset of what's possible. The ToolsForMCPServer library includes many functions derived from previously developed Google Apps Script utilities. Developers can also add their own custom tools to the MCP server.
🔧 Technical Details
Add custom tools
You can add custom tools to the MCP server using the following script:
/**
* If you want to add your custom tools, please use the following script.
* This is a simple sample. Please modify the following script to your situation.
*/
function getCustomTools() {
const functions = {
params_: {
function_name1: {
description: "###",
parameters: {}
},
function_name2: {
description: "###",
parameters: {}
}
},
function_name1: (object) => { },
function_name2: (object) => { },
};
// for MCP
const itemsForMCP = [
{
"type": "initialize",
"value": {
"protocolVersion": "2024-11-05", // or "2025-03-26"
"capabilities": { "tools": { "listChanged": false } },
"serverInfo": { "name": "gas_web_apps", "version": "1.0.0" }
}
},
...Object.keys(functions.params_).map(f => (
{
"type": "tools/list",
"function": functions[f],
"value": {
name: f,
description: functions.params_[f].description,
inputSchema: functions.params_[f].parameters,
}
}))
];
// return itemsForMCP;
return itemsForMCP;
}
const apiKey = "###"; // API key for Gemini API
/**
* This function is automatically run when the MCP client accesses Web Apps.
*/
const doPost = e => main(e);
function main(eventObject) {
const m = ToolsForMCPServer;
m.apiKey = apiKey;
const object = { eventObject, items: [...m.getTools(), ...getCustomTools()] };
return new MCPApp
.mcpApp({ accessKey: "sample" })
.setServices({ lock: LockService.getScriptLock() })
.server(object);
}
📄 License
MIT
Author
Update History
- v1.0.0 (July 3, 2025)
- Initial release.
- v1.0.1 (July 9, 2025)
- The method name of
getServerwas changed togetTools. But,getServercan still be used. - New methods were added for Gmail, Google Drive management, and using Gemini.
- Added sample prompts and answers in README.md.
- The method name of
- v1.0.2 (July 10, 2025)
- Added a tool
change_permission_of_file_on_google_drive.
- Added a tool
- v1.0.3 (July 11, 2025)
- Updated a tool
get_current_weatherand added a new toolget_specific_date_weather.
- Updated a tool
- v1.0.4 (July 11, 2025)
- Updated a function
getSheet_.
- Updated a function
- v1.0.5 (July 16, 2025)
- Added a new tool
search_values_from_google_sheets.
- Added a new tool
- v1.0.6 (July 17, 2025)
- Added 6 new tools for managing Google Docs, Sheets, and Slides.
- v1.0.7 (July 19, 2025)
- Added a
getToolListmethod and enabled tool filtering.
- Added a
- v1.0.8 (July 23, 2025)
- Updated ToolsForMCPServer for Gemini CLI v0.1.13, removing
oneOffrom tool schemas and generating request bodies on the MCP server side.
- Updated ToolsForMCPServer for Gemini CLI v0.1.13, removing
TOP
Alternatives









