Get the FREE Ultimate OpenClaw Setup Guide →

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.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio tanaikech-toolsformcpserver node path/to/server.js \
  --env MCP_API_KEY="your-api-key-if-required" \
  --env GAS_WEBAPP_URL="URL_of_Google_Apps_Script_Web_App"

How to use

ToolsForMCPServer provides a rich MCP server implemented as a Google Apps Script Web App. It exposes a large collection of pre-built tools for interacting with Google Workspace services (Gmail, Drive, Calendar, Docs, Sheets, Slides, Calendar, Maps, etc.) via the MCP protocol. With the Gemini CLI or any MCP client, you can query /mcp to discover available tools, and invoke them to perform multi-step automation tasks within the Google ecosystem. The GAS-based server handles authentication to Google Workspace APIs, simplifying authorization flows for Gemini users. To use it, deploy the Google Apps Script project as a Web App, obtain the Web App URL, and configure your MCP client to point at that URL so that commands and tool invocations are routed through this MCP server.

Once set up, you can run commands such as listing tools, invoking a particular tool (for example to manage Drive files, Gmail labels, or Calendar events), and chain multiple tool calls within a single MCP session. The ToolsForMCPServer library backed by MCPApp handles request/response formatting, API access, and tool discovery, making it straightforward to build automationSnippets that leverage Google Workspace capabilities through the Gemini CLI.

How to install

Prerequisites:

  • A Google account with access to Google Apps Script and Google Workspace APIs you plan to use.
  • Access to the ToolsForMCPServer and MCPApp libraries in GAS.
  • Gemini CLI or another MCP client for interacting with MCP servers.

Step-by-step installation:

  1. Create a standalone Google Apps Script project (not bound to any Sheet/Doc).

    • Visit script.google.com and create a new standalone project.
  2. Install libraries in the Apps Script project:

  3. Add the provided script (copy-paste) into the Apps Script editor, replacing any existing code. This script wires ToolsForMCPServer with your Gemini API key and exposes the MCP endpoint via the GAS Web App.

  4. Deploy as a Web App:

    • In the Apps Script editor, select Publish > Deploy as web app.
    • Set who has access to the app (e.g., Anyone with the link).
    • Deploy and copy the Web App URL (this is the MCP server endpoint).
  5. Configure the MCP client:

    • Create or update your mcp_config to point at the GAS Web App URL. Provide any required environment variables (e.g., API keys for Gemini access) in the client configuration.
    • Example (conceptual, adjusted to your client): set the MCP server URL and credentials so that MCP requests are sent to the GAS Web App endpoint.
  6. Test connectivity:

    • Use your MCP client’s discovery command (e.g., /mcp desc) to verify tools are available.
    • Invoke a simple tool to ensure proper authentication and tool execution.

Note: If you intend to use tools that require a Gemini API key or access to particular Google Workspace services, uncomment and populate the apiKey and any default configuration values in the provided GAS script.

Additional notes

Tips and notes:

  • The GAS-based MCP server authenticates with Google Workspace APIs via the Apps Script environment. Ensure the necessary Google API services (Drive, Gmail, Calendar, Docs, Sheets, Slides, etc.) are enabled in your Google Cloud project and in Apps Script Advanced Services if required.
  • Some tools may require deliberate enabling of specific Google APIs (Drive Activity, Analytics, Classroom, People, etc.). Update the Advanced Google Services and Google Cloud Console permissions accordingly.
  • If you run into authorization issues, ensure the GAS project’s OAuth scopes request access to the needed Google Workspace APIs. You may need to re-authorize after enabling new scopes.
  • The Web App URL is the entry point for all MCP requests. Treat this URL as a sensitive endpoint that should be protected or restricted to your MCP clients.
  • The exact field names and environment variables may vary depending on your MCP client. Use mcp_config to declare the server, and env to declare keys and placeholders as needed.
  • The ToolsForMCPServer library exposes a large catalog of tools; run the /mcp desc command on Gemini CLI to list available tools and their descriptions.

Related MCP Servers

Sponsor this space

Reach thousands of developers