Files
genai-toolbox/docs/BIGQUERY_README.md
Anubhav Dhawan 05799475b4 docs: update antigravity docs installation instructions and prerequisites (#2088)
This PR updates the documentation across the repository to reflect the
new installation workflow using `npx` and Node.js, replacing the
previous binary download instructions. It also standardizes the
prerequisites and adds helpful configuration notes for Windows users.

These changes simplify the setup process for users by leveraging `npx`
for executing the tools, ensuring they always use the latest version
without manual binary management. It also addresses feedback from PR
#2079 regarding installation clarity and Windows support.

---------

Co-authored-by: Twisha Bansal <twishabansal07@gmail.com>
2025-12-02 12:25:31 -08:00

3.9 KiB

BigQuery MCP Server

The BigQuery Model Context Protocol (MCP) Server enables AI-powered development tools to seamlessly connect, interact, and generate data insights with your BigQuery datasets and data using natural language commands.

Features

An editor configured to use the BigQuery MCP server can use its AI capabilities to help you:

  • Natural Language to Data Analytics: Easily find required BigQuery tables and ask analytical questions in plain English.
  • Seamless Workflow: Stay within your CLI, eliminating the need to constantly switch to the GCP console for generating analytical insights.
  • Run Advanced Analytics: Generate forecasts and perform contribution analysis using built-in advanced tools.

Prerequisites

  • Node.js installed.
  • A Google Cloud project with the BigQuery API enabled.
  • Ensure Application Default Credentials are available in your environment.
  • IAM Permissions:
    • BigQuery User (roles/bigquery.user)

Install & Configuration

  1. In the Antigravity MCP Store, click the "Install" button.

  2. Add the required inputs in the configuration pop-up, then click "Save". You can update this configuration at any time in the "Configure" tab.

Note

If you encounter issues with Windows Defender blocking the execution, you may need to configure an allowlist. See Configure exclusions for Microsoft Defender Antivirus for more details.

You'll now be able to see all enabled tools in the "Tools" tab.

Usage

Once configured, the MCP server will automatically provide BigQuery capabilities to your AI assistant. You can:

  • Find Data:

    • "Find tables related to PyPi downloads"
    • "Find tables related to Google analytics data in the dataset bigquery-public-data"
  • Generate Analytics and Insights:

    • "Using bigquery-public-data.pypi.file_downloads show me the top 10 downloaded pypi packages this month."
    • "Using bigquery-public-data.pypi.file_downloads can you forecast downloads for the last four months of 2025 for package urllib3?"

Server Capabilities

The BigQuery MCP server provides the following tools:

Tool Name Description
execute_sql Executes a SQL query.
forecast Forecast time series data.
get_dataset_info Get dataset metadata.
get_table_info Get table metadata.
list_dataset_ids Lists dataset IDs in the database.
list_table_ids Lists table IDs in the database.
analyze_contribution Perform contribution analysis, also called key driver analysis.
search_catalog Search for tables based on the provided query.

Custom MCP Server Configuration

The BigQuery MCP server is configured using environment variables.

export BIGQUERY_PROJECT="<your-gcp-project-id>"
export BIGQUERY_LOCATION="<your-dataset-location>"  # Optional
export BIGQUERY_USE_CLIENT_OAUTH="true"  # Optional

Add the following configuration to your MCP client (e.g., settings.json for Gemini CLI, mcp_config.json for Antigravity):

{
  "mcpServers": {
    "bigquery": {
      "command": "npx",
      "args": ["-y", "@toolbox-sdk/server", "--prebuilt", "bigquery", "--stdio"]
    }
  }
}

Documentation

For more information, visit the BigQuery documentation.