> Documentation index: https://metorial.com/llms.txt. Every page is available as Markdown by adding .md to its URL.

# Set up BigQuery in Metorial for Claude, ChatGPT and Cursor
URL: https://metorial.com/docs/integrations/google-bigquery
Last updated: 2026-11-24

Share BigQuery with your team in Claude, ChatGPT and Cursor through Metorial: OAuth or service account sign-in, 29 tools (14 read-only).

---

To give your team BigQuery in Claude, ChatGPT, Cursor and other AI clients, an admin shares the BigQuery integration in a Metorial portal, and each person signs in to BigQuery with their own account. Agents can execute SQL queries against BigQuery datasets, including DML and DDL statements. The integration has 29 tools, 14 read-only, 10 write and 5 destructive, plus 3 triggers.

**What you will learn**

- How an admin shares BigQuery in a portal and how each person connects
- The 6 OAuth scopes BigQuery can request, and what each one allows
- How to keep the 14 read-only tools and reject the other 15

**Before you start**

- A [portal](https://metorial.com/docs/platform/workforce/portals) with at least one access group
- An account with BigQuery for each person who connects
- For the CLI steps: the [Metorial CLI](https://metorial.com/docs/platform/cli), signed in to your portal

## Sign-in methods

| Method | Type | What a person provides |
| --- | --- | --- |
| **Google OAuth** (default) | OAuth | Signs in to BigQuery |
| **Service Account** | Custom credentials | `serviceAccountJson` |

The portal and `metorial setup` use **Google OAuth** unless someone picks another method.

### Google OAuth

People sign in to BigQuery and approve the scopes you allow. The integration can request:

| Scope | Name | What it allows |
| --- | --- | --- |
| `https://www.googleapis.com/auth/bigquery` | BigQuery Full Access | View and manage your data in Google BigQuery |
| `https://www.googleapis.com/auth/bigquery.insertdata` | BigQuery Insert Data | Insert data into Google BigQuery |
| `https://www.googleapis.com/auth/bigquery.readonly` | BigQuery Read Only | View your data in Google BigQuery |
| `https://www.googleapis.com/auth/cloud-platform` | Cloud Platform Full Access | View and manage your data across Google Cloud Platform services |
| `https://www.googleapis.com/auth/cloud-platform.read-only` | Cloud Platform Read Only | View your data across Google Cloud Platform services |
| `https://www.googleapis.com/auth/drive` | Google Drive | Required for querying data from Google Sheets via federated queries |

### Service Account

To connect, a person enters:

- `serviceAccountJson`: Service account JSON key file contents

### Setup settings

Whichever method you pick, setup also asks for:

- `projectId`: Google Cloud Project ID used for all BigQuery API calls
- `location` (optional): Default data location/region for BigQuery operations (e.g., US, EU, us-central1)

## Use your own BigQuery OAuth app

With your own OAuth app, people see your company's name on the BigQuery consent screen, and the client ID and secret belong to you.

1. **Start the credentials in Metorial**

   In the dashboard, select **Settings**, then **Organization Settings**. Under **Integrations and MCP**, select **Provider Auth**, then **Create Auth Credentials**. Choose BigQuery and copy the **Redirect URI**.

2. **Register the app**

   In the Google Cloud console, enable the API behind BigQuery under **APIs & Services**, **Library**. Then go to **Google Auth platform**, **Clients**, click **Create Client**, choose **Web application**, and paste the redirect URI from Metorial under **Authorized redirect URIs**. Google shows the client secret only when you create the client.

   The [Google Workspace guide](https://metorial.com/docs/platform/integrations/google-workspace) covers the consent screen and the OAuth client in Google Cloud step by step.

3. **Finish in Metorial**

   Copy the app's client ID and client secret. Back in Metorial, enter a **Name**, the **Client ID** and the **Client Secret**, review **Scopes**, and select **Create**. Then pick these credentials for the BigQuery integration.

## Admin: share BigQuery in a portal

### In the dashboard

1. **Open Shared Resources**

   Open **Workforce**, choose the portal, and select **Shared Resources** under **Access**.

2. **Share a new integration**

   Select **Share a Resource**, then **New Integration**, and choose BigQuery. Under **Auth Method**, keep **Google OAuth** or pick another. For how members connect, choose **Each person connects**, so everyone signs in to BigQuery as themselves.

3. **Limit the tools**

   Under **Tool Filters**, set the write and destructive groups to **Reject** if agents should only read from BigQuery.

4. **Choose who gets it**

   Add the access groups that should see BigQuery. When a person asks for access from the portal, the request appears under **Access Requests**.

### With the CLI

The CLI cannot create the per-user BigQuery integration. Once it exists, check which groups have it:

```bash
metorial-admin portals access list <portal-id> --type provider_template --search bigquery
```

## Employee: connect BigQuery

### In the portal

1. **Open BigQuery in the catalog**

   Sign in to your portal and open BigQuery. The status reads **Available**.

2. **Authenticate**

   Under **Quick setup**, select **Authenticate**. A BigQuery sign-in tab opens. Sign in and approve the permissions listed.

3. **Confirm**

   The status changes to **Configured**. If it later reads **Needs reconnect**, select **Reconnect** and sign in again.

### With the CLI

```bash
metorial catalog search bigquery
metorial setup <catalog-item-id>
```

`catalog search` prints the catalog item ID. `metorial setup` uses **Google OAuth**. To connect with **Service Account** instead, find its ID with `metorial catalog get <catalog-item-id>` and add `--auth-method <auth-method-id>`.

### Add it to your AI client

`metorial install` adds your BigQuery connection to a local MCP client such as Claude Code, Cursor or Codex. `metorial list` prints the integration ID and `metorial client list` the client identifiers.

```bash
metorial list bigquery
metorial client list
metorial install <client-identifier> <integration-id>
```

For a client that takes a server URL, such as ChatGPT, `metorial install custom <integration-id>` creates an installation token and shows the endpoint details.

## Make it read-only

Open the integration's **Tool Filters** and set the write and destructive groups to **Reject**. Agents keep the 14 read-only tools, such as `get_job` and `get_model`, and lose the 10 write tools, such as `load_data` or `copy_table`, and the 5 destructive tools, such as `cancel_job` or `delete_model`.

Employees see the result on the integration's page in the portal under **Tool access**. For the full walkthrough, see [Tool permissions](https://metorial.com/docs/platform/guides/tool-permissions).

## Check it worked

```bash
metorial list bigquery
metorial tools <integration-id>
metorial call <integration-id> list_jobs -d '{}'
```

`metorial tools` lists the 29 tools, minus any you rejected. `list_jobs` takes no input. It lists BigQuery jobs in the project.

To see every input a tool takes, run `metorial schema <integration-id> <tool-key>`.

## Tools

### Read-only tools (14)

- `get_job`: Retrieve detailed information about a specific BigQuery job including its configuration, status, and execution statistics. Needs `jobId`.
- `list_jobs`: List BigQuery jobs in the project.
- `list_routines`: List user-defined functions (UDFs), stored procedures, and table-valued functions in a BigQuery dataset. Needs `datasetId`.
- `list_datasets`: List all datasets in the configured BigQuery project.
- `export_data`: Export a BigQuery table to Google Cloud Storage as CSV, JSON, or Avro. Needs `datasetId`, `tableId` and `destinationUris`.
- `read_table_data`: Read rows directly from a BigQuery table without running a query job. Needs `datasetId` and `tableId`.
- `get_table`: Retrieve detailed metadata for a BigQuery table, including its schema, row count, size, partitioning configuration, and clustering settings. Needs `datasetId` and `tableId`.
- `list_tables`: List all tables, views, and materialized views in a BigQuery dataset. Needs `datasetId`.
- `get_routine`: Retrieve detailed information about a specific BigQuery routine including its definition, arguments, return type, and language. Needs `datasetId` and `routineId`.
- `get_dataset`: Retrieve detailed information about a specific BigQuery dataset, including its schema, access controls, creation time, and configuration. Needs `datasetId`.
- `get_model`: Retrieve detailed metadata for a BigQuery ML model, including model type, feature columns, label columns, training runs, labels, and expiration metadata. Needs `datasetId` and `modelId`.
- `list_models`: List BigQuery ML models in a dataset. Needs `datasetId`.
- `execute_sql_readonly`: Run a read-only GoogleSQL query against BigQuery.
- `get_current_user`: Get the connected Google account ID, email address, name, and profile image when available.

### Write tools (10)

- `create_routine`: Create a new BigQuery routine: user-defined function (UDF), stored procedure, or table-valued function. Needs `datasetId`, `routineId`, `routineType` and `definitionBody`.
- `copy_table`: Copy a BigQuery table to another table, within the same dataset or across datasets and projects. Needs `sourceDatasetId`, `sourceTableId`, `destinationDatasetId` and `destinationTableId`.
- `update_table`: Update a BigQuery table's metadata including friendly name, description, schema (add new columns), expiration, and labels. Needs `datasetId` and `tableId`.
- `update_dataset`: Update an existing BigQuery dataset's metadata, including its friendly name, description, labels, and default expiration settings. Needs `datasetId`.
- `execute_query`: Run a GoogleSQL (standard SQL) query against BigQuery. Needs `query`.
- `create_dataset`: Create a new BigQuery dataset. Needs `datasetId`.
- `insert_rows`: Stream rows into a BigQuery table using the streaming insert API. Needs `datasetId`, `tableId` and `rows`.
- `load_data`: Load data from Google Cloud Storage into a BigQuery table. Needs `datasetId`, `tableId`, `sourceUris` and `sourceFormat`.
- `create_table`: Create a new BigQuery table, view, or materialized view. Needs `datasetId` and `tableId`.
- `update_model`: Update BigQuery ML model metadata such as friendly name, description, expiration time, and labels. Needs `datasetId` and `modelId`.

### Destructive tools (5)

- `delete_routine`: Permanently delete a BigQuery routine (UDF, procedure, or TVF). Needs `datasetId` and `routineId`.
- `cancel_job`: Cancel a running BigQuery job. Needs `jobId`.
- `delete_dataset`: Delete a BigQuery dataset. Needs `datasetId`.
- `delete_table`: Permanently delete a BigQuery table or view. Needs `datasetId` and `tableId`.
- `delete_model`: Permanently delete a BigQuery ML model from a dataset. Needs `datasetId` and `modelId`.

## Triggers

BigQuery has 3 triggers, which fire on events in BigQuery:

- `dataset_changed`: Triggers when datasets are created, modified, or deleted in the project.
- `job_completed`: Triggers when a BigQuery job (query, load, extract, or copy) completes, either successfully or with errors.
- `inbound_webhook`

## Next steps

- [Claude Code](https://metorial.com/docs/platform/clients/claude-code), [Cursor](https://metorial.com/docs/platform/clients/cursor), [Codex](https://metorial.com/docs/platform/clients/codex) and [ChatGPT](https://metorial.com/docs/platform/clients/chatgpt): connect each client to your portal and use BigQuery there
- [Create custom OAuth credentials](https://metorial.com/docs/platform/integrations/create-custom-oauth-credentials): the Provider Auth screens in more detail
- [Tool permissions](https://metorial.com/docs/platform/guides/tool-permissions): tool filters and what employees see
- [Google Workspace guide](https://metorial.com/docs/platform/integrations/google-workspace): the consent screen and the OAuth client in Google Cloud
- [BigQuery on metorial.com](https://metorial.com/integrations/google-bigquery): the integration overview