SkillAgentSearch skills...

ToolsForMCPServer

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.

Install / Use

/learn @tanaikech/ToolsForMCPServer
About this skill

Quality Score

0/100

Supported Platforms

Zed
Gemini CLI
Claude Code
Cursor

README

MseeP.ai Security Assessment Badge

Now, ToolsForMCPServer can be used as a Gemini extension. You can see how to install it at https://github.com/tanaikech/ToolsForMCPServer-extension.

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.

<a name="top"></a> MIT License

<a name="abstract"></a>

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.

/mcp desc

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:
  3. Install 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.

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; // This is an API key for using Gemini API.
  // m.model = "models/gemini-2.5-flash"; // If you change model, use this.
  // m.defaultCalendarId = "###"; // If you want to use the specific calendar, please use this.
  // m.enableBaseTools = false; // Disable base tools
  // m.enableClassroomTools = false; // Disable tools for managing Google Classroom
  // m.enablePeopleTools = false; // Disable tools for managing Google People
  // m.enableAnalyticsTools = false; // Disable tools for managing Google Analytics
  // m.enableMapsTools = false; // Disable tools for managing Google Maps
  // m.enableFileSearch = false; // Disable tools for managing File Search

  const object = { eventObject, items: m.getTools() };
  return new MCPApp.mcpApp({ accessKey: "sample" })
    .setServices({ lock: LockService.getScriptLock() })
    .server(object);
}

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.
  • If you want to use the specific Google Calendar, please set defaultCalendarId.

APIs

  • If an error related to Drive API occurred, please enable Drive API at Advanced Google services.
  • If you want to manage Docs, Sheets, Slides, and Calendars using the batch update methods of API, please enable Docs API, Sheets API, Slides API, and Calendar API at Advanced Google services.
  • If you want to manage Google Classroom and Google People, please enable the Google Classroom API and the Google People API at Advanced Google services.
  • If you want to retrieve the drive activity, please enable Drive Activity API at Advanced Google services.
  • If you want to use Google Analytics, please enable Google Analytics Admin API and Google Analytics Data API at Advanced Google services.

Show all tools

When this script is run, all tools in this library are shown as a JSON object.

function showAlltools() {
  const res = ToolsForMCPServer.getToolList();
  console.log(res);
}

Filter tools

When you want to use the specific tools, you can also use the following script.

This script uses 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);
}

This script uses 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);
}

4. Deploy Web Apps

To allow the Gemini CLI to communicate with our script, we must deploy it as a Web App. This creates a unique URL that acts as our MCP server endpoint.

You can find detailed information in the official documentation.

Please follow these steps to deploy the Web App in the script editor:

  1. In the script editor, at the top right, click Deploy -> New deployment.
  2. Click Select type -> Web App.
  3. Enter a description for the Web App in the fields under Deployment configuration.
  4. Select "Me" for "Execute as". This is crucial, as it allows the script to run with your permissions to access your Google services.
  5. Select "Anyone" for "Who has access". This makes the URL callable from the internet. Access is controlled by the unguessable URL and the accessKey defined in the script.
  6. Click Deploy.
  7. After authorizing the necessary scopes, copy the
View on GitHub
GitHub Stars99
CategoryDevelopment
Updated9d ago
Forks21

Languages

JavaScript

Security Score

100/100

Audited on Mar 25, 2026

No findings