BigQuery Analytics MCP
Provides tools for running GoogleSQL SELECT/WITH queries against BigQuery datasets, including Firebase Analytics/GA4 exports, with setup guidance, configurable billing project and location, row limits, per-query byte caps, and timeouts.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@BigQuery Analytics MCP count yesterday's events by event_name in my beta dataset"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
BigQuery Analytics MCP
A stdio MCP server for querying BigQuery, including Firebase Analytics / GA4 event exports, and guiding teammates through setup. It runs bq in Google Cloud Shell under the Google account configured for the OS user that runs the server.
Setup
Install Node.js 22+ and the Google Cloud CLI.
Clone this repository and run
npm ci.Run
gcloud auth loginas the OS user that will run MCP. Open Cloud Shell and complete its initial setup. For organization-managed projects, use an execution environment approved by your administrator.Request BigQuery Job User on the billing project and BigQuery Data Viewer on the datasets you need. Use a least-privilege identity.
Add this server to your MCP client and start a fresh session. Replace the path and sample GCP values with your own.
{
"mcpServers": {
"bigquery-analytics-mcp": {
"command": "node",
"args": ["/absolute/path/bigquery-analytics-mcp/src/mcp.js"],
"env": {
"BIGQUERY_BILLING_PROJECT": "my-billing-project",
"BIGQUERY_LOCATION": "US",
"BIGQUERY_SOURCES": "{\"beta\":\"my-data-project.analytics_123456789\"}"
}
}
}
}In meta-agent, add an entry with id, command, args, and env to the space's mcpServers array. Use absolute paths to Node and the entry point when the portal runs with a different PATH.
BIGQUERY_BILLING_PROJECT pays for query jobs. Tables in SQL should use fully qualified names, so the data can live in another project in the same location. BIGQUERY_SOURCES is an optional JSON map of dataset labels for the agent's guidance. Google IAM determines data access. BIGQUERY_MAX_BYTES_BILLED defaults to 10 GiB per query and BIGQUERY_TIMEOUT_MS defaults to 180 seconds per CLI invocation.
Related MCP server: google_analytics
Ask the agent
Open BigQuery setup and tell me which access I need. Then check access with SELECT 1 and count daily events in my beta dataset for a completed date.
bigquery_setupreturns the connection checklist, configured datasets, sample SQL and troubleshooting. It works before authentication.bigquery_queryaccepts one GoogleSQL SELECT or WITH statement. The default result limit is 100 rows, with a maximum of 1,000. The per-call byte cap can only lower the configured cap. Running a query creates a billable BigQuery job. Results are returned to the calling MCP client.
Prefer the completed GA4 daily export when both daily and intraday tables exist for the same date. Use intraday data as provisional when no daily table is available. Restrict date ranges and select only the fields needed.
Run npm test to verify MCP discovery and the query runner with a simulated Cloud Shell.
Available Tools
2 toolsbigquery_queryARead-only
Run one read-only GoogleSQL SELECT or WITH query in Cloud Shell, using the configured billing project and bytes cap. Use bigquery_setup to discover the configured sources.
Inputs: sql (required), max_rows, max_bytes_billed.
bigquery_setupARead-only
Get live configuration, access and login instructions, and a first query. Works without Google Cloud CLI or Google authentication.
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 2 tools
The two tools have clearly distinct roles: bigquery_setup handles configuration, access, and onboarding, while bigquery_query executes SQL. The setup description's mention of a first query is instructional, not an overlapping execution capability, so an agent can easily choose correctly.
Both tools use the same bigquery_ prefix and snake_case noun/action style. The naming pattern is predictable and consistent.
Two tools is thin for a BigQuery analytics server, even a minimal read-only one. Setup plus query covers the core flow, but the surface feels under-scoped compared with typical 3-15 tool servers.
The server covers the essential read-only analytics lifecycle: configure access, discover sources, and run SELECT/WITH queries. Minor gaps exist around schema introspection and dry-run/validation, though agents can work around these using INFORMATION_SCHEMA queries.
Maintenance
Related MCP Connectors
Ask Google Analytics 4 in plain language: sessions, traffic sources and conversions. Read-only.
Query Churn Solution cancellation-flow metrics, revenue, and feedback analytics (read-only).
Ask Google Search Console in plain language: queries, pages, clicks and rankings. Read-only.
Read-only Google Analytics 4 MCP server for AI assistants.
Related MCP Servers
- AlicenseBqualityCmaintenanceEnables validation and dry-run analysis of BigQuery SQL queries without execution. Provides cost estimates, schema previews, and syntax validation for BigQuery queries.936 PyPI1MIT
- AlicenseNot gradedqualityCmaintenanceEnables querying Google Analytics 4 data through MCP tools for running reports, listing properties, getting real-time metrics, and exploring metadata.71 npmMIT
- AlicenseAqualityBmaintenanceEnables MCP clients to query Google Analytics 4 reporting and configuration data through 27 read-only tools, including pivots, funnels, realtime reports, Admin API inspection, and diagnostics, with identifiers redacted by default.27Apache 2.0
- AlicenseNot gradedqualityCmaintenanceEnables MCP clients to execute validated read-only warehouse queries through a guarded SQL API, with enforced row limits and secret-safe audit metadata.MIT