Skip to main content
Glama
BigQuery Analytics MCP

BigQuery Analytics MCP

by hram

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

  1. Install Node.js 22+ and the Google Cloud CLI.

  2. Clone this repository and run npm ci.

  3. Run gcloud auth login as 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.

  4. Request BigQuery Job User on the billing project and BigQuery Data Viewer on the datasets you need. Use a least-privilege identity.

  5. 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_setup returns the connection checklist, configured datasets, sample SQL and troubleshooting. It works before authentication.

  • bigquery_query accepts 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 tools
bigquery_queryA
Read-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_setupA
Read-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

    A4.1/5.0

    Scored across 2 tools

    Disambiguation5/5

    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.

    Naming Consistency5/5

    Both tools use the same bigquery_ prefix and snake_case noun/action style. The naming pattern is predictable and consistent.

    Tool Count3/5

    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.

    Completeness4/5

    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

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      C
      maintenance
      Enables validation and dry-run analysis of BigQuery SQL queries without execution. Provides cost estimates, schema previews, and syntax validation for BigQuery queries.
      9
      36 PyPI
      1
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables querying Google Analytics 4 data through MCP tools for running reports, listing properties, getting real-time metrics, and exploring metadata.
      71 npm
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables 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.
      27
      Apache 2.0
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables MCP clients to execute validated read-only warehouse queries through a guarded SQL API, with enforced row limits and secret-safe audit metadata.
      MIT