# Google Search Console MCP | GSC MCP (`datascoutapi/google-search-console-mcp`) Actor

Google Search Console MCP (GSC MCP) — connect GSC to any AI assistant. Get search analytics, inspect URLs for indexing problems, manage sitemaps, and track SEO performance. Supports Claude, Cursor, Codex, Gemini, Kiro, and VS Code. Runs on Apify.

- **URL**: https://apify.com/datascoutapi/google-search-console-mcp.md
- **Developed by:** [halam](https://apify.com/datascoutapi) (community)
- **Categories:** MCP servers, Agents, SEO tools
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## Google Search Console MCP Server

A Model Context Protocol (MCP) server that connects [Google Search Console](https://search.google.com/search-console/about) (GSC) to AI assistants, allowing you to analyze your SEO data through natural language conversations. Works with **Claude Desktop**, **Cursor**, **Codex CLI**, **Gemini CLI**, and any other MCP-compatible client.

No local installation needed — runs entirely on Apify. Just provide your Google credentials and connect.

---

### What Can This Do?

**Search Analytics & Reporting**
- Discover which queries bring visitors to your site
- Track impressions, clicks, and click-through rates
- Analyze performance trends and compare time periods
- Filter by country, device, search type
- Pagination up to 25,000 rows for bulk exports

**URL Inspection & Indexing**
- Check if specific pages have indexing problems
- See when Google last crawled your pages
- Inspect multiple URLs at once to identify patterns
- Detect canonical issues, robots blocks, and fetch errors

**Property Management**
- See all your GSC properties in one place
- Get verification details and ownership information
- Add or remove properties from your account

**Sitemap Management**
- View all sitemaps and their status
- Submit new sitemaps
- Check for errors or warnings

---

### Available Tools (20+)

| Tool | What It Does |
|------|-------------|
| `get_search_analytics` | Top queries and pages with clicks, impressions, CTR, position |
| `get_advanced_search_analytics` | Analytics with filters by country, device, query, page |
| `get_performance_overview` | Summary of site performance with daily trends |
| `compare_search_periods` | Compare performance between two time periods |
| `get_search_by_page_query` | Search terms driving traffic to a specific page |
| `inspect_url_enhanced` | Detailed crawl/index status for a URL |
| `batch_url_inspection` | Inspect up to 10 URLs at once |
| `check_indexing_issues` | Check multiple URLs for indexing problems |
| `list_properties` | Shows all your GSC properties |
| `get_site_details` | Details about a specific site |
| `get_sitemaps` | Lists all sitemaps for a site |
| `list_sitemaps_enhanced` | Detailed sitemap info including errors and warnings |
| `manage_sitemaps` | Submit or delete sitemaps |
| `get_capabilities` | Lists all tools and shows auth status |

---

### Getting Started

#### Step 1 — Create a Google Service Account

1. Go to [Google Cloud Console](https://console.cloud.google.com/) and create or select a project
2. [Enable the Search Console API](https://console.cloud.google.com/apis/library/searchconsole.googleapis.com)
3. Go to [IAM & Admin → Service Accounts](https://console.cloud.google.com/iam-admin/serviceaccounts) → click **+ Create Service Account** → give it a name (e.g. "gsc-mcp") → click **Create and Continue** → skip optional permissions → click **Done**
4. Click on the service account you just created → go to the **Keys** tab → **Add Key** → **Create new key** → select **JSON** → click **Create** — a `.json` file will download
5. **Find your service account email:** It's shown on the [Service Accounts](https://console.cloud.google.com/iam-admin/serviceaccounts) page (looks like `your-name@your-project-id.iam.gserviceaccount.com`). You can also find it in the downloaded JSON file under the `"client_email"` field.
6. **Add the email to GSC:** Go to [Google Search Console](https://search.google.com/search-console/) → Settings → Users and permissions → Add user → paste the service account email → set **Full** access

> ⚠️ **Important:** Do NOT use an OAuth client credential (created under Credentials → OAuth client ID). OAuth requires a browser login and does not work on Apify. You need a **Service Account key** (the downloaded JSON will have `"type": "service_account"` at the top).

#### Step 2 — Configure This Actor

1. Open this actor on Apify
2. In the **Input** tab, paste your service account JSON key into the "Service Account Credentials" field
3. Start the actor — it will run as an MCP server in standby mode

#### Step 3 — Connect Your AI Client

Once the actor is running, you'll get a standby URL. Use it in your MCP client config:

**Claude Desktop** (`~/Library/Application Support/Claude/claude_desktop_config.json`):
```json
{
  "mcpServers": {
    "gsc": {
      "url": "https://YOUR_ACTOR_STANDBY_URL/sse"
    }
  }
}
````

**Cursor** (`~/.cursor/mcp.json`):

```json
{
  "mcpServers": {
    "gsc": {
      "url": "https://YOUR_ACTOR_STANDBY_URL/sse"
    }
  }
}
```

**Windsurf** (`~/.codeium/windsurf/mcp_config.json`):

```json
{
  "mcpServers": {
    "gsc": {
      "url": "https://YOUR_ACTOR_STANDBY_URL/sse"
    }
  }
}
```

**Codex CLI** (`~/.codex/mcp.json`):

```json
{
  "mcpServers": {
    "gsc": {
      "url": "https://YOUR_ACTOR_STANDBY_URL/sse"
    }
  }
}
```

**Gemini CLI** (`~/.gemini/settings.json`):

```json
{
  "mcpServers": {
    "gsc": {
      "url": "https://YOUR_ACTOR_STANDBY_URL/sse"
    }
  }
}
```

**Kiro** (`.kiro/settings/mcp.json` in your workspace):

```json
{
  "mcpServers": {
    "gsc": {
      "url": "https://YOUR_ACTOR_STANDBY_URL/sse"
    }
  }
}
```

**VS Code (GitHub Copilot)** (`.vscode/mcp.json` in your workspace):

```json
{
  "mcpServers": {
    "gsc": {
      "url": "https://YOUR_ACTOR_STANDBY_URL/sse"
    }
  }
}
```

> 💡 Replace `YOUR_ACTOR_STANDBY_URL` with the actual standby URL from your Apify actor run. You can find it in the actor's **Runs** tab after starting it.

#### Step 4 — Test

Ask your AI assistant: **"List my GSC properties"**

If you see your properties — it's working!

***

### Troubleshooting

#### "No Search Console properties found"

The service account authenticated successfully but doesn't have access to any properties.

**Fix:** Go to Google Search Console → Settings → Users and permissions → Add the service account email with **Full** access.

#### "The provided credentials don't appear to be a service account key"

You pasted an OAuth client JSON (has `"web"` or `"installed"` at the top) instead of a service account JSON (has `"type": "service_account"`).

**Fix:** Go to Google Cloud Console → IAM → Service Accounts → Keys → Create new key → JSON. Use that file instead.

#### "Invalid JSON in serviceAccountJson field"

The JSON you pasted is malformed or incomplete.

**Fix:** Open the downloaded `.json` file in a text editor, select ALL content (Cmd+A / Ctrl+A), copy (Cmd+C / Ctrl+C), and paste directly into the input field. Make sure you include the opening `{` and closing `}`.

#### Service account from one project works but another doesn't

Each Google Cloud project needs the **Search Console API enabled separately**.

**Fix:** Go to `https://console.cloud.google.com/apis/library/searchconsole.googleapis.com?project=YOUR_PROJECT_ID` and click Enable.

#### "Permission denied" or "Forbidden" errors

The service account doesn't have sufficient access to the GSC property.

**Fix:** Ensure you added the service account email with **Full** (not Restricted) access in GSC Users and permissions.

***

### Sample Prompts

Once connected, try these with your AI assistant:

| What you want | What to ask |
|---|---|
| Top queries | "Show me the top 20 search queries for mysite.com in the last 30 days" |
| Performance overview | "Create a performance overview of mysite.com for the last 28 days, identify any drops or spikes" |
| Compare periods | "Compare my site's performance between May and June. What queries improved the most?" |
| Filter analytics | "Show queries with high impressions but positions below 10, filtered to mobile traffic in the US" |
| Find opportunities | "Find keywords where I rank on page 2 (positions 11-20) with high impressions" |
| Check indexing | "Check these pages for indexing issues: mysite.com/page1, mysite.com/page2, mysite.com/page3" |
| Inspect a URL | "Do a comprehensive inspection of mysite.com/landing-page" |
| See all properties | "List all my GSC properties" |

***

### Input Options

| Field | Required | Default | Description |
|---|---|---|---|
| Service Account JSON | Option 1 | — | Paste your entire Google Cloud service account JSON key |
| Service Account Email | Option 2 | — | The `client_email` from your service account JSON |
| Private Key | Option 2 | — | The `private_key` from your service account JSON |
| Project ID | Option 2 | — | The `project_id` from your service account JSON |
| Data Freshness | No | `all` | `all` = matches GSC dashboard. `final` = confirmed data only (2-3 day lag) |
| Allow Destructive | No | `false` | Enable add/delete site and delete sitemap tools |

***

### Safety

Tools that modify your account (`add_site`, `delete_site`, `delete_sitemap`) are disabled by default. To enable them, toggle **"Allow Destructive Operations"** to true in the actor input. We recommend keeping this off unless you specifically need to add or remove properties/sitemaps.

# Actor input Schema

## `serviceAccountJson` (type: `string`):

Paste your entire Google Cloud service account JSON key here. Go to Google Cloud Console → IAM → Service Accounts → Create Key (JSON). Then add the service account email to your GSC property under Settings → Users and permissions → Full access.

## `clientEmail` (type: `string`):

The service account email (e.g. my-account@my-project.iam.gserviceaccount.com). Use this if you prefer entering fields individually instead of pasting the full JSON.

## `privateKey` (type: `string`):

The private key from your service account (starts with -----BEGIN PRIVATE KEY-----). Copy the entire key including the BEGIN/END lines.

## `projectId` (type: `string`):

Your Google Cloud project ID (e.g. my-project-12345).

## `dataState` (type: `string`):

Controls data freshness. 'all' matches the GSC dashboard (includes fresh/unconfirmed data). 'final' returns only confirmed data with a 2-3 day lag.

## `allowDestructive` (type: `boolean`):

Enable add\_site, delete\_site, and delete\_sitemap tools. Disabled by default for safety.

## Actor input object example

```json
{
  "dataState": "all",
  "allowDestructive": false
}
```

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("datascoutapi/google-search-console-mcp").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("datascoutapi/google-search-console-mcp").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call datascoutapi/google-search-console-mcp --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=datascoutapi/google-search-console-mcp",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Google Search Console MCP | GSC MCP",
        "description": "Google Search Console MCP (GSC MCP) — connect GSC to any AI assistant. Get search analytics, inspect URLs for indexing problems, manage sitemaps, and track SEO performance. Supports Claude, Cursor, Codex, Gemini, Kiro, and VS Code. Runs on Apify.",
        "version": "0.3",
        "x-build-id": "hMRfGRP8cNcpp0iGL"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/datascoutapi~google-search-console-mcp/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-datascoutapi-google-search-console-mcp",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/datascoutapi~google-search-console-mcp/runs": {
            "post": {
                "operationId": "runs-sync-datascoutapi-google-search-console-mcp",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/datascoutapi~google-search-console-mcp/run-sync": {
            "post": {
                "operationId": "run-sync-datascoutapi-google-search-console-mcp",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "serviceAccountJson": {
                        "title": "Option 1: Service Account JSON (paste full key)",
                        "type": "string",
                        "description": "Paste your entire Google Cloud service account JSON key here. Go to Google Cloud Console → IAM → Service Accounts → Create Key (JSON). Then add the service account email to your GSC property under Settings → Users and permissions → Full access."
                    },
                    "clientEmail": {
                        "title": "Option 2: Service Account Email",
                        "type": "string",
                        "description": "The service account email (e.g. my-account@my-project.iam.gserviceaccount.com). Use this if you prefer entering fields individually instead of pasting the full JSON."
                    },
                    "privateKey": {
                        "title": "Option 2: Private Key",
                        "type": "string",
                        "description": "The private key from your service account (starts with -----BEGIN PRIVATE KEY-----). Copy the entire key including the BEGIN/END lines."
                    },
                    "projectId": {
                        "title": "Option 2: Project ID",
                        "type": "string",
                        "description": "Your Google Cloud project ID (e.g. my-project-12345)."
                    },
                    "dataState": {
                        "title": "Data Freshness",
                        "enum": [
                            "all",
                            "final"
                        ],
                        "type": "string",
                        "description": "Controls data freshness. 'all' matches the GSC dashboard (includes fresh/unconfirmed data). 'final' returns only confirmed data with a 2-3 day lag.",
                        "default": "all"
                    },
                    "allowDestructive": {
                        "title": "Allow Destructive Operations",
                        "type": "boolean",
                        "description": "Enable add_site, delete_site, and delete_sitemap tools. Disabled by default for safety.",
                        "default": false
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
