docs/BIGQUERY_README.md
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.
An editor configured to use the BigQuery MCP server can use its AI capabilities to help you:
roles/bigquery.user)In the Antigravity MCP Store, click the "Install" button.
[!NOTE] On first use, the installation process automatically downloads and uses MCP Toolbox
>=0.26.0. To update MCP Toolbox, use:npm i -g @toolbox-sdk/server@latestTo always run the latest version, update the MCP server configuration to use:npx -y @toolbox-sdk/server@latest --prebuilt bigquery.
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.
Once configured, the MCP server will automatically provide BigQuery capabilities to your AI assistant. You can:
Find Data:
Generate Analytics and Insights:
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. |
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: true, false, or a custom header name
export BIGQUERY_SCOPES="<comma-separated-scopes>" # Optional
export BIGQUERY_IMPERSONATE_SERVICE_ACCOUNT="<service-account-email>" # Optional: Service account to impersonate
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"]
}
}
}
For more information, visit the BigQuery documentation.