Dynamic Tool Creation for Google Workspace Automation with Gemini CLI

Gists

Dynamic Tool Creation for Google Workspace Automation with Gemini CLI

Abstract

This article presents a method for optimizing Google Workspace automation by dynamically converting frequently used, AI-generated Google Apps Scripts into permanent, reusable tools. By integrating the Gemini CLI with a gas-fakes sandbox via an MCP server, we demonstrate how to securely add and manage these custom tools, reducing operational costs and improving efficiency.

Introduction

When using generative AI to create scripts, ensuring the secure execution of the generated code is critical. This is especially true for applications that manage cloud resources like Google Workspace, where it is paramount to prevent unintended data access or modification. The standard permission model for Google Apps Script often requires broad access, creating a significant security risk when running code from untrusted sources.

A Collaborative Dialogue Between Gemini CLI and Copilot CLI Through MCP

Gists

A Collaborative Dialogue Between Gemini CLI and Copilot CLI Through MCP

Abstract

This article introduces a method for integrating Google’s Gemini CLI and GitHub’s Copilot CLI using the Model Context Protocol (MCP). By configuring one CLI as an MCP server, the other can invoke it from a prompt, enabling a powerful, collaborative interaction between the two AI assistants for enhanced development workflows.

Introduction

Recently, GitHub released the Copilot CLI, a command-line interface that brings the power of GitHub Copilot directly to your terminal. It assists with various tasks, including answering questions, writing code, and interacting with GitHub. Concurrently, Google has already introduced the Gemini CLI, an open-source AI agent that integrates the Gemini models into the command line to help developers with coding, problem-solving, and task management.

Secure and Conversational Google Workspace Automation: Integrating Gemini CLI with a gas-fakes MCP Server

Gists

Secure and Conversational Google Workspace Automation: Integrating Gemini CLI with a gas-fakes MCP Server

Abstract

This article introduces a method for securely executing AI-generated Google Apps Script. By implementing a “fake-sandbox” using the gas-fakes library as an MCP server, users can empower the Gemini CLI to safely automate Google Workspace tasks with granular, file-specific permissions, avoiding significant security risks.

Introduction

“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’?

Streamlining Content Creation: A Guide to Using Gemini CLI, MCP Server, and VSCode

Gists

Streamlining Content Creation: A Guide to Using Gemini CLI, MCP Server, and VSCode

Abstract

This guide explores a powerful workflow for generating articles and other content by integrating Gemini CLI, a Model Context Protocol (MCP) server, and Visual Studio Code (VSCode). Discover how to leverage this combination for efficient, context-aware content creation, modification, and distribution, complete with practical examples and prompts.

Introduction

The integration of Gemini CLI with Visual Studio Code (VSCode) creates a highly efficient and context-aware environment for developers and writers alike. This setup allows the AI-powered Gemini CLI to access the VSCode workspace, making it aware of open files and selected text to provide relevant and targeted suggestions. A key feature is the native in-editor diffing, which enables a side-by-side review and modification of AI-generated changes before acceptance, offering greater control over the final output.

Accelerating Gemini CLI: A Node.js Wrapper for Google Apps Script MCP Servers

Gists

Accelerating Gemini CLI: A Node.js Wrapper for Google Apps Script MCP Servers

Abstract

This article introduces a Node.js wrapper that dramatically reduces the startup time for the Gemini CLI when used with MCP servers built on Google Apps Script. This optimization enhances user experience by accelerating the initialization process, achieving a speed boost of approximately 15 times.

1. Introduction

The Model Context Protocol (MCP) is a vital open standard enabling AI agents to connect with external tools and data sources for complex, real-world tasks. To integrate the Gemini AI agent with Google Workspace, I developed two open-source tools: MCPApp, for managing the MCP server lifecycle, and ToolsForMCPServer, a suite of tools for interacting with services like Gmail and Drive. These are built with Google Apps Script for use with the Gemini CLI.

Updated: GAS Library - ToolsForMCPServer

ToolsForMCPServer was updated to v1.0.29

  • 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

You can see the detailed information here https://github.com/tanaikech/ToolsForMCPServer

Updated: GAS Library - ToolsForMCPServer

ToolsForMCPServer was updated to v1.0.28

  • 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
    2. A bug of a tool “convert_mimetype_of_file_on_google_drive” was removed. This is from this issue report.

You can see the detailed information here https://github.com/tanaikech/ToolsForMCPServer

Google Maps with Natural Language: Integrated Collaboration through Gemini CLI and MCP

Gists

Google Maps with Natural Language: Integrated Collaboration through Gemini CLI and MCP

Abstract

This article demonstrates integrating Google Maps with natural language using the Gemini CLI and an MCP server. This powerful combination allows users to automate complex location-based tasks, such as route planning and information retrieval, through simple, intuitive text-based prompts.

Introduction

The Gemini CLI, when paired with Model Context Protocol (MCP) servers, is a powerful tool for integrating various applications with natural language. When the MCP servers are built using Google Apps Script Web Apps, it becomes easy to integrate Google Workspace and other Google APIs with seamless authorization. This concept has been explored in several articles, which you can find here: Ref, Ref, Ref, Ref, Ref, Ref, Ref. This article introduces the integration of Google Maps and natural language using the Gemini CLI with an MCP server.

A Fake-Sandbox for Google Apps Script: A Feasibility Study on Securely Executing Code Generated by Gemini CLI

Gists

A Fake-Sandbox for Google Apps Script: A Feasibility Study on Securely Executing Code Generated by Gemini CLI

Abstract

Generating Google Apps Script (GAS) with Gemini CLI from natural language introduces security risks due to broad permissions. This report investigates a “Fake-Sandbox” using the gas-fakes library, translating GAS calls into granularly-scoped API requests to securely execute scripts created from user prompts.

Introduction

1. Background: Generative AI and the Challenge of Secure Script Execution

The emergence of Generative AI now makes it possible to generate executable scripts directly from natural language instructions, particularly through interfaces like the Gemini CLI. For locally executable languages such as JavaScript (Node.js) and Python, code generated from a simple prompt can be run directly. However, Google Apps Script (GAS) presents a unique challenge as it operates within Google’s server-side infrastructure. Executing locally generated GAS code requires the remote invocation of a server-side function via the scripts.run method of the Apps Script API. This process highlights the critical need for a sandbox environment to manage permissions effectively and mitigate the risks associated with executing code generated from natural language, which can sometimes produce unintended or insecure outcomes.

Updated: GAS Library - ToolsForMCPServer

ToolsForMCPServer was updated to v1.0.27

  • 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

You can see the detailed information here https://github.com/tanaikech/ToolsForMCPServer

Google OAuth Verification & Application Privacy Policy

Registered Application Name: Workspace & Gemini AI Orchestration Engine

Application Purpose & Core Functionality:

This web page serves as the official homepage and privacy compliance interface for the application "Workspace & Gemini AI Orchestration Engine". This specialized developer utility is designed to research, benchmark, and optimize advanced integrations between Google Workspace services, the Google Apps Script API, and Gemini AI models (via Google Vertex AI / Gemini API endpoints).

The application facilitates automated multi-agent scaffolding, programmatic script deployment, project resource management, and structural analysis of Google Apps Script projects. It allows developers and autonomous AI agents (operating via Model Context Protocol / MCP) to securely evaluate execution performance, implement high-performance batch requests, and test agent-to-agent (A2A) workflows within a controlled and structured environment.

Google User Data Policy Compliance Statements:

1. Data Access & Specific Usage

Our application explicitly requests access to specific Google user accounts through OAuth scopes required strictly for interacting with the Google Apps Script API and Google Workspace endpoints. This access is utilized solely to execute user-initiated or agent-orchestrated programmatic operations—such as creating, modifying, deploying, or benchmarking script projects and executing automated workflows. No background automated extraction occurs without explicit session initiation.

2. Data Storage & Zero-Retention Policy

Adhering to a strict Zero-Retention Model, this application does not store, log, or persist any personal data, OAuth tokens, script source codes, or Google account configurations on any external server, database, or persistent storage medium. All data processing and API responses are handled entirely in-memory or securely on the client side within the active session context, ensuring complete cryptographic transient isolation.

3. Data Sharing & Third-Party Non-Disclosure

We maintain absolute data privacy. No data accessed via Google OAuth scopes is shared, sold, rented, or transferred to third-party entities, advertising networks, or data brokers. All data transmissions are strictly point-to-point, encrypted in transit using industry-standard protocols, and limited entirely to the direct channel between the execution environment and Google's official API gateways.

For inquiries regarding this developer application, technical benchmarks, or verification compliance, please refer to the official documentation and repositories linked on this homepage (tanaikech.github.io).