Google Search Console MCP Server

Google Search Console MCP Server

Enables AI agents to query Google Search Console data including search analytics, URL inspection, sitemap management, and site performance monitoring, with per-user OAuth authentication.

Category
Visit Server

README

Google Search Console MCP Server

A stateless, multi-tenant HTTP MCP (Model Context Protocol) server for Google Search Console, designed to run on Google Cloud Run and connect to AI agent platforms like Obot.

Connect your AI agents to Google Search Console data — query search analytics, inspect URL indexing, manage sitemaps, and monitor site performance — all authenticated through each user's own Google account via OAuth.


How It Works

  • Each user signs in with their own Google account through OAuth
  • The server validates the user's Bearer token on every request via Google's tokeninfo endpoint
  • All Google Search Console API calls are made using that user's token — they can only access properties they already have access to in Search Console
  • No credentials are stored on the server; it is fully stateless and multi-tenant

Tools

# Tool Description
1 gsc_list_properties List all GSC properties the authenticated user can access
2 gsc_get_site_details Get details for a specific property
3 gsc_add_site Add a new site to Search Console
4 gsc_delete_site Remove a site from Search Console
5 gsc_get_search_analytics Query clicks, impressions, CTR, and position by query/page/device/country
6 gsc_get_advanced_search_analytics Full analytics query with date ranges, filters, sorting, and pagination
7 gsc_compare_periods Compare search performance between two date ranges
8 gsc_get_page_queries Top queries driving traffic to a specific page
9 gsc_inspect_url Full URL inspection — indexing status, crawl state, canonicals, rich results
10 gsc_batch_inspect_urls Inspect up to 10 URLs and return a summary
11 gsc_check_indexing_issues Categorize up to 10 URLs by indexing issue type
12 gsc_get_performance_overview Aggregate totals and daily trend for a property
13 gsc_list_sitemaps List all submitted sitemaps for a property
14 gsc_get_sitemap_details Full details for a specific sitemap
15 gsc_submit_sitemap Submit a sitemap URL to Search Console
16 gsc_delete_sitemap Remove a sitemap from Search Console

Prerequisites


1. Enable Required Google APIs

In the Google Cloud project that owns your OAuth client, enable the Search Console APIs:

gcloud services enable webmasters.googleapis.com searchconsole.googleapis.com \
  --project=YOUR_PROJECT_ID

2. Create an OAuth Client in Google Cloud

  1. Go to APIs & Services → Credentials → Create Credentials → OAuth client ID
  2. Application type: Web application
  3. Add an authorized redirect URI:
    https://YOUR_OBOT_HOST/oauth/mcp/callback
    
  4. Note the Client ID and Client Secret — you'll need them in Obot

If you already have an OAuth client for another MCP server (e.g. Google Analytics), you can reuse it — just add the webmasters scope to your OAuth consent screen:

APIs & Services → OAuth consent screen → Edit App → Add or remove scopes

Add: https://www.googleapis.com/auth/webmasters


3. Build and Push the Docker Image

The container must target linux/amd64 for Cloud Run (important if building on Apple Silicon).

PROJECT=your-gcp-project-id
REGION=us-central1
REPO=cloud-run-images
IMAGE_NAME=gsc-mcp-oauth
IMAGE="${REGION}-docker.pkg.dev/${PROJECT}/${REPO}/${IMAGE_NAME}:v1"

# Build for linux/amd64
docker build --platform linux/amd64 -t "${IMAGE_NAME}:v1" .

# Tag and push to Artifact Registry
docker tag "${IMAGE_NAME}:v1" "$IMAGE"
docker push "$IMAGE"

If the Artifact Registry repository doesn't exist yet:

gcloud artifacts repositories create cloud-run-images \
  --repository-format=docker \
  --location=$REGION \
  --project=$PROJECT

4. Deploy to Cloud Run

On the first deploy, use a placeholder MCP_BASE_URL — then redeploy once you have the real service URL.

First deploy (to get the URL):

gcloud run deploy gsc-mcp-oauth \
  --image "$IMAGE" \
  --region $REGION \
  --platform managed \
  --allow-unauthenticated \
  --set-env-vars MCP_BASE_URL=placeholder \
  --project $PROJECT

Capture the assigned URL from the output, then redeploy with it:

SERVICE_URL="https://gsc-mcp-oauth-XXXXXXXXXX.us-central1.run.app"

gcloud run deploy gsc-mcp-oauth \
  --image "$IMAGE" \
  --region $REGION \
  --platform managed \
  --allow-unauthenticated \
  --set-env-vars MCP_BASE_URL=$SERVICE_URL \
  --project $PROJECT

5. Verify the Deployment

SERVICE_URL="https://gsc-mcp-oauth-XXXXXXXXXX.us-central1.run.app"

# Protected resource metadata — should list Google as the authorization server
curl -s "$SERVICE_URL/.well-known/oauth-protected-resource/mcp" | python3 -m json.tool

# No token → should return 401
curl -s -o /dev/null -w "No token → HTTP %{http_code}\n" "$SERVICE_URL/mcp"

# Invalid token → should return 400 (not 500)
curl -s -o /dev/null -w "Bad token → HTTP %{http_code}\n" \
  -H "Authorization: Bearer invalid_token" "$SERVICE_URL/mcp"

Expected metadata response:

{
  "resource": "https://your-service-url/mcp",
  "authorization_servers": ["https://accounts.google.com/"],
  "scopes_supported": ["https://www.googleapis.com/auth/webmasters"],
  "bearer_methods_supported": ["header"],
  "resource_name": "Google Search Console MCP Server"
}

6. Connect to Obot

Obot handles the OAuth flow for your users — they sign in with Google through Obot, and Obot passes their Bearer token to this server on each request.

  1. In Obot, go to MCP Servers → Add MCP Server

  2. Enter the server URL:

    https://your-service-url/mcp
    
  3. Go to Advanced Configuration → Static OAuth and configure:

    Field Value
    Authorization Server https://accounts.google.com
    Client ID Your Google OAuth Client ID
    Client Secret Your Google OAuth Client Secret
    Scopes https://www.googleapis.com/auth/webmasters
  4. Save — users can now authenticate with their own Google accounts and access their Search Console data through your agents.


Project Structure

├── Dockerfile
├── pyproject.toml
└── src/
    └── gsc_mcp_oauth/
        ├── __init__.py
        ├── __main__.py          # Entry point — reads PORT and MCP_BASE_URL
        ├── auth.py              # Token verification + RemoteAuthProvider
        ├── gsc_clients.py       # httpx helpers + URL encoding utilities
        ├── server.py            # FastMCP server factory
        └── tools/
            ├── properties.py    # Site listing, add, delete, details
            ├── analytics.py     # Search analytics queries
            ├── inspection.py    # URL inspection and indexing checks
            └── sitemaps.py      # Sitemap management

Environment Variables

Variable Required Description
MCP_BASE_URL Yes (production) The public URL of this Cloud Run service — used to generate OAuth metadata endpoints
PORT No HTTP port (default: 8080, set automatically by Cloud Run)

Dependencies

  • fastmcp >= 3.1.0 — MCP server framework with RemoteAuthProvider
  • httpx >= 0.28.1 — async HTTP client for all Google API calls

No google-api-python-client, google-auth, or gRPC dependencies. Authentication is handled entirely via Bearer token passthrough.


License

MIT

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured