Now, ToolsForMCPServer can be used as a Gemini extension. You can see how to ins
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
Gemini CLI with MCP Server: Expanding Possibilities with Google Apps Script
The Gemini CLI confirmed that the MCP server built with Google Apps Script (GAS), a low-code platform, offers immense possibilities. If you've created snippets for GAS, these could be revitalized and/or leveraged in new ways by using them as the MCP server. The Gemini CLI and other MCP clients will be useful in achieving this.
Abstract
The Gemini CLI provides a powerful command-line interface for interacting with Google's Gemini models. By leveraging the Model Context Protocol (MCP), the CLI can be extended with custom tools. This report explores the integration of the Gemini CLI with an MCP server built using Google Apps Script Web Apps. We demonstrate how this combination simplifies authorization for Google Workspace APIs (Gmail, Drive, Calendar, etc.), allowing Gemini to execute complex, multi-step tasks directly within the Google ecosystem. We provide setup instructions and several practical examples showcasing how this integration unlocks significant potential for automation and productivity enhancement.
Introduction
Recently, I published a report titled "Gemini CLI with MCP Server Built by Web Apps of Google Apps Script" (Ref). This initial report highlighted how a Model Context Protocol (MCP) server, developed using Google Apps Script Web Apps, can be integrated with the Gemini CLI.
One of the key advantages of using Google Apps Script is its ability to provide seamless authorization for Google APIs, particularly those within Google Workspace. This significantly reduces the development overhead associated with building applications that interact with Google Workspace services.
Building upon that foundation, this report aims to explore the expanded possibilities when combining the Gemini CLI with an MCP server powered by Google Apps Script Web Apps. We will delve into how this powerful combination facilitates the integration of various tools and services, unlocking an infinite range of potential applications for enhanced productivity and automation within the Google ecosystem.
Current tools
In the current stage (November 14, 2025), the following 160 tools are provided by ToolsForMCPServer for the MCP server.
You can see the descriptions of all tools with the following command on Gemini CLI.
The next section details deploying the MCP server using Google Apps Script and configuring the Gemini CLI to use it.
Preparing the MCP Server
1. Create a Google Apps Script Project
First, create a new standalone Google Apps Script project. A standalone project is not bound to a specific Google Sheet, Doc, or Form, making it ideal for creating a general-purpose web service. You can create one by visiting script.google.com. Ref
2. Install Libraries
To simplify building the MCP server, we will use pre-built Google Apps Script libraries. These encapsulate the complex MCP handling logic and provide ready-to-use tools, keeping the main script clean.
This sample uses two Google Apps Script libraries:
1. **MCPApp**: Manages the MCP server lifecycle and communication protocols.
2. **ToolsForMCPServer**: Provides a suite of pre-built tools for interacting with Google Workspace services (Gmail, Drive, Calendar, etc.).
Library Project Keys and Installation
1. Open the script editor of the project you just created.
2. **Install MCPApp**:
- Installation Guide
- Project Key: 1TlX_L9COAriBlAYvrMLiRFQ5WVf1n0jChB6zHamq2TNwuSbVlI5sBUzh
- Identifier: MCPApp
- Repository: https://github.com/tanaikech/MCPApp
3. **Install ToolsForMCPServer**:
- Installation Guide
- Project Key: 1lnE7UL1jQgPDbTB9yjhiwZM0SaS9MObhzvWUWb_t8FisO6A3bLepvM2j
- Identifier: ToolsForMCPServer
- Repository: https://github.com/tanaikech/ToolsForMCPServer
3. Script
Please copy and paste the following script into the script editor (replacing any existing code) and save the project.
This is a basic script for using this library.
**Note:**
- If you intend to use the following tools, you must uncomment the apiKey line in the script and provide a valid API key for the Gemini API.
- generate_roadmap_to_google_sheets: Creates a roadmap in Google Sheets.
- generate_description_on_google_drive: Generates and sets a description for a file on Google Drive.
- generate_image_on_google_drive: Generates an image from a prompt and saves it to Google Drive.
- summarize_file_on_google_drive: Summarizes a file stored on Google Drive.
- description_web_site: Provides descriptions of websites given their URLs.