Google Search Console MCP Server

A Model Context Protocol (MCP) server for Google Search Console, deployed on Cloudflare Workers. This server provides comprehensive access to Search Console data including property management, search analytics, URL inspection, and sitemap management.

Features

Available Tools

Property Management Tools

list_properties

List all Google Search Console properties you have access to.

Use this tool when:

Parameters:

Returns a table with site URLs and permission levels.

get_property_details

Get detailed information about a specific Search Console property.

Use this tool when:

Parameters:

Example:

{
  "siteUrl": "https://example.com/"
}

add_property

Add a new site to Google Search Console. Note: You will still need to verify ownership in the Search Console UI.

Use this tool when:

Parameters:

Example:

{
  "siteUrl": "https://example.com/"
}

delete_property

Remove a site from your Google Search Console. This does not affect your actual website.

Use this tool when:

Parameters:

Search Analytics Tools

get_search_analytics

Query Google Search Console analytics data. Get clicks, impressions, CTR, and position grouped by dimensions like query, page, device, or country.

Use this tool when:

Parameters:

Example:

{
  "siteUrl": "https://example.com/",
  "startDate": "2024-01-01",
  "endDate": "2024-01-31",
  "dimensions": ["query", "page"],
  "rowLimit": 100
}

get_performance_summary

Get a high-level performance summary with total clicks, impressions, average CTR, and average position.

Use this tool when:

Parameters:

compare_periods

Compare search performance metrics between two different date ranges.

Use this tool when:

Parameters:

get_top_queries

Get the top search queries for a site, sorted by clicks or impressions.

Use this tool when:

Parameters:

get_top_pages

Get the top performing pages for a site.

Use this tool when:

Parameters:

get_queries_for_page

Get search queries that are driving traffic to a specific page URL.

Use this tool when:

Parameters:

get_fresh_data

Get fresh (non-finalized) search analytics data. This includes data that may still change as Google processes it.

Use this tool when:

Parameters:

URL Inspection Tools

inspect_url

Inspect a URL to get its indexing status, crawl information, mobile usability, and rich results status.

Use this tool when:

Parameters:

Example:

{
  "siteUrl": "https://example.com/",
  "inspectionUrl": "https://example.com/page"
}

batch_inspect_urls

Inspect multiple URLs in batch. Returns a summary of indexing status for each URL. Limited to 10 URLs per batch.

Use this tool when:

Parameters:

check_indexing_status

Quick check if a URL is indexed in Google Search.

Use this tool when:

Parameters:

check_indexing_issues

Analyze multiple URLs for indexing issues and categorize problems (robots blocked, canonical issues, fetch errors, etc.).

Use this tool when:

Parameters:

test_mobile_friendly

Run a Mobile-Friendly Test on a URL to check if it's optimized for mobile devices.

Use this tool when:

Parameters:

Sitemap Management Tools

list_sitemaps

List all sitemaps submitted for a Search Console property.

Use this tool when:

Parameters:

get_sitemap

Get detailed information about a specific sitemap, including URL counts and errors.

Use this tool when:

Parameters:

submit_sitemap

Submit a new sitemap to Google Search Console. Google will periodically fetch and process this sitemap.

Use this tool when:

Parameters:

delete_sitemap

Remove a sitemap from Google Search Console. This does not delete the sitemap file from your server.

Use this tool when:

Parameters:

refresh_sitemap

Request Google to re-fetch a sitemap. Useful after making updates to your sitemap.

Use this tool when:

Parameters:

list_sitemaps_from_index

List child sitemaps from a sitemap index. Use this when you have a sitemap index file that references multiple sitemaps.

Use this tool when:

Parameters:

OAuth Configuration

How It Works

The server uses OAuth 2.0 with Google for authentication. When an MCP client connects, users are redirected to Google to authorize access to their Search Console data.

Setting Up Google OAuth

  1. Go to Google Cloud Console
  2. Create a new project or select an existing one
  3. Enable the Search Console API
  4. Create OAuth 2.0 credentials (Web application)
  5. Add authorized redirect URI: https://gsc.arya.sh/callback (or your domain)
  6. Set the client ID and secret as Cloudflare secrets

Required Scopes

The server requests the following Google OAuth scope:

MCP Client Configuration

Cloudflare AI Playground

Connect directly from the Cloudflare AI Playground:

  1. Go to https://playground.ai.cloudflare.com/
  2. Enter your MCP server URL: https://gsc.arya.sh/mcp
  3. Authenticate with Google OAuth when prompted
  4. Start using the tools!

Claude Desktop

Use the mcp-remote proxy to connect:

{
  "mcpServers": {
    "google-search-console": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "https://gsc.arya.sh/mcp"
      ]
    }
  }
}

Restart Claude Desktop after updating the configuration.

Other MCP Clients

The server supports the standard MCP HTTP transport. Connect to:

Architecture

Components

Data Flow

  1. MCP client sends request to /mcp endpoint
  2. OAuth provider authenticates the request
  3. Request routed to GscMCP Durable Object
  4. Tool handler executes and calls Google Search Console API
  5. Response formatted as Markdown
  6. Returned to MCP client

Authentication Flow

  1. User initiates OAuth via /authorize endpoint
  2. User redirected to Google OAuth consent screen
  3. Google redirects back to /callback with authorization code
  4. Server exchanges code for access and refresh tokens
  5. Tokens stored in Durable Object Props
  6. OAuth flow completed, user redirected back to MCP client

Token Management

API Rate Limits

Google Search Console API has the following quotas:

The server respects these limits and includes rate limit handling in error responses.

References