Service calls
Unknown methods, wrong argument counts, and wrong argument types on SpreadsheetApp, GmailApp, DriveApp, and the other built-in services.
Remote MCP server
For people who have Copilot, Claude, or Cursor write Apps Script: the myFunction MCP server's gas_diagnostics tool type-checks the assistant's output against declarations generated from the Apps Script runtime and returns each error with its file and line, so the assistant can fix it before you run the code.
How it fits
myFunction does not replace Copilot, Claude, or Cursor. The assistant writes the code, calls gas_diagnostics with the project files, reads the diagnostics, and fixes them before it hands the code to you.
Unknown methods, wrong argument counts, and wrong argument types on SpreadsheetApp, GmailApp, DriveApp, and the other built-in services.
Drive, Sheets, Gmail, Calendar, and the other advanced services, whether enabled by their default global name or in the appsscript.json manifest.
Functions and globals declared in one file and used in another. Apps Script resolves them in one shared scope, and so does the check.
The same checks the Chrome extension shows in the editor, including a service call inside a loop and a malformed literal value.
Connect
The server URL is https://api.myfunction.dev/mcp. Any client that supports remote MCP servers over HTTP with OAuth can connect. The first connection opens a Google sign-in page.
Run in your terminal, then run /mcp in Claude Code to sign in.
claude mcp add --transport http myfunction https://api.myfunction.dev/mcpAdd to .vscode/mcp.json, then start the server from the file and use Copilot agent mode.
{
"servers": {
"myfunction": {
"type": "http",
"url": "https://api.myfunction.dev/mcp"
}
}
}Add to ~/.cursor/mcp.json or the project's .cursor/mcp.json.
{
"mcpServers": {
"myfunction": {
"url": "https://api.myfunction.dev/mcp"
}
}
}In Settings, open Connectors, add a custom connector, and paste the server URL.
https://api.myfunction.dev/mcpProject instructions
The server already asks clients to check Apps Script before returning it. To make that a standing rule, add this line to your project instructions, such as AGENTS.md, CLAUDE.md, or .github/copilot-instructions.md.
When you write or edit Google Apps Script (.gs) code, call the gas_diagnostics tool with every file in the project before you show me the result. Fix each reported error and call it again until no errors remain.Limits and data
The check is static. It does not run your script, so it cannot catch authorization prompts, quota limits, or errors that depend on the data in a spreadsheet. A project can hold up to 100 files, 200 KB per file, and 1 MB in total.
The tool reads only the files the assistant sends with each call. It never connects to your Apps Script projects or your Google Drive. The files are type-checked in memory on api.myfunction.dev and are not written to storage. myFunction stores your Google account identifier, email address, and name for the sign-in, and a monthly count of tool calls. When a call fails with an unexpected error, the error message is logged with your account identifier.
Each Google account gets 50 free tool calls per month. myFunction Pro at $5.99/month includes 10,000 tool calls per month. When the free calls run out, the tool returns a checkout link instead of diagnostics.
Same rules in the editor
The MCP server and the Chrome extension share one language service. The diagnostics reference explains common errors and how to fix them.