{"slug": "how-i-connected-google-search-console-to-claude-code-with-mcp", "title": "How I Connected Google Search Console to Claude Code with MCP", "summary": "A developer connected Google Search Console to Claude Code using Amin Forou's open-source mcp-gsc server, enabling natural language queries for SEO analysis. The integration uses MCP over stdio and OAuth 2.0 to access Search Console data, with tools for performance analysis, URL inspection, and sitemap management. The setup requires a Google Cloud project, OAuth credentials, and the uvx package runner, with a note about token expiration for external apps in Testing mode.", "body_md": "I wanted to analyze Google Search Console data without jumping between GSC, spreadsheets, and my codebase.\n\nSo I connected GSC to Claude Code using [Amin Forou's open-source mcp-gsc server](https://github.com/AminForou/mcp-gsc).\n\nNow I can ask:\n\nClaude retrieves the relevant data, analyzes it alongside my code, and helps me decide what to change.\n\n```\nClaude Code\n    ↓ MCP over stdio\nmcp-gsc running locally\n    ↓ OAuth 2.0\nGoogle Search Console API\n```\n\nThe MCP server converts Search Console operations into tools Claude can call. It supports performance analysis, URL inspection, sitemap management, period comparisons, and property discovery.\n\nI used OAuth so the server could access the same GSC properties as my Google account.\n\nOpen the [Google Cloud Console](https://console.cloud.google.com/) and create a dedicated project.\n\nThen:\n\nThe authorized Google account must already have access to the Search Console property.\n\nThe server requests this scope:\n\n```\nhttps://www.googleapis.com/auth/webmasters\n```\n\nThis is the read/write Search Console scope. Destructive mcp-gsc operations remain disabled unless `GSC_ALLOW_DESTRUCTIVE=true`\n\nis explicitly set.\n\nImportant: for an external app in Testing, Google normally expires the authorization and refresh token after seven days. If authentication suddenly stops, run the reauthentication tool and approve access again.\n\nIn **Google Auth Platform → Clients**:\n\nExample:\n\n```\n/Users/yourname/Documents/credentials/gsc-client-secrets.json\n```\n\nNever commit this file to Git.\n\nThe simplest method uses `uvx`\n\n, which runs the package in an isolated Python environment.\n\nInstall `uv`\n\nusing its [official installation guide](https://docs.astral.sh/uv/getting-started/installation/), then verify it:\n\n```\nuv --version\nuvx --version\nwhich uvx\n```\n\nKeep the full path returned by `which uvx`\n\n. Claude Code may not inherit your terminal's `PATH`\n\n, so using only `uvx`\n\ncan cause a `spawn uvx ENOENT`\n\nerror.\n\nReplace the example paths with absolute paths from your machine:\n\n```\nclaude mcp add-json --scope user gscServer '{\n  \"type\": \"stdio\",\n  \"command\": \"/Users/yourname/.local/bin/uvx\",\n  \"args\": [\"mcp-search-console\"],\n  \"env\": {\n    \"GSC_OAUTH_CLIENT_SECRETS_FILE\": \"/Users/yourname/Documents/credentials/gsc-client-secrets.json\"\n  }\n}'\n```\n\nI used user scope so the integration was available across my local projects without committing credential paths to a repository.\n\nVerify the configuration:\n\n```\nclaude mcp list\nclaude mcp get gscServer\n```\n\nStart Claude Code and ask:\n\n```\nCall the GSC get_capabilities tool and report the authentication status.\n```\n\nThe first request opens Google's OAuth flow in your browser. Sign in with the test-user account and approve access.\n\nThen ask:\n\n```\nList every Search Console property I can access and show its exact identifier.\n```\n\nUse the identifier returned by the API. Search Console has two formats:\n\n```\nDomain property:     sc-domain:example.com\nURL-prefix property: https://www.example.com/\n```\n\nThe protocol, hostname, and trailing slash must match exactly for URL-prefix properties.\n\nThe server exposes tools including:\n\n`get_performance_overview`\n\n`get_search_analytics`\n\n`get_advanced_search_analytics`\n\n`compare_search_periods`\n\n`get_search_by_page_query`\n\n`inspect_url_enhanced`\n\n`batch_url_inspection`\n\n`check_indexing_issues`\n\n`list_sitemaps_enhanced`\n\n`reauthenticate`\n\nFor recent dashboard-like data, keep the default `GSC_DATA_STATE=all`\n\n. For stable reporting with a short delay, use `GSC_DATA_STATE=final`\n\n.\n\n```\nFor sc-domain:example.com, find non-branded queries with at least 500 impressions and positions from 11 to 20 in the last 28 days. Group them by ranking page and recommend whether to update an existing page or create a new one.\nFind pages ranking in positions 1 to 10 with at least 1,000 impressions and CTR below 2%. Show their leading queries and suggest accurate title improvements.\nCompare the latest 28 complete days with the previous 28 days. Separate changes caused by impressions, CTR, and position. Show the ten biggest winning and losing pages.\nInspect the ten highest-click landing pages. Flag canonical mismatches, robots restrictions, crawl failures, and pages missing from Google's index.\n```\n\n**Authentication fails after seven days:** Your external OAuth app is still in Testing. Call `reauthenticate`\n\nand approve access again.\n\n** spawn uvx ENOENT:** Use the complete path returned by\n\n`which uvx`\n\n.**Credentials file not found:** Use an absolute path in `GSC_OAUTH_CLIENT_SECRETS_FILE`\n\n.\n\n**Property returns 404:** Run `list_properties`\n\nand copy the exact `sc-domain:`\n\nor URL-prefix value.\n\n**No MCP tools appear:** Check `claude mcp list`\n\n. Manual repository installations also require Python 3.11 or newer.\n\nMy SEO workflow changed from:\n\n```\nGSC → CSV export → spreadsheet → codebase\n```\n\nto:\n\n```\nSearch data → opportunity → page → code change → measurement\n```\n\nThe biggest benefit is not generating more SEO content. It is giving the coding assistant real search data so it can investigate the correct page before making a change.\n\nDisclosure: I used AI to help edit this article. The setup is based on my own implementation and was manually verified.", "url": "https://wpnews.pro/news/how-i-connected-google-search-console-to-claude-code-with-mcp", "canonical_source": "https://dev.to/iammofidul/how-i-connected-google-search-console-to-claude-code-with-mcp-343i", "published_at": "2026-08-24 08:55:39+00:00", "updated_at": "2026-08-24 09:13:35.722058+00:00", "lang": "en", "topics": ["developer-tools", "ai-tools", "ai-agents"], "entities": ["Google Search Console", "Claude Code", "mcp-gsc", "Amin Forou", "Google Cloud Console", "OAuth 2.0", "uvx", "Google Auth Platform"], "alternates": {"html": "https://wpnews.pro/news/how-i-connected-google-search-console-to-claude-code-with-mcp", "markdown": "https://wpnews.pro/news/how-i-connected-google-search-console-to-claude-code-with-mcp.md", "text": "https://wpnews.pro/news/how-i-connected-google-search-console-to-claude-code-with-mcp.txt", "jsonld": "https://wpnews.pro/news/how-i-connected-google-search-console-to-claude-code-with-mcp.jsonld"}}