gsc-bigquery
Integrates with Google Cloud BigQuery to store backfilled Search Console history and run analytics queries over it using a configured Google Cloud project and credentials.
Provides tools to back up, query, and analyze Google Search Console performance data, including top queries and pages, period comparisons, indexing checks, URL inspection, sitemap management, and Core Web Vitals.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
search-console-bigquery
Back up your Google Search Console data to BigQuery before Google deletes it, keep it fresh, and ask questions about it from Claude or any MCP-compatible AI assistant.
Google only keeps 16 months of Search Console performance data, the UI exports at most 1,000 rows, and Google's own BigQuery bulk export only starts on the day you switch it on. This tool pulls everything the API still has — every query × page × country × device × day — into BigQuery, and keeps it up to date.
gsc-bq setup— a guided first run: Google sign-in, project, properties, done.gsc-bq backfill— pull up to 16 months of history; re-run any time, rows are never duplicated.gsc-bq backfill --gaps— fill only the days that are missing; safe to schedule.gsc-bq doctor— checks your sign-in, APIs, Search Console access and BigQuery, and tells you exactly how to fix what's wrong.MCP server — 39 tools for AI assistants: top queries, period comparisons, striking-distance keywords, cannibalization, URL inspection, sitemaps, Core Web Vitals and more.
Claude Code plugin — slash commands and a skill on top of the MCP server.
Works with Google's bulk export — combine its daily feed with the backfilled history in one table.
Quickstart (about 10 minutes)
What you need
Python 3.11+
The Google Cloud CLI (
gcloud) — install it. It is only used to sign in.A Google Cloud project to hold the data, with billing enabled (BigQuery's free sandbox deletes tables after 60 days). Most sites stay inside BigQuery's free tier — see Costs.
A Google account that is a user on your Search Console properties (Owner, Full or Restricted) and can use BigQuery in that project: project Owner/Editor, or the roles BigQuery Job User, BigQuery Data Editor and Service Usage Consumer.
1. Install
pipx install git+https://github.com/Ayresmic/search-console-bigqueryNo pipx? uv tool install git+https://github.com/Ayresmic/search-console-bigquery works too, or pip install git+https://github.com/Ayresmic/search-console-bigquery inside a virtual environment.
2. Set up
gsc-bq setupThe wizard opens a browser to sign you in to Google (with the Search Console scope that a plain gcloud login leaves out), asks which project to use, offers to enable the two APIs it needs, lists your Search Console properties so you can pick them, checks BigQuery works, and saves everything to a config file.
The sign-in uses gcloud auth application-default login, so it replaces this computer's gcloud application-default credentials — other tools that rely on them will use the same account afterwards. To keep them separate, use a service account instead (gsc-bq setup --key-file key.json).
3. Check
gsc-bq doctorNo row should say FAIL; each one that does comes with the exact fix. (info rows are optional extras.)
4. Back up
gsc-bq backfill --days 7A quick test run. When it works, pull everything Google still has:
gsc-bq backfillA busy property takes 10–30 minutes for the full 16 months; small sites take a minute or two. Use --dry-run to see exactly what will be pulled and where it will land before writing anything.
5. Query it
Each property gets its own dataset. gsc-bq sites shows the exact table for each one:
SELECT query, SUM(clicks) AS clicks, SUM(impressions) AS impressions,
SAFE_DIVIDE(SUM(position * impressions), SUM(impressions)) AS avg_position
FROM `my-project.search_console_history_domain_example_com.search_analytics`
WHERE date >= DATE_SUB(CURRENT_DATE(), INTERVAL 90 DAY) AND query IS NOT NULL
GROUP BY query
ORDER BY clicks DESC
LIMIT 25;More in examples/example_queries.sql.
Related MCP server: mcp-search-console
Keep it fresh
Search Console keeps adjusting the last ~3 days, so schedule two jobs:
When | Command | Why |
Daily |
| Re-pulls the last 5 days ( |
Weekly |
| Fills any day a daily run missed. Only days with no data in BigQuery are requested again (for a site younger than 16 months that includes the empty days before it existed, which return nothing and are quick). |
macOS / Linux (cron):
crontab -e15 6 * * * $HOME/.local/bin/gsc-bq backfill --incremental >> $HOME/gsc-bq.log 2>&1
30 6 * * 1 $HOME/.local/bin/gsc-bq backfill --gaps >> $HOME/gsc-bq.log 2>&1Windows (Task Scheduler), from PowerShell or Command Prompt:
schtasks /Create /SC DAILY /ST 06:15 /TN "gsc-bq incremental" /TR "gsc-bq backfill --incremental"
schtasks /Create /SC WEEKLY /D MON /ST 06:30 /TN "gsc-bq gaps" /TR "gsc-bq backfill --gaps"No server? Run it on GitHub Actions with a service account — see examples/github-actions-daily.yml and docs/service-account.md.
Use it from AI assistants
gsc-bq mcp starts an MCP server over stdio. It uses the same config as the CLI, so run gsc-bq setup first.
Claude Code (plugin)
/plugin marketplace add Ayresmic/search-console-bigquery
/plugin install gsc-bigquery@search-console-bigqueryRestart Claude Code. You get the MCP tools plus slash commands: /gsc-bigquery:setup, /gsc-bigquery:doctor, /gsc-bigquery:gsc-backfill, /gsc-bigquery:gsc-gap-fill, /gsc-bigquery:gsc-incremental, /gsc-bigquery:gsc-analyze, /gsc-bigquery:gsc-query, /gsc-bigquery:gsc-issues and /gsc-bigquery:gsc-cwv. The plugin runs the gsc-bq command, so install the CLI first (step 1 above).
Or without the plugin: claude mcp add gsc-bigquery -- gsc-bq mcp
Claude Desktop, Cursor, and other MCP clients
Add this to the client's MCP config (for Claude Desktop: claude_desktop_config.json):
{
"mcpServers": {
"gsc-bigquery": { "command": "gsc-bq", "args": ["mcp"] }
}
}If the client can't find gsc-bq, use the full path from which gsc-bq (macOS/Linux) or where.exe gsc-bq (Windows).
The MCP server reads the config written by gsc-bq setup. It ignores generic .env files in the folder your AI client is opened in, so another project's settings can't leak in.
What you can ask
"How did example.com do over the last 28 days compared to the 28 before?" "Which queries are in striking distance (positions 4-20)?" "Find keyword cannibalization on the blog." "Are our top 15 pages indexed?" "What are our Core Web Vitals on mobile?"
Group | Tools |
Discovery |
|
Analytics (BigQuery) |
|
Live Search Console API |
|
Indexing and sitemaps |
|
Core Web Vitals |
|
Composite |
|
Analytics windows end on the latest day that has data, comparison windows are equal in length, and average position is impression-weighted (as in the Search Console UI). query_history runs only a single read-only SELECT and caps the bytes scanned (10 GB by default). submit_sitemap needs write access to Search Console, which the read-only sign-in from gsc-bq setup doesn't grant: use a service account with Full permission on the property for it.
Commands
Command | What it does |
| Guided setup. |
| Check config, credentials, APIs, Search Console access and BigQuery, with a fix for each problem. |
| List your properties, their exact strings, and their BigQuery tables. |
| Pull data. Options: |
| Combine Google's native bulk export with backfilled history. Dry run unless |
| Run the MCP server. |
| Show where |
Every command has --help.
Configuration
gsc-bq setup writes these for you. Settings are read from (highest priority first) environment variables, the file in GSC_BQ_CONFIG, a gsc-bq.env file in the current folder, and the user config file (~/.config/gsc-bq/config.env, or %APPDATA%\gsc-bq\config.env on Windows). Every key is documented in gsc-bq.env.example.
Variable | Default | Meaning |
| — | Project that holds the data (required). |
| empty | Path to a service-account key. Empty = your gcloud sign-in. |
| all visible | Comma-separated properties to sync. |
|
| Dataset name prefix. |
|
| Dataset location ( |
|
| Days re-pulled by |
| empty | Only for the Core Web Vitals / PageSpeed MCP tools. |
| empty | Brand terms for |
Where the data lands
One dataset per property, named {BQ_DATASET_PREFIX}_{slug}:
Property | Dataset |
|
|
|
|
|
|
|
|
Each dataset has search_analytics (partitioned by date, clustered by query, page) and sites (a log of runs). Columns:
Column | Type | Notes |
| STRING | The property. |
| DATE | Partition column — always filter on it. |
| STRING |
|
| STRING | |
| STRING | ISO 3166-1 alpha-3, lowercase ( |
| STRING |
|
| STRING | Always |
| INT64 | |
| FLOAT64 |
|
| TIMESTAMP | When the row was loaded. |
Only web search is pulled (not image, video or news), with the date, query, page, country and device dimensions.
Using Google's bulk export too
If you've turned on Search Console's native bulk data export, it fills BigQuery from the day you enabled it. gsc-bq link-bulk-export joins it with the backfilled history so search_analytics covers everything:
gsc-bq link-bulk-export --site sc-domain:example.com --export-dataset searchconsole # shows the plan
gsc-bq link-bulk-export --site sc-domain:example.com --export-dataset searchconsole --apply
gsc-bq backfill --gaps --site sc-domain:example.com # fill the history before the exportDetails and caveats: docs/bulk-export.md.
Costs and quotas
Search Console API: free. Google limits it to roughly 1,200 queries per minute per property; the backfill makes one request per 25,000 rows and retries rate-limit errors with back-off.
BigQuery storage: a busy property's full 16 months is typically a few GB, i.e. cents per month (the first 10 GB per month are free).
BigQuery queries: loads are free; each 7-day chunk is merged with a query that only reads the days being written. The analytics tools filter on the partition column. Most users stay inside the free 1 TB of queries per month.
Troubleshooting
Run gsc-bq doctor first — it diagnoses all of these.
Symptom | Fix |
| Your gcloud login lacks the Search Console scope. Run |
| The signed-in account isn't a user on that property. Add it in Search Console › Settings › Users and permissions, or sign in with the right account. |
|
|
| API calls are billed to |
BigQuery | Grant the account BigQuery Job User and BigQuery Data Editor on the project. |
"already holds data for ..." | Two properties map to the same dataset name. Back one of them up with a different |
404 for a property | URL-prefix properties need the exact scheme and trailing slash ( |
Numbers lower than the Search Console UI | Expected: the API leaves out anonymized queries, and Google applies privacy filtering. Trends and rankings are unaffected. |
MCP tools say "not set up" | Run |
MCP tools don't appear at all | The client can't find |
FAQ
Can I get more than 16 months? No. Google deletes older Search Console data; no tool can recover it. Back up now and history accumulates from here.
Does re-running duplicate data? No. Every load is MERGEd on date, query, page, country and device.
Is my data sent anywhere? No. It goes from Google's Search Console API into your own BigQuery project. Nothing else is contacted, except the CrUX and PageSpeed APIs if you use those tools.
Service account instead of my own account? Yes — see docs/service-account.md.
Contributing
Issues and pull requests are welcome — see CONTRIBUTING.md. For security issues, see SECURITY.md.
License
This server cannot be deployed
Maintenance
Related MCP Connectors
Google Search Console, GA4 and Bing Webmaster data for SEO and AI-search work. 20 read-only tools.
SEO & marketing toolkit for AI agents: GA4, Search Console, AdSense, GTM, PageSpeed, Trends.
Real SEO data for AI assistants: page audits, Keyword Planner volumes, Search Console history.
Google Search Console for AI assistants: traffic, rankings, indexing and page checks. Read-only.
Related MCP Servers
- AlicenseAqualityDmaintenanceConnects Google Search Console to AI assistants, enabling natural language analysis of SEO data. Provides read-only tools for properties, search analytics, URL inspection, and sitemaps.15MIT
- AlicenseAqualityDmaintenanceEnables AI assistants to analyze Google Search Console SEO data through natural language, including search analytics, URL inspection, sitemap management, and property management.21MIT
- AlicenseAqualityBmaintenanceProvides AI assistants with live access to Google Search Console search analytics, URL inspection, and sitemap management through real API calls.10MIT
- AlicenseAqualityBmaintenanceRank by Ouroboros Apps (https://ouroborosapps.com). SEO rankings from Google Search Console, read-only: top queries and pages, traffic trends, period comparisons, quick wins, dropped pages, and URL inspection. Connect by pasting https://rank.ouroborosapps.com/mcp into Claude, Cursor, Grok, or ChatGPT developer mode (OAuth). Docs: https://ouroborosapps.com/docs/rank9MIT