MCP.so
登录

Google Cloud BigQuery MCP Server

@Google Cloud BigQuery

基本信息

传输方式

Streamable HTTP

认证方式

OAuth

分类

数据库

作者

Google Cloud BigQuery

关于 Google Cloud BigQuery MCP Server

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.

连接信息

https://bigquery.googleapis.com/mcp

接入方式

claude mcp add bigquery --transport http https://bigquery.googleapis.com/mcp

Google Cloud BigQuery MCP Server 工具

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`.

常见问题

1

Google Cloud BigQuery 远程 MCP 服务器是什么?

Google Cloud BigQuery 的远程 MCP 服务器是一个托管的 Model Context Protocol 端点,地址是 https://bigquery.googleapis.com/mcp,AI 助手无需在本地安装或运行任何东西即可连接。

2

怎么连接 Google Cloud BigQuery 的 MCP 服务器?

把端点 https://bigquery.googleapis.com/mcp 添加到任意支持 MCP 的客户端,比如 Claude Code、Cursor 或 VS Code。本页的接入代码块可以一步配置好每个客户端。

3

Google Cloud BigQuery 的 MCP 服务器需要认证吗?

需要。Google Cloud BigQuery 使用 OAuth——第一次连接时,你的 MCP 客户端会打开浏览器窗口登录并授权,之后会复用这个凭证。

4

Google Cloud BigQuery 的 MCP 服务器用的是哪种传输方式?

Google Cloud BigQuery 暴露的是 Streamable HTTP 端点,这是远程 MCP 服务器普遍使用、主流客户端都支持的传输方式。

评论