Get the FREE Ultimate OpenClaw Setup Guide →

MCPApp

This text introduces the Model Context Protocol (MCP) for AI interaction, exploring Google Apps Script (GAS) as a server option. It shows feasibility with a sample but notes the lack of a GAS SDK, aiming to encourage understanding and development.

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-mcpapp node path/to/MCPApp.js \
  --env LOCK_SERVICE="enabled by default; set to false to disable (see README for details)"

How to use

MCPApp is an MCP server implemented with Google Apps Script to serve as a universal adapter between AI models and external data or services. It is designed to work with the MCP ecosystem, including clients like the Gemini CLI, enabling models to request contextually relevant information from configured sources. By default, the server leverages a LockService to coordinate access and ensure secure, serialized operations, which is particularly important when multiple clients may issue concurrent requests. When integrating with Gemini CLI or other MCP clients, you can point them at the MCPApp instance to begin requesting and receiving contextual data in a standardized MCP format. The server is designed to be extendable as a library as well, allowing developers to incorporate MCPApp as part of larger Google Apps Script projects or libraries. You can selectively enable or disable the LockService if you require higher throughput for asynchronous requests, but you should do so with caution to avoid race conditions.

How to install

Prerequisites:

  • Access to Google Apps Script environment or a Google account to deploy and run Apps Script projects.
  • Basic familiarity with deploying Apps Script projects as libraries or web apps.

Installation steps:

  1. Create a new Google Apps Script project or open an existing one where you want to host the MCPApp server.
  2. Add the MCPApp library or code as a script file in the project. If you have a library version, add it via the Libraries feature in Apps Script and insert the required initialization code in your project.
  3. Configure deployment:
    • Deploy as a Web App if you want HTTP endpoints for MCP requests, or
    • Use as a Library within another Apps Script project to reuse the MCPApp functionality.
  4. Configure access and environment variables as needed (e.g., enabling/disabling LockService, setting any API keys for underlying data sources).

Notes:

  • Since MCPApp is based on Google Apps Script, there is no Node.js, Python, or Docker installation required for running the server in the intended environment. The deployment steps focus on Apps Script configuration and deployment.
  • If you are integrating with Gemini CLI or other MCP clients, ensure the client is configured to target the deployed Apps Script endpoints and that any required authentication or access tokens are provided.

Additional notes

Tips and common considerations:

  • By default, LockService is enabled to serialize access. To disable, modify the initialization to pass lock: false, but be mindful of a maximum of 30 concurrent asynchronous requests when running without LockService.
  • Keep the MCPApp library up to date with the latest MCP protocol changes to maintain compatibility with Gemini CLI and other MCP clients.
  • If you encounter deployment or permissions errors in Apps Script, verify that the script has the necessary scopes and that the deployment target (web app or library) is properly configured.
  • When debugging, log MCP requests and responses to help trace integration issues with clients.
  • Since this server is designed to act as a universal adapter, it's common to configure multiple data sources and contextual sources. Document each source’s endpoint, required authentication, and data format in your project for maintainability.

Related MCP Servers

Sponsor this space

Reach thousands of developers