gas-fakes
This repository demonstrates how to dynamically add frequently used, AI-generated Google Apps Scripts to an MCP server as permanent tools. This approach enhances security, reduces costs, and improves efficiency for Google Workspace automation using the Gemini CLI and the gas-fakes library.
claude mcp add --transport stdio tanaikech-gas-fakes-mcp node ./gas-fakes-mcp.js
How to use
gas-fakes-mcp is an MCP server that integrates a local gas-fakes sandbox with the Model Context Protocol to securely execute AI-generated Google Apps Script. It enables Gemini CLI to generate, test, and promote frequently used Google Apps Script tools into a permanent MCP toolset, so they are readily available for secure execution without recreating them each time. The server relies on the gas-fakes library to provide a sandboxed execution environment that translates Apps Script calls into Google API requests with granular permissions. You can use the included sample tools and extend them by adding new tools through the Gemini workflow described in the setup steps. Once configured, the Gemini CLI can dynamically generate new GAS tools, verify them in the sandbox, and publish them to the MCP server for perpetual use.
To use the MCP server, start by ensuring Node.js and npm are installed, then run the gas-fakes MCP script via Node as configured in your Gemini settings. The Gemini CLI settings map the gas-fakes MCP server under the key gas-fakes with command: node and a path to gas-fakes-mcp.js. With this in place, you can invoke Gemini prompts to generate GAS scripts, test them in the gas-fakes sandbox, and add them to the MCP server as new tools. Tools follow a defined structure with a name, a JSON schema for arguments, and a func that processes tasks inside the gas-fakes sandbox when invoked by the Gemini agent.
How to install
Prerequisites\n- Node.js and npm installed on your system.\n- Gemini CLI installed for interacting with the MCP.\n\nStep-by-step installation\n1) Install gas-fakes in your working directory:\nbash\nnpm install @mcpher/gas-fakes\n\n2) Install MCP server modules required for the gas-fakes integration:\nbash\nnpm install @modelcontextprotocol/sdk zod\n\n3) Copy the MCP server script files into your project root:\n- gas-fakes-mcp.js\n- gas-fakes-mcp-tools.js\n(obtain these from the gas-fakes-mcp repository)\n4) Install the Gemini CLI if not already installed: (see Gemini CLI repo)\nbash\n# Example (if using npm to install Gemini CLI)\nnpm install -g @google/gemini-cli\n\n5) Configure the Gemini CLI to connect to the MCP server by editing the settings.json in your .gemini directory. Add the gas-fakes MCP server configuration as shown:\njson\n{\n "security": {\n "auth": {\n "selectedType": "### your setting ###"\n }\n },\n "ui": {\n "theme": "Default"\n },\n "mcpServers": {\n "gas-fakes": {\n "command": "node",\n "args": ["./gas-fakes-mcp.js"]\n }\n }\n}\n\n6) Verify your project directory structure matches the expected layout (as shown in the README). Ensure gas-fakes-mcp.js and gas-fakes-mcp-tools.js are present.\n7) Run the Gemini CLI (from your project directory) to start using the MCP server:\nbash\ngemini\n
Additional notes
Tips and common considerations:\n- The gas-fakes sandbox provides a secure execution environment for AI-generated Apps Script. When using sandbox options, you can control whitelistItems and sandbox toggles within the tool definitions.\n- The MCP server is designed to be extended with new GAS tools generated by Gemini. Each tool should provide a name, a descriptive schema, and a func that uses the gas-fakes sandbox for safe execution.\n- Remember to grant appropriate Google API scopes for gas-fakes to interact with Google Workspace resources.\n- If you encounter issues with the sandbox, verify your node environment, ensure gas-fakes is correctly installed, and confirm the gas-fakes-mcp.js path in your settings.json.\n- You can maintain a set of permanent tools in the MCP server and append new tools as needed without regenerating base scripts.
Related MCP Servers
mcp-nodejs-debugger
🐞 MCP Node.js debugger
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.
architect
A powerful, self-extending MCP server for dynamic AI tool orchestration. Features sandboxed JS execution, capability-based security, automated rate limiting, marketplace integration, and a built-in monitoring dashboard. Built for the Model Context Protocol (MCP).
ToolsForMCPServer-extension
Simplified Google Workspace Automation with Gemini CLI Extensions
mcp
Model Context Protocol (MCP) server for video automation with Plainly Videos API (Adobe After Effects automation).
mcp-node-omnibus
A comprehensive Model Context Protocol (MCP) server that provides advanced Node.js development tooling and automation capabilities.