MetorialDocs

Set up BigQuery in Metorial for Claude, ChatGPT and Cursor

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'll 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

Sign-in methods

MethodTypeWhat a person provides
Google OAuth (default)OAuthSigns in to BigQuery
Service AccountCustom credentialsserviceAccountJson

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:

ScopeNameWhat it allows
https://www.googleapis.com/auth/bigqueryBigQuery Full AccessView and manage your data in Google BigQuery
https://www.googleapis.com/auth/bigquery.insertdataBigQuery Insert DataInsert data into Google BigQuery
https://www.googleapis.com/auth/bigquery.readonlyBigQuery Read OnlyView your data in Google BigQuery
https://www.googleapis.com/auth/cloud-platformCloud Platform Full AccessView and manage your data across Google Cloud Platform services
https://www.googleapis.com/auth/cloud-platform.read-onlyCloud Platform Read OnlyView your data across Google Cloud Platform services
https://www.googleapis.com/auth/driveGoogle DriveRequired 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.

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.

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 covers the consent screen and the OAuth client in Google Cloud step by step.

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

Open Shared Resources

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

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.

Limit the tools

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

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:

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

Employee: connect BigQuery

In the portal

Open BigQuery in the catalog

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

Authenticate

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

Confirm

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

With the CLI

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.

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.

Check it worked

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