Command reference
A summary of the surface observed from the built CLI — the --help block below is an abridged summary, not the full output. For the authoritative text, run gsc-mcp --help against your install. There is no uninstall subcommand, no extra serve flag, and no profile management command.
Surface overview
gsc-mcp --help (abridged summary)
gsc-mcp [serve] [--profile <alias>] Start the MCP stdio server (default)
gsc-mcp setup [options] Guided Google sign-in and client config
gsc-mcp setup access readonly|full [--client <name>] [--dry-run] [--yes]
gsc-mcp setup enable-write [...] Deprecated: add legacy GSC_ENABLE_WRITE=1
gsc-mcp setup disable-write [...] Deprecated: remove legacy GSC_ENABLE_WRITE
gsc-mcp doctor [--online] Offline check (runtime, paths, env, auth state)
gsc-mcp auth login Connect Google in this terminal (browser)
gsc-mcp auth status [--online] Show session state without secrets
gsc-mcp auth logout Delete the local OAuth session
gsc-mcp auth revoke --yes Revoke at Google and delete locally
gsc-mcp config print --client <name> [--profile <alias>]
gsc-mcp --version / -v 0.1.0
gsc-mcp --help / -h / helpsetup
- Flags:
--client,--access readonly|full(default readonly),--site(repeatable, one identifier each, never comma-split),--all-sites,--auth shared|custom|service-account,--secrets <path>,--key-file <path>,--reauth,--force,--dry-run,--yes,--language en|es,--first-query,--install-skill,--help.--scopesand--enable-writeare deprecated — use--accessinstead. - Subcommands:
setup access readonly|fullchanges access on an existing client entry with no Google sign-in;setup enable-writeandsetup disable-writeonly touch the legacy write flag and are deprecated, never the primary path. --siteand--all-sitesare mutually exclusive.--dry-runnever calls Google.--language en|eswins overLC_ALL/LC_MESSAGES/LANG; only human copy is translated, never command names, flags, env keys, or property identifiers.
serve
- Serve is the default: bare
gsc-mcpstarts the MCP stdio server. It takes only--profile <alias>— anything else fails with an unknown-flag error. - A named profile loads that profile’s allowlist; otherwise the server uses
GSC_SITE_URLS. A missing alias errors with the fix. Datasets live 15 minutes per profile and never cross profiles.
doctor
- Offline by default: runtime,
auth_mode,site_urls, allowlist, write ops, and whether an OAuth token or service key exists — paths and booleans, never secrets. doctor --onlineadds exactly one boundedsites.listcall plus property and 29-tool catalog verification. Any other flag fails with an unknown-flag error.
auth
auth loginconnects Google in the current terminal via the browser. The MCP server never opens browsers by itself.auth statusshows local session state without secrets;auth status --onlineperforms minimal Google validation and distinguishes permission problems from a disabled API or an exhausted quota.auth logoutdeletes the local OAuth session only — service-account mode is unaffected and nothing is revoked at Google.auth revoke --yesrefuses without--yes, then revokes the cached token at Google and deletes it locally. Anything besideslogin|status|logout|revokeis rejected.
config print
config print --client <name> [--profile <alias>] prints one client snippet to copy. Unknown clients are rejected with the supported set:desktop, code, cursor, codex, generic.configaccepts onlyprint— there is no other config subcommand.
--help and --version
--help,-h, andhelpprint usage;--versionand-vprint 0.1.0.
Environment
| Variable | Meaning |
|---|---|
| GSC_AUTH_MODE | oauth | service_account (default service_account) |
| GSC_ACCESS_MODE | readonly | full (default readonly; full enables Google writes with no further confirm) |
| GSC_ENABLE_WRITE | Legacy: =1, only when GSC_ACCESS_MODE is unset |
| GSC_SITE_URLS | JSON array of exact property IDs, or "all" alone (explicit opt-in); legacy comma lists still read |
| GSC_DATA_DIR | Local state dir (default ~/.gsc-mcp) |
| GSC_KEY_FILE | Service-account JSON path |
| GSC_SCOPES | Legacy: readonly | full, only when GSC_ACCESS_MODE is unset |
| GSC_OAUTH_SECRETS_FILE | Custom OAuth: downloaded Desktop JSON path (wins over the env vars below) |
| GSC_OAUTH_CLIENT_ID | Custom OAuth: client ID env fallback when no secrets file is set |
| GSC_OAUTH_CLIENT_SECRET | Custom OAuth: client secret env fallback when no secrets file is set |
--yes never opts you into the first-query sample or the skill install below — each needs its own explicit flag. Skipping a prompt is not the same as consenting to an action.First-use opt-ins
--first-queryruns one minimal query on the first selected property: last 7 days, date breakdown, at most 5 rows, never query strings. Skipped for allow-all.--install-skillinstalls thegoogle-search-console-mcpskill globally through the pinned skills CLI, mappingcode→claude-code,cursor→cursor,codex→codex.- Three server-side prompts are registered for your agent:
seo_weekly_report(weekly KPIs, movers, opportunities),investigate_traffic_drop(pages/queries/segments decomposition),page_performance_review(one page plus its observed queries). A good first question:What are my quick win keywords?
- Every response carries its coverage and limitations — analyses describe returned rows, not all searches;
positionis an impression-weighted average. Named errors and their fixes live under Troubleshooting.