Google Cloud BigQuery provides advanced analytical insight for data agents. Its connector gives assistants BigQuery context for exploring datasets, asking analytical questions, and working with large-scale cloud data from natural language.
Connection details
https://bigquery.googleapis.com/mcp
Setup
claude mcp add bigquery --transport http https://bigquery.googleapis.com/mcp
Google Cloud BigQuery MCP Server tools
9
List BigQuery dataset IDs and BigLake namespaces in a Google Cloud project.
Supports pagination. Use `page_size` to limit results and `page_token` to retrieve next page.
Get metadata information about a BigQuery dataset or BigLake namespace.
List table ids in a BigQuery dataset or BigLake namespace.
Supports pagination. Use `page_size` to limit results and `page_token` to retrieve next page.
Get metadata information about a BigQuery table or BigLake table.
Run a read-only SQL query in the project and return the result. Prefer this tool over
`execute_sql` if possible.
This tool is restricted to only `SELECT` statements. `INSERT`, `UPDATE`, and `DELETE`
statements and stored procedures aren't allowed. If the query doesn't include a `SELECT`
statement, an error is returned. For information on creating queries, see the [GoogleSQL
documentation](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax).
IMPORTANT: For predictive and analytical tasks (forecasting, anomaly detection,
key driver / root cause analysis, classification, churn prediction, or text generation),
ALWAYS execute computation in-warehouse using BigQuery native AI/ML functions
(`AI.FORECAST`, `AI.DETECT_ANOMALIES`, `AI.KEY_DRIVERS`, `AI.CLASSIFY`, `AI.GENERATE`)
rather than exporting raw rows to a local Python sandbox. In-warehouse execution
scales to billions of rows, preserves governance, and eliminates data egress latency.
Example Queries:
```sql
-- Count the number of penguins in each island.
SELECT island, COUNT(*) AS population
FROM bigquery-public-data.ml_datasets.penguins GROUP BY island
-- Forecast data using AI.FORECAST
SELECT *
FROM AI.FORECAST(TABLE `project.dataset.my_table`, data_col => 'num_trips',
timestamp_col => 'date', id_cols => ['usertype'], horizon => 30)
-- Detect anomalies in time series data using AI.DETECT_ANOMALIES
SELECT *
FROM AI.DETECT_ANOMALIES(
TABLE `project.dataset.historical_metrics`,
TABLE `project.dataset.recent_metrics`,
data_col => 'num_requests',
timestamp_col => 'timestamp'
)
-- Identify key drivers of metric changes using AI.KEY_DRIVERS
SELECT *
FROM AI.KEY_DRIVERS(
TABLE `project.dataset.sales_summary`,
metric_col => 'total_revenue',
dimension_cols => ['region', 'product_category'],
interest_label_col => 'is_current_quarter'
)
-- Classify text into categories using AI.CLASSIFY
SELECT
ticket_id,
AI.CLASSIFY(ticket_text, ['Billing', 'Technical Support', 'Feature Request']) AS category
FROM `project.dataset.support_tickets`
-- Generate text or summaries using AI.GENERATE
SELECT
review_id,
AI.GENERATE(CONCAT('Summarize this customer review: ', review_text)).result AS summary
FROM `project.dataset.reviews`
```
Queries executed using the `execute_sql_readonly` tool will always have the job label
`goog-mcp-server: true` automatically set in addition to any custom `labels` provided in
the request. Queries are charged to the project specified in the `project_id` field.
Query Execution Behavior:
* If the query completes within the synchronous timeout (default 20 seconds or custom `timeout_ms`),
the tool returns `job_complete: true` and the result rows directly. For fast queries, `job_id` may
be omitted as no persistent background job is created; no further action or polling is needed.
* If the query takes longer than `timeout_ms`, the tool returns `job_complete: false` and a `job_id` and `location`.
In this case, use the `get_query_results` tool with `job_id` and `location` to poll until `job_complete: true`,
or use `cancel_job` to abort the running query.
* You can optionally specify `timeout_ms` to configure the maximum synchronous wait time in milliseconds
(defaults to 20,000 ms), and `job_timeout_ms` to enforce a hard server-side timeout after which
BigQuery automatically terminates the job.
Run a SQL query in the project and return the result. Prefer the `execute_sql_readonly`
tool if possible.
This tool can execute any query that bigquery supports including:
* SQL Queries (`SELECT`, `INSERT`, `UPDATE`, `DELETE`, `CREATE`, etc.)
* AI/ML functions like `AI.FORECAST`, `AI.KEY_DRIVERS`, `ML.EVALUATE`, `ML.PREDICT`
* Any other query that bigquery supports.
Example Queries:
```sql
-- Insert data into a table.
INSERT INTO `my_project.my_dataset`.my_table (name, age)
VALUES ('Alice', 30);
-- Create a table.
CREATE TABLE `my_project.my_dataset`.my_table (
name STRING,
age INT64);
-- DELETE data from a table.
DELETE FROM `my_project.my_dataset`.my_table WHERE name = 'Alice';
-- Create Dataset
CREATE SCHEMA `my_project.my_dataset` OPTIONS (location = 'US');
-- Drop table
DROP TABLE `my_project.my_dataset`.my_table;
-- Drop dataset
DROP SCHEMA `my_project.my_dataset`;
-- Create Model
CREATE OR REPLACE MODEL `my_project.my_dataset.my_model`
OPTIONS (
model_type = 'LINEAR_REG'
LS_INIT_LEARN_RATE=0.15,
L1_REG=1,
MAX_ITERATIONS=5,
DATA_SPLIT_METHOD='SEQ',
DATA_SPLIT_EVAL_FRACTION=0.3,
DATA_SPLIT_COL='timestamp') AS
SELECT col1, col2, timestamp, label FROM `my_project.my_dataset.my_table`;
```
Queries executed using the `execute_sql` tool will always have the default job label
`goog-mcp-server: true` automatically set in addition to any custom `labels` provided in the
request. Queries are charged to the project specified in the `project_id` field.
Query Execution Behavior:
* If the query completes within the synchronous timeout (default 20 seconds or custom `timeout_ms`),
the tool returns `job_complete: true` and the initial result rows directly. For fast queries, `job_id` may
be omitted as no persistent background job is created; no further action or polling is needed.
* If the query takes longer than `timeout_ms`, the tool returns `job_complete: false` and a `job_id` and `location`.
In this case, use the `get_query_results` tool with `job_id` and `location` to poll until `job_complete: true`,
or use `cancel_job` to abort the running query.
* You can optionally specify `timeout_ms` to configure the maximum synchronous wait time in milliseconds
(defaults to 20,000 ms), and `job_timeout_ms` to enforce a hard server-side timeout after which
BigQuery automatically terminates the job.
Get the results of a BigQuery SQL query job.
Use this tool ONLY when:
1. A previous `execute_sql` or `execute_sql_readonly` call returned `job_complete: false` with a `job_id`
(poll with this tool until `job_complete: true`), OR
2. You need to paginate through additional rows using `page_token` or `start_index` for a previously completed job.
Do NOT call this tool if the query already returned `job_complete: true` with all rows.
Supports pagination. Use `max_results` to limit results and `page_token` to retrieve the next page of results.
Cancel a running BigQuery job.
Use this tool to cancel a query job that is currently executing (i.e. returned `job_complete: false`
with a `job_id` from `execute_sql` or `execute_sql_readonly`). Specify the `job_id` to abort.
Get information and status about a BigQuery job.
Use this tool to check the status, statistics, or configuration of a job using its `job_id`.
Frequently asked questions
1
What is the Google Cloud BigQuery remote MCP server?
The Google Cloud BigQuery remote MCP server is a hosted Model Context Protocol endpoint at https://bigquery.googleapis.com/mcp, so AI assistants can connect to it without installing or running anything locally.
2
How do I connect to the Google Cloud BigQuery MCP server?
Add the endpoint https://bigquery.googleapis.com/mcp to any MCP-compatible client such as Claude Code, Cursor, or VS Code. The setup snippets on this page configure each client in one step.
3
Does the Google Cloud BigQuery MCP server require authentication?
Yes. Google Cloud BigQuery uses OAuth: the first time you connect, your MCP client opens a browser window to sign in and authorize access, then reuses the credentials for future sessions.
4
Which transport does the Google Cloud BigQuery MCP server use?
Google Cloud BigQuery exposes a Streamable HTTP endpoint, the transport used by remote MCP servers and supported by all major MCP clients.
Comments