@tcliplab/gas-json-mcp
v0.2.1
Published
JSON-only MCP bridge for configured Google Apps Script web apps
Readme
@tcliplab/gas-json-mcp
@tcliplab/gas-json-mcp is an MCP server that calls a Google Apps Script Web App as a JSON API.
The destination URL is fixed through environment variables at startup. The server provides JSON-only doGet and doPost communication; available actions, authentication, and data semantics are defined by the contract of the target GAS API.
Purpose
This is a small, general-purpose bridge for anyone who wants to expose an API built with Google Apps Script to an AI client through MCP. It contains no service-specific business logic and follows the contract of the target GAS API. Use, adapt, and extend it as needed.
MCP configuration
Start the published package with npx:
{
"mcpServers": {
"gas-json-api": {
"command": "npx",
"args": ["--yes", "@tcliplab/gas-json-mcp"],
"env": {
"GAS_BASE_URL": "https://script.google.com/macros/s/<DEPLOYMENT_ID>/exec",
"GAS_AUTH_VALUE": "<OPTIONAL_TOKEN>",
"GAS_REQUEST_TIMEOUT_MS": "30000",
"GAS_DOGET_ALLOWED": "true",
"GAS_DOPOST_ALLOWED": "true"
}
}
}
}GAS_BASE_URL: The target GAS Web App/execURL. Required.GAS_AUTH_VALUE: When set, it is sent astokenin the GET query and POST JSON body.GAS_DOGET_ALLOWED/GAS_DOPOST_ALLOWED: Controls whether each MCP tool is exposed.
See config.npx.example.json for the complete example.
Tools
gas_get_json: Sends an action and query to the target GASdoGetendpoint.gas_post_json: Sends an action, payload, and idempotency key to the target GASdoPostendpoint.
Both tools accept JSON responses only. The destination URL and authentication settings cannot be changed per tool call.
Development
npm install
npm run check
npm test
npm pack --dry-runnpm test validates HTTP requests against a mock GAS endpoint and runs MCP tool calls through stdio.
Security
- Do not commit real tokens or credentials to this repository or its examples.
- Set
GAS_AUTH_VALUEonly when needed, and validate it in the target GAS API. - Document authentication, allowed actions, and data retention rules in the target GAS API contract and MCP usage instructions.
