Skip to content

Connect Google Search Console to ChatGPT: Manage Sites and Analytics

Learn how to build a production-ready MCP server for Google Search Console, connect it to ChatGPT, and automate SEO data extraction and indexing workflows.

Roopendra Talekar Roopendra Talekar · · 10 min read

If you want to connect Google Search Console to ChatGPT so your AI agents can manage site properties, audit sitemaps, and run complex search analytics queries, you need a Model Context Protocol (MCP) server. This server acts as the translation layer between ChatGPT's JSON-RPC tool calls and Google's REST APIs. You can either build and maintain this infrastructure yourself, or use a managed integration platform like Truto to dynamically generate a secure, authenticated MCP server URL.

If your team uses Claude, check out our guide on connecting Google Search Console to Claude or explore our broader architectural overview on connecting Google Search Console to AI Agents.

Giving a Large Language Model (LLM) read and write access to a high-volume data source like Google Search Console is a massive engineering challenge. You have to handle complex dimension groupings for analytics, map custom site ID formats to MCP tool definitions, and manage aggressive rate limits. Every time Google updates their indexing API or Search Analytics endpoints, your custom server code must be updated, redeployed, and tested.

This guide breaks down exactly how to use Truto to generate a secure, managed MCP server for Google Search Console, connect it natively to ChatGPT, and execute complex SEO workflows using natural language.

The Engineering Reality of the Google Search Console API

A custom MCP server is a self-hosted integration layer. While the open MCP standard provides a predictable way for models to discover tools, implementing it against Google Search Console's highly specific API is exceptionally painful.

If you decide to build a custom MCP server for Google Search Console, you own the entire API lifecycle. Here are the specific integration challenges that break standard CRUD assumptions when working with this API:

Site ID Formatting and URI Encoding

Unlike standard SaaS platforms that use UUIDs or integers for resource IDs, Google Search Console uses the actual property identifier as the siteUrl ID. This means your MCP server must accurately parse and handle two entirely different ID formats: URL-prefix properties (e.g., https://www.example.com/) and Domain properties (e.g., sc-domain:example.com). If your agent attempts to query a domain property without the sc-domain: prefix, the API will throw a 403 Forbidden or 404 Not Found. Your tool descriptions must explicitly train the LLM on this distinction.

Search Analytics Dimensionality and Row Limits

The Search Analytics endpoint is not a standard list endpoint. It is a complex querying engine that requires specific startDate, endDate, and a dimensions array (e.g., ["query", "page", "device"]). Furthermore, the API enforces a strict limit of 25,000 rows per request. If an LLM attempts to pull an entire year of keyword data without filtering, the request will timeout or hit the ceiling. A proper MCP implementation must expose pagination cursors and explicitly instruct the LLM to narrow its date ranges or apply specific dimension filters to avoid blowing up the context window.

Index Inspection vs Live Testing

When an LLM wants to check if a URL is indexed, it calls the URL Inspection API. However, this API only returns the status of the URL as it currently exists in Google's index. It does not perform a live test. The UrlInspectionResult payload is deeply nested, containing separate objects for indexStatusResult, ampResult, and richResultsResult. Your MCP server must flatten or strongly type this JSON schema so the LLM can parse the exact reason a page is not indexed (e.g., "Crawled - currently not indexed" vs "Discovered - currently not indexed").

Strict Rate Limits and 429 Handling

Google Search Console enforces aggressive rate limits (e.g., QPS limits per user and per property). Truto does not retry, throttle, or apply backoff on rate limit errors automatically. When the upstream Google API returns an HTTP 429, Truto passes that error directly to the caller. However, Truto normalizes the upstream rate limit info into standardized headers (ratelimit-limit, ratelimit-remaining, ratelimit-reset) following the IETF specification. The caller (your AI agent framework or ChatGPT client) is strictly responsible for reading these headers and implementing its own retry and backoff logic.

Generating the Google Search Console MCP Server

Truto dynamically generates MCP tools based on the actual endpoints available for a connected Google Search Console account. You can create an MCP server either through the Truto UI or programmatically via the API.

Method 1: Via the Truto UI

For internal workflows or rapid prototyping, generating the server via the UI takes seconds.

  1. Log into your Truto dashboard and navigate to the integrated account page for your connected Google Search Console instance.
  2. Click the MCP Servers tab.
  3. Click Create MCP Server.
  4. Select the desired configuration. You can name the server, filter allowed methods (e.g., read only), and apply tag filters.
  5. Copy the generated MCP server URL (e.g., https://api.truto.one/mcp/a1b2c3d4...). Treat this URL as a secret, as it contains the hashed authentication token.

Method 2: Via the Truto API

For production applications building multi-tenant AI agents, you will generate these servers programmatically. This ensures each of your users gets their own scoped MCP endpoint.

Make a POST request to /integrated-account/:id/mcp:

curl -X POST https://api.truto.one/integrated-account/$INTEGRATED_ACCOUNT_ID/mcp \
  -H "Authorization: Bearer $TRUTO_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "GSC SEO Auditor Agent",
    "config": {
      "methods": ["read", "write"],
      "tags": ["sites", "analytics", "sitemaps"]
    }
  }'

The response will contain the secure URL you need for ChatGPT:

{
  "id": "mcp-789-xyz",
  "name": "GSC SEO Auditor Agent",
  "config": { "methods": ["read", "write"] },
  "expires_at": null,
  "url": "https://api.truto.one/mcp/a1b2c3d4e5f6..."
}

Connecting the MCP Server to ChatGPT

Once you have your Truto MCP URL, you can connect it to ChatGPT. You can do this via the ChatGPT UI for immediate chat access, or via a manual configuration file if you are using an agentic framework or local CLI wrapper.

Method A: Via the ChatGPT UI

If you have a ChatGPT Pro, Plus, Business, Enterprise, or Education account, you can add custom connectors directly in the browser.

  1. In ChatGPT, click your profile picture and navigate to Settings -> Apps -> Advanced settings.
  2. Enable the Developer mode toggle.
  3. Under MCP servers / Custom connectors, click to add a new server.
  4. Enter a name (e.g., "Google Search Console (Truto)").
  5. Paste the Truto MCP URL into the Server URL field.
  6. Click Save. ChatGPT will instantly initialize the connection, execute a tools/list request, and learn how to interact with your GSC data.

Method B: Via Manual Config File (SSE Transport)

If you are running a local agent environment, an MCP inspector, or a custom ChatGPT desktop wrapper that relies on configuration files, you can connect using the Server-Sent Events (SSE) transport.

Create or update your MCP configuration file (e.g., mcp_config.json):

{
  "mcpServers": {
    "google_search_console": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-sse",
        "--url",
        "https://api.truto.one/mcp/a1b2c3d4e5f6..."
      ]
    }
  }
}

Start your agent framework pointing to this config, and it will route all JSON-RPC tool calls through the SSE tunnel to Truto.

Security and Access Control

Exposing an enterprise Google Search Console account to an LLM requires strict boundary setting. Truto provides four key security controls directly on the MCP token:

  • Method Filtering (config.methods): Restrict the AI agent to specific operations. By passing ["read"], the agent can pull analytics and list sitemaps, but it is physically blocked from submitting new sitemaps or deleting site properties.
  • Tag Filtering (config.tags): Scope the server to specific resource domains. Passing ["analytics"] ensures the agent can only access traffic data, isolating your sitemaps and site configurations from the model.
  • Expiration Dates (expires_at): Pass an ISO datetime string during creation to generate a short-lived MCP server. Once the time is reached, Cloudflare KV automatically drops the token and the server ceases to exist. Perfect for temporary contractor access or one-off SEO audits.
  • Additional Authentication (require_api_token_auth): By default, the long unguessable URL acts as the authentication boundary. If you set require_api_token_auth: true, callers must also pass a valid Truto API token in the Authorization: Bearer header, adding a second layer of identity verification.

Hero Tools for Google Search Console

Truto auto-generates dozens of tools for GSC, but these five represent the highest leverage operations for AI agents.

list_all_google_search_console_sites

This tool allows the agent to discover which properties the authenticated user has access to, including their permission level. This is typically the first tool an agent calls to determine the exact siteUrl identifier it needs for subsequent queries.

"List all the properties I have access to in Google Search Console. Let me know if any are domain properties versus URL-prefix properties, and tell me my permission level for each."

list_all_google_search_console_search_analytics

The most powerful tool in the suite. It queries search traffic data, grouped by dimensions like query, page, country, or device. The LLM must supply the site_url, startDate, and endDate.

"Pull the search analytics for sc-domain:example.com for the last 30 days. Group the data by 'query' and 'page' so we can see which keywords are driving traffic to our top blog posts."

This tool checks the current indexing status of a specific URL. It returns detailed information about whether Google has discovered the page, crawled it, indexed it, and if it qualifies for rich results.

"Inspect the URL https://example.com/new-pricing-page against the site property sc-domain:example.com. Tell me if it is currently indexed, and if there are any mobile usability errors holding it back."

list_all_google_search_console_sitemaps

This tool audits the sitemap configuration for a property. It returns submission dates, processing status, and any warnings or errors Google encountered while parsing the XML feed.

"List all the sitemaps currently submitted for https://example.com/. Tell me when they were last downloaded by Google and if any of them are currently throwing errors."

google_search_console_sitemaps_submit

An actionable write tool that allows the agent to submit a new sitemap to Google for crawling. It requires the site_url and the exact feedpath URL of the sitemap.

"Submit the new sitemap located at https://example.com/blog-sitemap.xml to the property https://example.com/ so Google can start crawling our new articles."

To view the complete inventory of available tools, query parameters, and JSON schemas, visit the Google Search Console integration page.

Workflows in Action

Here is how an AI agent uses these tools in sequence to execute complex SEO operations without human intervention.

Scenario 1: The Traffic Drop Diagnoser

An SEO manager notices a traffic dip and asks the agent to investigate what happened over the last week.

"My traffic on example.com dropped over the last 7 days. Find out which specific pages lost clicks compared to the previous week, and check if those pages are still indexed in Google."

Step-by-step execution:

  1. Discovery: The agent calls list_all_google_search_console_sites to find the exact property ID (e.g., sc-domain:example.com).
  2. Analytics Query 1: The agent calls list_all_google_search_console_search_analytics with startDate: "2023-10-01", endDate: "2023-10-07", and dimensions: ["page"].
  3. Analytics Query 2: The agent calls list_all_google_search_console_search_analytics for the preceding 7 days.
  4. Data Comparison: The LLM internally compares the two datasets to identify the URLs with the largest drop in clicks.
  5. Index Inspection: The agent calls google_search_console_url_inspection_search on the worst performing URLs to check if they have been de-indexed or hit with a manual action.

The user receives a concise summary: "The drop was isolated to your /blog/seo-guide page, which lost 400 clicks. I ran an index inspection and found that Google is reporting a 'Crawled - currently not indexed' error for that URL, indicating a potential content quality or canonicalization issue."

sequenceDiagram
    participant User as User
    participant Agent as ChatGPT (Client)
    participant Truto as Truto MCP Server
    participant Upstream as Google API
    
    User->>Agent: "Investigate traffic drop on example.com"
    Agent->>Truto: call tool: list_all_google_search_console_sites
    Truto->>Upstream: GET /webmasters/v3/sites
    Upstream-->>Truto: Site List (200 OK)
    Truto-->>Agent: Returns `sc-domain:example.com`
    Agent->>Truto: call tool: list_all_google_search_console_search_analytics (Dates + Dimensions)
    Truto->>Upstream: POST /webmasters/v3/sites/.../searchAnalytics/query
    Upstream-->>Truto: Traffic rows (200 OK)
    Truto-->>Agent: Returns click data per page
    Agent->>Truto: call tool: google_search_console_url_inspection_search
    Truto->>Upstream: POST /v1/urlInspection/index:inspect
    Upstream-->>Truto: Index Status (200 OK)
    Truto-->>Agent: Returns "Crawled - not indexed"
    Agent-->>User: Delivers diagnostic summary

Scenario 2: The Sitemap Auditor & Fixer

A developer wants to ensure their recent site migration didn't break XML sitemap processing.

"Audit the sitemaps for our URL-prefix property https://www.example.com/. If any sitemaps have errors, delete them and submit the new sitemap at https://www.example.com/sitemap_index.xml."

Step-by-step execution:

  1. Audit: The agent calls list_all_google_search_console_sitemaps passing site_url: "https://www.example.com/".
  2. Analysis: The LLM parses the response, looking at the errors and warnings arrays. It finds an old sitemap (/old-sitemap.xml) returning a 404 error.
  3. Cleanup: The agent calls delete_a_google_search_console_sitemap_by_id, passing the broken feedpath ID to remove it from GSC.
  4. Submission: Finally, the agent calls google_search_console_sitemaps_submit using the new index URL provided by the developer.

The user receives a success message: "I found that /old-sitemap.xml was throwing a 404 error. I have deleted it from Search Console and successfully submitted your new /sitemap_index.xml. Google shows the submission is currently 'Pending'."

Moving SEO Operations to AI Agents

Connecting Google Search Console to ChatGPT transforms SEO from a manual dashboarding task into an automated, conversational workflow. Instead of exporting CSVs and running VLOOKUPs to find traffic anomalies, your team can simply ask an agent to diagnose index issues, compare date ranges, and manage sitemaps.

By leveraging Truto's dynamic MCP server generation, you bypass the friction of URI encoding quirks, JSON payload mapping, and OAuth token management. Your engineering team stays focused on your core product, while your AI agents get immediate, secure access to the world's most important search data.

FAQ

Does Truto automatically handle Google Search Console rate limits?
No. Truto passes HTTP 429 rate limit errors directly to the caller. However, Truto normalizes the upstream rate limit information into standard IETF headers (`ratelimit-limit`, `ratelimit-remaining`, `ratelimit-reset`), allowing your AI agent framework to implement accurate retry and backoff logic.
How do I format the Site ID for Domain properties?
When querying a Domain property in Google Search Console via the API, the `siteUrl` must be prefixed with `sc-domain:` (e.g., `sc-domain:example.com`). URL-prefix properties require the full protocol and trailing slash (e.g., `https://www.example.com/`).
Can the URL Inspection tool perform a live test?
No. The Google Search Console URL Inspection API only returns the status of the URL as it is currently recorded in Google's index. It does not perform real-time live testing of the URL.
How does Truto secure the MCP server connection?
Truto secures MCP servers via a cryptographically hashed token in the URL. You can further lock down access by applying method filters (e.g., read-only), tag filters, expiration dates, and requiring an additional Truto API token in the authorization header.

More from our Blog