MCP Hub
Back to servers

search-console-mcp

Model Context Protocol (MCP) server that provides AI agents with access to Google Search Console data.

Stars
1
Updated
Feb 4, 2026
Validated
Mar 16, 2026

Google Search Console MCP Server

A Model Context Protocol (MCP) server that provides AI agents with access to Google Search Console data.

License: MIT

Quick Start

For users with an MCP-compatible client (like Claude Desktop):

npx search-console-mcp

Table of Contents


Features

  • Sites Management: List, add, and delete sites
  • Sitemaps: List, submit, get, and delete sitemaps
  • Search Analytics: Query performance data with advanced filtering and pagination
  • Period Comparison: Compare metrics between two date ranges
  • Top Queries/Pages: Get top performing queries and pages
  • URL Inspection: Check indexing status of specific URLs
  • AI Documentation: Built-in docs for AI agents to understand GSC concepts

Installation

Option 1: Use with npx (Recommended)

No installation needed. Configure your MCP client to run:

npx search-console-mcp

Option 2: Global Install

npm install -g search-console-mcp
search-console-mcp

Option 3: Clone for Development

git clone https://github.com/saurabhsharma2u/search-console-mcp.git
cd search-console-mcp
npm install
npm run build
node dist/index.js

Google Cloud Setup

Step 1: Create a Google Cloud Project

  1. Go to Google Cloud Console
  2. Create a new project or select an existing one
  3. Enable the Google Search Console API:
    • Go to APIs & Services > Library
    • Search for "Google Search Console API"
    • Click Enable

Step 2: Create a Service Account

  1. Go to APIs & Services > Credentials
  2. Click Create Credentials > Service Account
  3. Fill in the details and click Create
  4. Skip the optional steps and click Done
  5. Click on the service account email to open it
  6. Go to the Keys tab > Add Key > Create new key
  7. Select JSON and download the key file

Step 3: Grant Access in Search Console

  1. Go to Google Search Console
  2. Select your property
  3. Go to Settings > Users and permissions
  4. Click Add user
  5. Enter the service account email (e.g., my-service@project.iam.gserviceaccount.com)
  6. Set permission to Full (for write operations) or Restricted (read-only)

Step 4: Configure Credentials

Option A: File-based (Local Development)

export GOOGLE_APPLICATION_CREDENTIALS="/path/to/your/service-account-key.json"

Option B: Environment Variables (Serverless/Cloudflare)

export GOOGLE_CLIENT_EMAIL="your-service-account@project.iam.gserviceaccount.com"
export GOOGLE_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----"

MCP Client Configuration

Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "google-search-console": {
      "command": "npx",
      "args": ["search-console-mcp"],
      "env": {
        "GOOGLE_APPLICATION_CREDENTIALS": "/path/to/your/service-account-key.json"
      }
    }
  }
}

Generic MCP Client

{
  "name": "google-search-console",
  "command": "npx",
  "args": ["search-console-mcp"],
  "env": {
    "GOOGLE_APPLICATION_CREDENTIALS": "/path/to/your/service-account-key.json"
  }
}

Local Development

Setup

# Clone the repository
git clone https://github.com/saurabhsharma2u/search-console-mcp.git
cd search-console-mcp

# Install dependencies
npm install

# Create .env file
cp .env.example .env
# Edit .env with your credentials

# Build
npm run build

# Run tests
npm test

# Run the server
node dist/index.js

Project Structure

src/
├── index.ts          # MCP server entry point
├── google-client.ts  # Google API authentication
├── errors.ts         # Error handling utilities
├── docs/             # Embedded documentation for AI
│   ├── dimensions.ts
│   ├── filters.ts
│   ├── search-types.ts
│   └── patterns.ts
└── tools/            # Tool implementations
    ├── sites.ts
    ├── sitemaps.ts
    ├── analytics.ts
    └── inspection.ts

Tools Reference

Sites

ToolDescriptionArguments
sites_listList all sitesnone
sites_addAdd a sitesiteUrl
sites_deleteDelete a sitesiteUrl
sites_getGet site detailssiteUrl

Sitemaps

ToolDescriptionArguments
sitemaps_listList sitemapssiteUrl
sitemaps_getGet sitemap detailssiteUrl, feedpath
sitemaps_submitSubmit sitemapsiteUrl, feedpath
sitemaps_deleteDelete sitemapsiteUrl, feedpath

Analytics

ToolDescriptionArguments
analytics_queryQuery search analytics with filterssiteUrl, startDate, endDate, dimensions?, type?, limit?, startRow?, filters?
analytics_performance_summaryGet aggregate metrics for N dayssiteUrl, days?
analytics_compare_periodsCompare two date rangessiteUrl, period1Start, period1End, period2Start, period2End
analytics_top_queriesGet top queriessiteUrl, days?, limit?, sortBy?
analytics_top_pagesGet top pagessiteUrl, days?, limit?, sortBy?

Inspection

ToolDescriptionArguments
inspection_inspectInspect URL index statussiteUrl, inspectionUrl, languageCode?

PageSpeed Insights

ToolDescriptionArguments
pagespeed_analyzePageSpeed Insights scores (performance, accessibility, SEO)url, strategy? (mobile/desktop)
pagespeed_core_web_vitalsCore Web Vitals for mobile & desktop (LCP, FID, CLS, etc.)url

SEO Insights

ToolDescriptionArguments
seo_recommendationsGenerate actionable SEO recommendationssiteUrl, days?
seo_low_hanging_fruitFind keywords at positions 5-20 with high impressionssiteUrl, days?, minImpressions?, limit?
seo_cannibalizationDetect pages competing for the same keywordssiteUrl, days?, minImpressions?, limit?
seo_quick_winsFind pages close to page 1 (positions 11-20)siteUrl, days?, minImpressions?, limit?

Resources

AI agents can read these built-in documentation and data resources:

URIDescription
sites://listList of all sites (JSON)
sitemaps://list/{siteUrl}Sitemaps for a specific site (JSON)
analytics://summary/{siteUrl}Performance summary for a site (JSON)
docs://dimensionsAvailable dimensions reference
docs://filtersFilter operators and examples
docs://search-typesSearch types (web, image, video, etc.)
docs://patternsCommon usage patterns and recipes

Prompts

Pre-configured analysis workflows for AI agents:

PromptDescriptionArguments
analyze-site-performanceAnalyze site's 28-day performancesiteUrl
compare-performanceCompare this week vs last weeksiteUrl
find-declining-pagesFind pages losing trafficsiteUrl
keyword-opportunitiesFind low-CTR high-impression queriessiteUrl
new-content-impactAnalyze new content performancesiteUrl, pageUrl
mobile-vs-desktopCompare device performancesiteUrl

Contributing

See CONTRIBUTING.md for contribution guidelines.

Roadmap

See ROADMAP.md for planned features.

License

MIT - see LICENSE

Reviews

No reviews yet

Sign in to write a review