ToolsForMCPServer 标志

ToolsForMCPServer

社区
tanaikech

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.

发布者tanaikech
代码仓库ToolsForMCPServer
语言JavaScript
复刻数
21
星标数
106
可用工具
0
传输类型stdio
分类
许可协议MIT
链接
  • 将工具接入 AI 工作流

    ToolsForMCPServer 提供 MCP 功能,可供兼容的 AI 客户端和智能体使用。

  • 0 个可用工具

    浏览下方可调用的操作;如果服务器提供了名称和描述,也会一并显示。

  • 可直接复制的配置

    使用安装配置片段,在您首选的 MCP 客户端中配置此服务器。

  • 开源社区热度

    关联的代码仓库有 106 个 Star 和 21 个 Fork。

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.

MIT License

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.

javascript
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.

javascript
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.

javascript
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.

javascript
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 Web app URL. It will look similar to https://script.google.com/macros/s/###/exec. This is your MCP server endpoint.

Important: When you modify the Apps Script code, you must create a new deployment version to publish the changes. Click Deploy > Manage deployments, select your active deployment, click the pencil icon, and choose "New version" from the Version dropdown. More info here.

Preparing Gemini CLI

1. Install Gemini CLI

Follow the official documentation to install the Gemini CLI on your system. Ref

There are 2 patterns for using this MCP server using Gemini CLI and other AI agents as follows.

2A. Pattern 1

In this pattern, Gemini CLI is directly connected to the MCP server built by Google Apps Script Web Apps.

To connect the Gemini CLI to your new Apps Script server, you need to edit its settings file settings.json. This file is typically located at ~/.gemini/settings.json on macOS/Linux or %USERPROFILE%\.gemini\settings.json on Windows.

Add the mcpServers configuration block as shown below.

  1. Replace https://script.google.com/macros/s/###/exec with the Web App URL you copied earlier.
  2. Ensure the accessKey query parameter matches the accessKey you defined in your Google Apps Script (sample in this example).
json
{
  "theme": "Default",
  "selectedAuthType": "gemini-api-key",
  "mcpServers": {
    "gas_web_apps": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "https://script.google.com/macros/s/###/exec?accessKey=sample"
      ],
      "env": {}
    }
  },
  "disableAutoUpdate": true
}

or

json
{
  "theme": "Default",
  "selectedAuthType": "###",
  "mcpServers": {
    "gas_web_apps": {
      "httpUrl": "https://script.google.com/macros/s/###/exec?accessKey=sample",
      "description": "MCP server built by Google Apps Script Web Apps"
    }
  }
}
  • "gas_web_apps": A local identifier for your server.

  • "httpUrl": Your Web Apps URL. In the current stage, when this is used, an error might occur. At that time, use mcp-remote.

  • If you use mcp-remote, please install it. Ref

  • If an error like Request timed out occurs, please add timeout and use GEMINI_TIMEOUT as follows.

    json
    {
      "theme": "Default",
      "selectedAuthType": "gemini-api-key",
      "mcpServers": {
        "gas_web_apps": {
          "command": "npx",
          "args": [
            "mcp-remote",
            "https://script.google.com/macros/s/###/exec?accessKey=sample"
          ],
          "env": {},
          "timeout": 300000
        }
      },
      "disableAutoUpdate": true
    }
    GEMINI_TIMEOUT=300 # Seconds

2B. [NEW] Pattern 2 (Added on October 15, 2025)

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

3. Transfer file content (Added on July 9, 2025)

Recently, I published a report titled "Processing File Content Using Gemini CLI with an MCP Server Built by Google Apps Script" Ref. In this report, I concluded that using the Drive API in the background is more effective for transferring file content between Gemini CLI and Google Drive than embedding base64 data directly in the prompt. Therefore, to facilitate this effective transfer, I use ggsrun, a CLI tool.

3.1. ggsrun Setup Guide

To use this method, you first need to set up ggsrun.

  1. Download ggsrun: Get the latest release from the ggsrun releases page. The main repository is here.
  2. Create a Google Cloud Project: Go to the Google Cloud Platform Resource Manager and click CREATE PROJECT.
  3. Enable Drive API: In your new project, navigate to APIs & Services > Enabled APIs & Services. Search for and enable the Drive API.
  4. Create Credentials: Navigate to APIs & Services > Credentials.
  5. Configure OAuth Client ID: Click Create credentials, select OAuth client ID, and choose Web Application.
  6. Set Redirect URI: Under "Authorized redirect URIs," add http://localhost:8080.
  7. Create and Download Credentials: Click Create, then Download JSON. Important: Rename the downloaded file to client_secret.json and place it in your working directory.
  8. Authenticate ggsrun:

8-1. Open your terminal in the directory containing client_secret.json.

8-2. Run the command ggsrun auth.

8-3. Copy the URL displayed in the terminal, paste it into your browser, and authorize the requested scopes.

8-4. Copy the authorization code from your browser's address bar and paste it back into the terminal.

To verify the setup, run ggsrun di to display information about your Google Drive.

3.2. Configuring Gemini CLI for ggsrun

To enable the Gemini CLI to use ggsrun, add the following tool definitions to your GEMINI.md file. This file is typically located at ~/.gemini/GEMINI.md on macOS/Linux or %USERPROFILE%\.gemini\GEMINI.md on Windows.

text
# 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:
  ```bash
  ggsrun d -i [fileId]
  ```
* To download a file from Google Drive by a file ID by converting mimeType, use this command:
  ```bash
  ggsrun d -i [fileId] -e [extension]
  ```
  [extension] is the file extension. For example, when you want to download the file in PDF format and TEXT format, use "pdf" and "txt", respectively.
* To upload files from the local PC to the root directory of Google Drive, use this command:
  ```bash
  ggsrun u -f "[filename1],[filename2],,,"
  ```
* To upload files from the local PC to a specific directory of Google Drive, use this command:
  ```bash
  ggsrun u -p [folderId] -f "[filename1],[filename2],,,"
  ```
* To search for files and folders on Google Drive, use this command:
  ```bash
  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:
  ```bash
  ggsrun ls -s [filename]
  ```

Sandbox

Have you ever faced a task that isn’t part of your routine but is tedious to do manually, like, ‘I need to add a “[For Review]” prefix to the titles of all Google Docs in a specific folder this afternoon’? Or perhaps you’ve thought, ‘I want to use AI to work with my spreadsheets, but I’m concerned about the security implications of granting a tool full access to my Google Drive’? At that time, I can recommend using "fake-sandbox". You can see the following articles.

Sample Prompts and Answers

The following examples demonstrate how the Gemini CLI uses the Google Apps Script MCP server to interact with various Google services.

Confirm Connected MCP Servers

This command lists all configured MCP servers and the tools they provide.

Prompt

text
> /mcp

When your setting is correct, the following result is returned.

Answer

text
ℹConfigured MCP servers:

  🟢 wrapped_gas_web_apps - Ready (149 tools, 3 prompts)
    Tools:
    - add_label_to_Gmail
    - analytics_admin_accountSummaries_list
    - analytics_admin_properties_get
    - analytics_data_properties_runRealtimeReport
    - analytics_data_properties_runReport
    - auto_new_draft_creation_Gmail
    - auto_reply_draft_creation_Gmail
    - change_permission_of_file_on_google_drive
    - classroom_courses_aliases_create
    - classroom_courses_aliases_delete
    - classroom_courses_aliases_list
    - classroom_courses_announcements_create
    - classroom_courses_announcements_delete
    - classroom_courses_announcements_get
    - classroom_courses_announcements_list
    - classroom_courses_announcements_modifyAssignees
    - classroom_courses_announcements_patch
    - classroom_courses_courseWork_create
    - classroom_courses_courseWork_delete
    - classroom_courses_courseWork_get
    - classroom_courses_courseWork_list
    - classroom_courses_courseWork_modifyAssignees
    - classroom_courses_courseWork_patch
    - classroom_courses_courseWork_rubrics_create
    - classroom_courses_courseWork_rubrics_delete
    - classroom_courses_courseWork_rubrics_get
    - classroom_courses_courseWork_rubrics_list
    - classroom_courses_courseWork_rubrics_patch
    - classroom_courses_courseWork_studentSubmissions_get
    - classroom_courses_courseWork_studentSubmissions_list
    - classroom_courses_courseWork_studentSubmissions_patch
    - classroom_courses_courseWork_studentSubmissions_reclaim
    - classroom_courses_courseWork_studentSubmissions_return
    - classroom_courses_courseWork_studentSubmissions_turnIn
    - classroom_courses_courseWorkMaterials_create
    - classroom_courses_courseWorkMaterials_delete
    - classroom_courses_courseWorkMaterials_get
    - classroom_courses_courseWorkMaterials_list
    - classroom_courses_courseWorkMaterials_patch
    - classroom_courses_create
    - classroom_courses_get
    - classroom_courses_getGradingPeriodSettings
    - classroom_courses_list
    - classroom_courses_patch
    - classroom_courses_remove
    - classroom_courses_students_create
    - classroom_courses_students_delete
    - classroom_courses_students_get
    - classroom_courses_students_list
    - classroom_courses_teachers_create
    - classroom_courses_teachers_delete
    - classroom_courses_teachers_get
    - classroom_courses_teachers_list
    - classroom_courses_topics_create
    - classroom_courses_topics_delete
    - classroom_courses_topics_get
    - classroom_courses_topics_list
    - classroom_courses_topics_patch
    - classroom_courses_update
    - classroom_courses_updateGradingPeriodSettings
    - classroom_invitations_accept
    - classroom_invitations_create
    - classroom_invitations_get
    - classroom_invitations_list
    - classroom_invitations_remove
    - classroom_registrations_create
    - classroom_registrations_delete
    - classroom_userProfiles_get
    - classroom_userProfiles_guardianInvitations_create
    - classroom_userProfiles_guardianInvitations_get
    - classroom_userProfiles_guardianInvitations_list
    - classroom_userProfiles_guardianInvitations_patch
    - classroom_userProfiles_guardians_get
    - classroom_userProfiles_guardians_list
    - classroom_userProfiles_guardians_remove
    - comments_drive_api_list
    - comments_drive_api_remove
    - convert_mimetype_of_file_on_google_drive
    - create_chart_on_google_sheets
    - create_charts_as_image_on_google_sheets
    - create_document_body_in_google_docs
    - create_file_to_google_drive
    - create_google_docs_from_markdown_on_google_drive
    - create_schedule_on_Google_Calendar
    - delete_schedules_on_Google_Calendar
    - description_video_on_youtube
    - description_web_site
    - drive_activity_api_query
    - explanation_analytics_data_properties_runRealtimeReport
    - explanation_analytics_data_properties_runReport
    - explanation_create_chart_by_google_sheets_api
    - explanation_create_maps_url
    - explanation_generate_quiz_with_google_forms
    - explanation_generate_survey_with_google_forms
    - explanation_google_apps_script_library_list
    - explanation_manage_google_docs_using_docs_api
    - explanation_manage_google_sheets_using_sheets_api
    - explanation_manage_google_slides_using_slides_api
    - explanation_reference_export_google_sheets_as_pdf
    - explanation_reference_generate_google_apps_script
    - explanation_search_file_in_google_drive
    - generate_description_on_google_drive
    - generate_image_on_google_drive
    - generate_presentation_with_google_slides
    - generate_quiz_with_google_forms
    - generate_roadmap_to_google_sheets
    - generate_survey_with_google_forms
    - get_attachment_files_from_Gmail
    - get_charts_on_google_sheets
    - get_current_date_time
    - get_current_weather
    - get_exchange_rate
    - get_file_from_google_drive
    - get_google_doc_object_using_docs_api
    - get_google_sheet_object_using_sheets_api
    - get_google_slides_object_using_slides_api
    - get_massages_by_search_from_Gmail
    - get_massages_by_time_from_Gmail
    - get_specific_date_weather
    - get_values_from_google_docs
    - get_values_from_google_sheets
    - manage_google_docs_using_docs_api
    - manage_google_sheets_using_sheets_api
    - manage_google_slides_using_slides_api
    - maps_convert_lat_lon_to_location
    - maps_convert_location_to_lat_lon
    - maps_create_map
    - maps_get_route
    - move_files_on_google_drive
    - people_connections_list
    - people_contactGroups_list
    - people_otherContacts_list
    - people_otherContacts_search
    - people_people_getBatchGet
    - publicly_share_file_on_google_drive
    - put_file_to_google_drive
    - put_values_into_google_docs
    - put_values_to_google_sheets
    - remove_files_on_google_drive
    - remove_mails_Gmail
    - rename_files_on_google_drive
    - revisions_drive_api_list
    - search_file_in_google_drive
    - search_schedule_on_Google_Calendar
    - search_values_from_google_sheets
    - send_mails_Gmail
    - summarize_file_on_google_drive
    - update_chart_on_google_sheets
    - update_schedule_on_Google_Calendar

    Prompts:
    - generate_roadmap
    - get_weather
    - search_files_on_google_drive

Sample prompts

Sample prompts using ToolsForMCPServer


Summary

The examples above 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 represent only a small subset of what is possible. The ToolsForMCPServer library includes many functions derived from previously developed Google Apps Script utilities. Furthermore, because the MCP server is simply a Google Apps Script project, developers can easily incorporate their own existing GAS snippets as new tools for the Gemini CLI. As this MCP server is updated with more tools, the potential for complex, AI-driven automation within the Google ecosystem becomes nearly limitless.

Appendix

What should we do in this situation?

  • When Gemini CLI is launched and an error Error connecting to MCP server 'gas_web_apps': Connection failed for 'gas_web_apps': MCP error -32000: Connection closed occurs, please redeploy Web Apps to reflect the latest script and try it again.

Add custom tools and prompts

You might want to add your custom tools and promts to the MCP server. At that time, please refer to the following script.

If you are required to add only tools, please remove prompts/list and prompts/get from itemsForMCP. If you are required to add only prompts, please remove tools/list from itemsForMCP.

javascript
/**
 * 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_: {
      tool1: {
        description: "Use this for testing a tool 1 of MCP server.",
        parameters: {
          type: "object",
          properties: {
            sample: { type: "string", description: "Sample value." },
          },
          required: ["sample"],
        },
      },
      tool2: {
        description: "Use this for testing a tool 2 of MCP server.",
        parameters: {
          type: "object",
          properties: {
            sample: { type: "string", description: "Sample value." },
          },
          required: ["sample"],
        },
      },
    },

    tool1: (object) => object,
    tool2: (object) => object,
  };

  // for MCP
  const itemsForMCP = [
    ...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,
      },
    })),

    {
      type: "prompts/list",
      value: {
        prompts: [
          {
            name: "prompt1",
            description: "Custom prompt 1",
            arguments: [
              { name: "sample1", description: "sample1", required: true },
            ],
          },
          {
            name: "prompt2",
            description: "Custom prompt 2",
            arguments: [
              { name: "sample2", description: "sample2", required: true },
            ],
          },
        ],
      },
    },

    {
      type: "prompts/get",
      value: {
        prompt1: {
          description: "Custom prompt 1",
          messages: [
            {
              role: "user",
              content: {
                type: "text",
                text: "Custom prompt 1",
              },
            },
          ],
        },
        prompt2: {
          description: "Custom prompt 2",
          messages: [
            {
              role: "user",
              content: {
                type: "text",
                text: "Custom prompt 2",
              },
            },
          ],
        },
      },
    },
  ];

  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);
}

Approach for reducing startup speed for loading MCP server

In order to reduce the process time for loading the MCP server when Gemini CLI is run, I created a wrapper as an approach. When you use this approach, please deploy Google Apps Script Web Apps with ToolsForMCPServer and MCPApp. After it, please do the following steps.

Now, implement the Node.js wrapper to accelerate the startup.

  1. Create a new workspace directory and navigate into it.
  2. Install the necessary libraries: npm install @modelcontextprotocol/sdk zod@3.
  3. Download the two required script files wrapped_gas_web_apps.js and tools.js from my repository.
  4. Modify settings.json to use the Node.js wrapper. Replace {your path} with the absolute path to wrapped_gas_web_apps.js.
json
{
  "theme": "Default",
  "selectedAuthType": "### your setting ###",
  "mcpServers": {
    "wrapped_gas_web_apps": {
      "command": "node",
      "args": ["{your path}/wrapped_gas_web_apps.js"]
    }
  }
}

Run $ gemini again. You should observe a significantly faster startup. In my tests, the startup time was reduced by approximately 15 times. While the performance of individual tool execution remains the same, the improved startup time makes the CLI much more practical and user-friendly.


Licence

MIT

Author

Tanaike

Donate

Update History

  • v1.0.0 (July 3, 2025)

    1. Initial release.
  • v1.0.1 (July 9, 2025)

    1. The method name of getServer was changed to getTools. But, getServer can still be used.

    2. The following methods were added.

    • For management of Gmail
      • get_attachment_files_from_Gmail
    • For management of Google Drive
      • rename_files_on_google_drive
      • move_files_on_google_drive
      • convert_mimetype_of_file_on_google_drive
    • For using Gemini
      • generate_roadmap_to_google_sheets

      • generate_description_on_google_drive

      • generate_image_on_google_drive

      • summarize_file_on_google_drive

      • description_web_site

    1. Added sample prompts and answers in README.md.
  • v1.0.2 (July 10, 2025)

    1. A tool change_permission_of_file_on_google_drive was added. By this, when a Google Docs files are included in Gmail, the email can be sent by giving permission to the Google Docs file.
  • v1.0.3 (July 11, 2025)

    1. A tool get_current_weather was updated.
    2. A new tool get_specific_date_weather was added.
  • v1.0.4 (July 11, 2025)

    1. A function getSheet_ was updated.
  • v1.0.5 (July 16, 2025)

    1. A new tool search_values_from_google_sheets was added.
  • v1.0.6 (July 17, 2025)

    1. The following 6 new tools were added.

    • get_google_doc_object_using_docs_api
    • manage_google_docs_using_docs_api
    • get_google_sheet_object_using_sheets_api
    • manage_google_sheets_using_sheets_api
    • get_google_slides_object_using_slides_api
    • manage_google_slides_using_slides_api
  • v1.0.7 (July 19, 2025)

    1. Added a getToolList method for retrieving all current tools in the library.
    2. Tools can be filtered using enables or disables as an array argument for the getTools method. If enables is used, only the tools specified in the enables array will be used. If disables is used, all tools except those specified in the disables array will be used. If neither enables nor disables is used, all tools will be used.
  • v1.0.8 (July 23, 2025)

    1. An issue occurred when I updated Gemini CLI from v0.1.12 to v0.1.13. Ref Fortunately, Google is already aware of this issue, and I'm awaiting a resolution. In the meantime, I've received emails about it, so I've updated ToolsForMCPServer for Gemini CLI v0.1.13. The detailed updates are as follows: I confirmed that all tools in ToolsForMCPServer v1.0.8 worked when tested with Gemini CLI v0.1.13.

    • oneOf has been removed from the schema of each tool.
    • Following this report, the request body is now generated on the MCP server side. Therefore, when using the tools manage_google_docs_using_docs_api, manage_google_sheets_using_sheets_api, and manage_google_slides_using_slides_api, please use your API key for the Gemini API.
  • v1.0.9 (July 24, 2025)

    1. The following 2 new tools were added.

    • description_video_on_youtube: Describe a YouTube video by providing the URL.
    • create_google_docs_from_markdown_on_google_drive: Create a Google Document from a markdown format.
  • v1.0.10 (July 26, 2025)

    1. When I updated Gemini CLI from v0.1.12 to v0.1.13, an issue related to the schema of MCP occurred. Ref So, as a workaround at the time, I updated this library. But when I updated Gemini CLI to v0.1.14, I confirmed that the previous schema could be used. So, I reimplemented the previous schema. By this, the request body for APIs can be directly generated using Gemini CLI v0.1.14.
  • v1.0.11 (July 29, 2025)

    1. management_calendar.js was updated. search_schedule_on_Google_Calendar and create_schedule_to_Google_Calendar were updated. And, 2 tools delete_schedules_on_Google_Calendar and update_schedule_on_Google_Calendar were added. From this version, when you want to manage Google Calendars, please enable Calendar API at Advanced Google services.
  • v1.0.12 (July 31, 2025)

    1. At Gemini CLI v0.1.15, prompts/list was called even when prompts wasn't included in capabilities. This resulted in the error Error discovering prompts from gas_web_apps: MCP error -32001: Request timed out when prompts wasn't returned for prompts/list. To resolve this, I updated ToolsForMCPServer to return an empty array for prompts, which eliminated the error. Consequently, with this update in v1.0.12, you can now set custom prompts and resources.
  • v1.0.13 (August 1, 2025)

    1. prompts/get was updated. And, 3 prompts were added.
  • v1.0.14 (August 2, 2025)

    1. The library version and protocol version were set as variables.
  • v1.0.15 (August 2, 2025)

    1. Bugs of tools create_schedule_on_Google_Calendar and update_schedule_on_Google_Calendar were removed.
  • v1.0.16 (August 5, 2025)

    1. A tool update_schedule_on_Google_Calendar was updated. From this version, when the event is updated, an email is sent. And, the guests can also be removed.
  • v1.0.17 (August 5, 2025)

    1. main_library_side.js was updated.
  • v1.0.18 (August 9, 2025)

    1. A bug was removed. When a tool for Google Forms is run, an error like FunctionDeclaration in the request exceeds the maximum allowed nesting depth. occurs. This bug was removed by refactoring the JSON schema.
  • v1.0.19 (August 10, 2025)

    1. 67 Tools for managing Google Classroom and 3 tools for managing Google People were added. When you use those tools, please enable the Google Classroom API and the Google People API at Advanced Google services. You can see the sample prompts at Next-Level Classroom Automation: Gemini CLI, Google Classroom, and MCP.
  • v1.0.20 (August 11, 2025)

    1. A bug was removed. Ref
  • v1.0.21 (August 12, 2025)

    1. A tool create_schedule_on_Google_Calendar in management_calendar.js was updated. From this version, the Calendar API is used.
  • v1.0.22 (August 13, 2025)

    1. Upon updating the Gemini CLI from v0.1.18 to v0.1.19, I noticed a regression. Ref I modified most of the tools, but left manage_google_docs_using_docs_api, manage_google_sheets_using_sheets_api, and manage_google_slides_using_slides_api untouched. These tools rely on $ref in their input schemas, but it appears $ref is not supported in version v0.1.19. I'll hold off on further changes and wait for a future update to the Gemini CLI. At v0.1.19, when Gemini CLI is run, the following 3 errors are shown in the above. But, other 112 tools can be used.
    Skipping tool 'manage_google_docs_using_docs_api' from MCP server 'gas_web_apps' because it has missing types in its parameter schema. Please file an issue with the owner of the MCP server.
    Skipping tool 'manage_google_sheets_using_sheets_api' from MCP server 'gas_web_apps' because it has missing types in its parameter schema. Please file an issue with the owner of the MCP server.
    Skipping tool 'manage_google_slides_using_slides_api' from MCP server 'gas_web_apps' because it has missing types in its parameter schema. Please file an issue with the owner of the MCP server.
  • v1.0.23 (August 14, 2025)

    1. A tool get_attachment_files_from_Gmail was updated. Ref
  • v1.0.24 (August 14, 2025)

    I’ve dealt with an issue caused by the update of the Gemini CLI from v0.1.18 to v0.1.19.

    The update has lowered the schema nesting depth, which now requires the use of $ref. However, the parametersJsonSchema appears to be incompatible with this. This means that a request body, such as the batchUpdate for the Docs, Sheets, and Slides APIs, cannot be directly generated using the input schema. It would be very useful if an AI agent could directly generate this type of complex request body.

    To solve this, I explored solutions to manage the low depth without using $ref for these three tools. I came up with the following workaround:

    The JSON schema is included in the tool's description, and this description is used as a prompt for the AI agent.

    With this workaround, the input schema remains simple, and the complex JSON schema can still be used to generate the request body. Additionally, no errors occur when using the Gemini CLI.

  • v1.0.25 (August 14, 2025)

    1. Modified descriptions of manage_google_docs_using_docs_api, manage_google_sheets_using_sheets_api, and manage_google_slides_using_slides_api.
  • v1.0.26 (August 18, 2025)

    1. Following 6 tools were added.

    • comments_drive_api_list: Use to get a list of a file's comments on Google Drive.
    • comments_drive_api_remove: Use to delete a comment using the "comments.delete" method of Google Drive API.
    • revisions_drive_api_list: Use to get a list of a file's revisions on Google Drive.
    • drive_activity_api_query: Use to query past activity in Google Drive. The activities of the files and folders in Google Drive are retrieved.
    • people_otherContacts_search: Use to provide a list of contacts in the authenticated user's other contacts that matches the search query.
    • people_people_getBatchGet: Use to provide information about a list of specific people by specifying a list of requested resource names.
  • v1.0.27 (August 22, 2025)

    1. Following 6 tools for Google Analytics were added.

    • analytics_admin_accountSummaries_list: Retrieves a list of all Google Analytics accounts accessible by the current user
    • analytics_admin_properties_get: Get detailed information about a single Google Analytics property
    • analytics_data_properties_runReport: Fetches a custom report from a Google Analytics property
    • analytics_data_properties_runRealtimeReport: Generates a customized report of real-time event data from a Google Analytics property
  • v1.0.28 (September 11, 2025)

    1. The following 9 tools were added.

    • create_document_body_in_google_docs

    • remove_files_on_google_drive

    • maps_get_route

    • maps_convert_location_to_lat_lon

    • maps_convert_lat_lon_to_location

    • maps_create_map

    • explanation_create_maps_url

    • explanation_reference_generate_google_apps_script

    • explanation_reference_export_google_sheets_as_pdf

    1. A bug of a tool "convert_mimetype_of_file_on_google_drive" was removed. This is from this issue report.
  • v1.0.29 (September 15, 2025)

    1. The following 5 tools were added. These tools provide the information for building the request body of Google APIs.

      • explanation_analytics_data_properties_runReport
      • explanation_analytics_data_properties_runRealtimeReport
      • explanation_manage_google_sheets_using_sheets_api
      • explanation_manage_google_docs_using_docs_api
      • explanation_manage_google_slides_using_slides_api
    2. The following 8 tools were updated.

      • get_google_sheet_object_using_sheets_api
      • manage_google_sheets_using_sheets_api
      • get_google_doc_object_using_docs_api
      • manage_google_docs_using_docs_api
      • get_google_slides_object_using_slides_api
      • manage_google_slides_using_slides_api
      • analytics_data_properties_runReport
      • analytics_data_properties_runRealtimeReport
  • v1.0.30 (September 16, 2025)

    1. Updated JSON schema for "generate_survey_with_google_forms" and "generate_quiz_with_google_forms". And, added 2 tools of "explanation_generate_survey_with_google_forms" and "explanation_generate_quiz_with_google_forms". Recently, the complex JSON schema cannot be used. By this, when it is required to generate the complex JSON, I use the RAG to provide the explanation of the complex schema.
  • v1.0.31 (September 16, 2025)

    1. Modified JSON schema for "generate_survey_with_google_forms" and "generate_quiz_with_google_forms".
  • v1.0.32 (September 17, 2025)

    1. The following 4 tools were added.

      • explanation_generate_survey_with_google_forms
      • explanation_generate_quiz_with_google_forms
      • explanation_search_file_in_google_drive
      • explanation_google_apps_script_library_list
    2. In order to reduce the startup speed for loading the MCP server, I created a wrapper. Ref

  • v1.0.33 (September 20, 2025)

    1. The bug was removed from "management_sheets.js".
  • v1.0.34 (September 22, 2025)

    1. A new tool "publicly_share_file_on_google_drive" was added.
  • v1.0.35 (September 23, 2025)

    1. A tool "generate_presentation_with_google_slides" was updated.
  • v1.0.36 (September 24, 2025)

    1. The following 4 tools were added.

      • explanation_create_chart_by_google_sheets_api
      • get_charts_on_google_sheets
      • create_chart_on_google_sheets
      • update_chart_on_google_sheets
  • v1.0.37 (September 24, 2025)

    1. The following 1 tool was added.

      • create_charts_as_image_on_google_sheets
  • v1.0.38 (October 2, 2025)

    1. By reporting this issue, a bug of get_charts_on_google_sheets could be removed. type: "object" was put in the properties. By this, an error of Schema at properties.type must be a boolean or an object occurred. This was removed.
  • v1.0.39 (October 15, 2025)

    1. use_gemini and management_sheets were modified to use the API key from Gemini CLI. Of course, you can continuously set your API key directly in the script of the Web Apps.
  • v1.0.40 (November 3, 2025)

    1. A bug was removed. Ref
  • v1.0.41 (November 14, 2025)

    1. The following 11 tools for managing File Search were added. The underlying script for these tools was created using Google Apps Script. Ref

      • file_search_gas_create
      • file_search_gas_documents_get
      • file_search_gas_documents_list
      • file_search_gas_documents_query
      • file_search_gas_documents_remove
      • file_search_gas_generate_content
      • file_search_gas_get
      • file_search_gas_import_file
      • file_search_gas_list
      • file_search_gas_media_upload
      • file_search_gas_remove
  • v1.1.0 (January 1, 2026)

    1. The default model was changed from models/gemini-3-flash-preview for using Gemini API.

TOP

安装

TypingMind
{
  "mcpServers": {
    "toolsformcpserver": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "https://script.google.com/macros/s/###/exec?accessKey=sample"
      ]
    }
  }
}

将 ToolsForMCPServer MCP 与多个 AI 模型配合使用

TypingMind 在工作区级别连接 MCP 工具,因此连接 ToolsForMCPServer 后,您就可以在 TypingMind 中搭配不同的 AI 模型使用,无需为每个模型单独设置。 此 MCP 通过您设备上的 TypingMind MCP 连接器在本地运行。

本地连接器设置指南

如果 MCP 服务器需要访问您电脑上的本地文件、应用或私有资源,请选择此方式。

1

打开 MCP 设置

在 TypingMind 中,依次前往“设置”、“高级设置”和“模型上下文协议”,然后选择“设置连接器”。

  1. 在您的浏览器中打开 TypingMind。
  2. 点击“设置”图标。
  3. 进入“高级设置”。
  4. 打开“模型上下文协议”部分。
  5. 点击“设置连接器”,然后选择“此设备”。
TypingMind MCP 连接器设置界面,已选择“此设备”
2

运行连接器命令

选择“此设备”,从 TypingMind 复制命令并在终端中运行。使用 MCP 时,请保持该进程运行。

  1. 复制 TypingMind 显示的设置命令。
  2. 在 macOS 上打开“终端”,或在 Windows 上打开 Windows Terminal。
  3. 粘贴并运行命令。
  4. 如果终端询问您是否继续,请确认安装软件包。
  5. 使用 MCP 工具时,请保持终端窗口及其中的进程运行。
3

将 ToolsForMCPServer 添加为服务器

当连接器状态为“就绪”时,点击“编辑服务器”,然后粘贴 MCP 服务器配置。

  1. 等待连接器状态显示为“就绪”。
  2. 点击“编辑服务器”。
  3. 粘贴 ToolsForMCPServer MCP 服务器配置。
  4. 保存服务器列表。
  5. 如需确认连接器是否仍处于就绪状态,请刷新。
TypingMind MCP 设置界面,显示正在运行的服务器和“编辑服务器”按钮
{
  "mcpServers": {
    "toolsformcpserver": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

在不同模型中使用同一连接

保存服务器列表,打开“插件”,启用 ToolsForMCPServer MCP 工具,然后在 TypingMind 中选择任意受支持的 AI 模型,即可在聊天中使用这些工具,或将其分配给智能体。

  1. 在 TypingMind 中打开“插件”页面。
  2. 启用 ToolsForMCPServer MCP 工具。
  3. 开始聊天并选择您想使用的 AI 模型。
  4. 在聊天中使用 MCP 工具,或将其分配给 AI 智能体。
  5. 根据需要随时切换到其他 AI 模型,无需重新连接 MCP。
在 TypingMind 聊天中使用已启用的 MCP 工具和选定的 AI 模型
您能使用 ToolsForMCPServer 帮我完成这项任务吗?
ToolsForMCPServer
当然。我已阅读。
以下是我使用 ToolsForMCPServer 得到的结果。

常见问题

ToolsForMCPServer MCP 服务器有什么用途?

ToolsForMCPServer 是一个 MCP 服务器,可让兼容的 AI 客户端连接外部工具并获取上下文。在 TypingMind 中,只需添加一次此 MCP 服务器,即可在您的 AI 工作区中使用其工具。

可以在 TypingMind 中让多个 AI 模型使用 ToolsForMCPServer MCP 吗?

可以。TypingMind 在工作区层面连接 MCP 工具,因此您可以让 Claude、ChatGPT、Gemini 等不同 AI 模型,或您在 TypingMind 中配置的其他模型使用 ToolsForMCPServer,而无需为每个模型单独配置 MCP 服务器。

为什么在 TypingMind 中使用 ToolsForMCPServer MCP?

TypingMind 将多个 AI 模型、提示词、插件、AI 智能体、API 密钥和 MCP 工具整合到同一个工作区中,是优秀的大语言模型聊天前端之一。连接 ToolsForMCPServer 后,您可以在偏好的不同模型中使用其 MCP 工具,同时在 TypingMind 中井然有序地管理聊天工作流程。

如何将 ToolsForMCPServer MCP 连接到 TypingMind?

ToolsForMCPServer 通过 TypingMind 本地 MCP 连接器运行。当 MCP 服务器需要访问您计算机上的本地文件、桌面应用、命令行工具或私有资源时,这种方式最合适。

ToolsForMCPServer MCP 在 TypingMind 中提供哪些工具?

ToolsForMCPServer 提供 MCP 功能,您可以在 TypingMind 的插件页面启用这些功能,然后在聊天中使用,或将其分配给 AI 智能体。

使用 ToolsForMCPServer MCP 需要向 TypingMind 提供我的 API 密钥吗?

不需要。TypingMind 采用本地优先的设计,让您自行掌控模型提供商、API 密钥、提示词和 MCP 配置。如果 ToolsForMCPServer 需要身份验证,请在创建连接时,为该 MCP 服务器添加所需的请求头、OAuth 设置或本地配置。

相关 MCP 服务器

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇