@swingerman/gsc-mcp
v1.0.0
Published
MCP server for Google Search Console (one site per instance via GSC_SITE_URL)
Readme
gsc-mcp
Stdio MCP server for Google Search Console. One site per instance.
Tools: gsc_search_analytics, gsc_top_queries, gsc_top_pages, gsc_url_inspection, gsc_coverage, gsc_sitemaps, gsc_web_vitals.
Use from a project's .mcp.json
"gsc": {
"command": "npx",
"args": ["-y", "@swingerman/[email protected]"],
"env": {
"GSC_SITE_URL": "sc-domain:example.com",
"GSC_CLIENT_ID": "${GSC_CLIENT_ID}",
"GSC_CLIENT_SECRET": "${GSC_CLIENT_SECRET}",
"GSC_REFRESH_TOKEN": "${GSC_REFRESH_TOKEN}",
"GSC_API_KEY": "${GSC_API_KEY}"
}
}Env
| var | required | purpose |
|---|---|---|
| GSC_SITE_URL | yes | property, e.g. sc-domain:example.com (per project, not secret) |
| GSC_CLIENT_ID, GSC_CLIENT_SECRET | yes | Google OAuth client (webmasters.readonly) |
| GSC_REFRESH_TOKEN | headless | refresh token; wins over the credentials file (use in routines/CI) |
| GSC_CREDENTIALS_PATH | no | credentials file, default ~/.mmc-gsc-credentials.json ({refresh_token, client_id?, client_secret?}) |
| GSC_API_KEY | web vitals only | Google API key for CrUX (gsc_web_vitals) |
Get a refresh token (one-time)
GSC_CLIENT_ID=... GSC_CLIENT_SECRET=... npm run auth # writes GSC_CREDENTIALS_PATHRedirect URI defaults to http://localhost:8080/adsense/callback (override: GSC_REDIRECT_URI); it must be registered on the OAuth client.
