LABSCO SUMMARY
Worth reading for the pattern more than for the code.
This is published as a report with a working demo attached, and the idea it demonstrates is genuinely useful: MCP and A2A are different protocols over the same HTTP surface, so one Apps Script deployment can answer both and share its functions between them. It is also honest about the sharp edges — the client-side patch A2A needs, and the redeploy-as-new-version rule that silently serves stale code if you skip it.
What it is
A unified Google Apps Script that deploys an MCP server and an Agent2Agent (A2A) server as a single Web App. Both clients hit the same URL over HTTP GET and POST, and both protocols share the same underlying functions — which is the point: one project instead of two, with the common logic written once.
What you get
- A single Web App URL acting as both servers, so an MCP client such as Claude Desktop and an A2A client such as
@a2a-js/sdkreach the same functions - Direct access to Google Workspace and Google APIs from inside the server, since Apps Script runs with your own authorization rather than needing separate credentials per service
- A copyable demo project — running one function copies the sample Apps Script into the root of your Google Drive, ready to deploy
- A helper,
getRegisteringAgentCardURL(), that prints the URL the A2A client needs for the agent card - Shared functions between the MCP and A2A sides, which is what removes the duplicated development cost of maintaining two servers
Requirements
A Google account and a Gemini API key, set as apiKey in the copied script. Deploy the script as a Web App with Execute as: Me and Who has access: Anyone, then copy the deployment URL and add an accessKey query parameter to it. Claude Desktop connects through npx mcp-remote pointed at that URL. Two things to plan around: modifying the script requires redeploying as a new version or the Web App keeps serving the old code, and the A2A side needs a small patch to @a2a-js/sdk — Apps Script Web Apps require an access token as a query parameter on the well-known agent-card path, which most current A2A clients do not support, and they also require following a redirect, which the public Python A2A client does not do. MIT licensed.
Setup effort
Follow the published steps — Run the README's myFunction in a Google Apps Script editor — it copies the demo project to the root of your Google Drive
USE CASES
01
Serving both protocols without maintaining two projects
Deploy once as a Web App; the MCP client and the A2A client hit the same URL and the same functions.
02
Reaching Google Workspace from an agent
Apps Script runs under your own authorization, so Drive, Gmail and the rest are available without wiring up separate service credentials.
03
Trying it without writing anything
Run the provided function to copy the demo project into your Drive, set the API key, and deploy.
BEFORE YOU INSTALL
What to know first
Requires
npx on PATH
Where it runs
The documented client connects to a hosted endpoint.
INSTALLATION
Connect your client
Server setup
Run the README's myFunction in a Google Apps Script editor — it copies the demo project to the root of your Google Drive
Set your Gemini API key as apiKey in the copied script
Deploy → New deployment → Web app, Execute as: Me, Who has access: Anyone; copy the Web App URL
Point Claude Desktop at your own URL with accessKey=sample appended (the config block below; ### is your deployment)
MCP Clients
Claude Desktop
CLAUDE DESKTOP · JSON
{
"mcpServers": {
"gas_web_apps": {
"command": "npx",
"args": [
"mcp-remote",
"https://script.google.com/macros/s/<YOUR_DEPLOYMENT_ID>/exec?accessKey=sample"
]
}
}
}