Gas setup
First-time setup and authorization for Google Apps Script development. Use when the user wants to set up Apps Script access, authorize Google, fix NO_CLIENT / NO_TOKENS / NOT_AUTHENTICATED errors, or says 設定授權 / 初始化 / 連接 Google Apps Script / OAuth 設定. Also use when any gas MCP tool fails with an OAuth or credential error.From its SKILL.md
npx -y skills add chiwangtw/gas-dev-kit --skill gas-setupAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
4.7 KB, as published. Nobody here has run it
Apps Script setup & authorization
Guide the user through a one-time setup, step by step. Never dump all steps at once — run a step, read the result, then move on. All commands run from the plugin root; define a shorthand first:
GASAUTH='node "${CLAUDE_PLUGIN_ROOT}/mcp-server/bin/gas-auth.js"'
Step 0 — Check current state
$GASAUTH --check
STATUS: AUTHENTICATED→ auth is done. Jump to Step 4 (Confirm).STATUS: NO_CLIENT→ continue with Step 1.STATUS: NO_TOKENS→ skip to Step 3.- If node_modules is missing, first run:
cd "${CLAUDE_PLUGIN_ROOT}/mcp-server" && npm install
Step 1 — Create your own OAuth client
Walk the user through Google Cloud Console to create a new OAuth client. They must be logged in with the Google account they want to use for Apps Script development. Ask User whether they have the experience to do this themselves;if yes, get the whole following instructions to them; if not, guide them step by step with the following instructions(or they want to ask you to do it for them, you can do it for them with their other MCP plugin like Claude in Chrome). The instructions:
- Create/select a project: https://console.cloud.google.com/projectselector2/home/dashboard
- Enable Google Apps Script API: https://console.cloud.google.com/apis/library/script.googleapis.com
- Configure the OAuth consent screen (External + add themselves as a test user): https://console.cloud.google.com/auth/audience
- Create credentials → OAuth client ID → Application type Web application → add redirect URI exactly
http://localhost:3001/oauth/callback: https://console.cloud.google.com/apis/credentials - Download the JSON or copy the client ID/secret. Go to Step 2.
Step 2 — Save the client credentials
Either form works; credentials are stored with 0600 permissions in the OS config dir (never in .env, never in the repo):
$GASAUTH --save-client 'CLIENT_ID' 'CLIENT_SECRET'
$GASAUTH --client-file /path/to/client_secret_xxx.json
Expect STATUS: CLIENT_SAVED.
Step 3 — Authorize
Two paths — pick by environment. In a remote sandbox (Cowork: Linux, no local browser/$DISPLAY) use 3B; on the user's own machine use 3A. (--authorize in a headless environment fails fast with STATUS: HEADLESS and points to 3B.)
3A — Local machine (browser available)
$GASAUTH --authorize
A browser opens; the user picks their Google account and approves. A local callback on port 3001 captures the code automatically — no copy-pasting. Tell the user before running it that a browser window will open.
Common failures:
Error 403: access_denied→ the account is not a test user on the OAuth consent screen. Send them to https://console.cloud.google.com/auth/audience → Test users → Add users.- Port 3001 in use → ask the user to close whatever holds it (often another MCP SSE server), retry.
- Timeout after 5 min → just rerun.
3B — Sandbox / remote (paste-back flow)
- Run
$GASAUTH --auth-url→ printsSTATUS: AUTH_URL_READYand a Google consent URL. Give the URL to the user in ONE message that both asks them to open it in their own browser and approve, AND warns them up front: after approving, the browser will land on a localhost page that fails to load — this is expected; copy the FULL address-bar URL and paste it back into the chat. - Run
$GASAUTH --exchange '<pasted URL>'→ expectSTATUS: AUTHENTICATED.STATUS: AUTH_FAILEDmentioninginvalid_grant→ the code expired (~10 min) or was already used; restart from step 1.- The 403 access_denied consent-screen failure from 3A applies here too.
- Recommended: run
$GASAUTH --export-envand have the user store the printedGOOGLE_APP_SCRIPT_API_REFRESH_TOKEN=...line in the environment (e.g. Cowork env settings). New sessions with that variable set skip authorization entirely.
Then verify with $GASAUTH --check → must print STATUS: AUTHENTICATED. Tokens refresh automatically from now on.
Step 4 — Confirm
Run $GASAUTH --check one last time and summarize: API auth ✓. Suggest trying: 「列出我的 Apps Script 專案」 or editing a project with the gas-dev workflow.
Revoking / switching accounts
$GASAUTH --revoke # delete tokens only
$GASAUTH --revoke --all # also delete the stored client credentials