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
- A portal with at least one access group
- An account with BigQuery for each person who connects
- For the CLI steps: the Metorial 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 callslocation(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:
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
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.
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 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. NeedsjobId.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. NeedsdatasetId.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. NeedsdatasetId,tableIdanddestinationUris.read_table_data: Read rows directly from a BigQuery table without running a query job. NeedsdatasetIdandtableId.get_table: Retrieve detailed metadata for a BigQuery table, including its schema, row count, size, partitioning configuration, and clustering settings. NeedsdatasetIdandtableId.list_tables: List all tables, views, and materialized views in a BigQuery dataset. NeedsdatasetId.get_routine: Retrieve detailed information about a specific BigQuery routine including its definition, arguments, return type, and language. NeedsdatasetIdandroutineId.get_dataset: Retrieve detailed information about a specific BigQuery dataset, including its schema, access controls, creation time, and configuration. NeedsdatasetId.get_model: Retrieve detailed metadata for a BigQuery ML model, including model type, feature columns, label columns, training runs, labels, and expiration metadata. NeedsdatasetIdandmodelId.list_models: List BigQuery ML models in a dataset. NeedsdatasetId.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. NeedsdatasetId,routineId,routineTypeanddefinitionBody.copy_table: Copy a BigQuery table to another table, within the same dataset or across datasets and projects. NeedssourceDatasetId,sourceTableId,destinationDatasetIdanddestinationTableId.update_table: Update a BigQuery table's metadata including friendly name, description, schema (add new columns), expiration, and labels. NeedsdatasetIdandtableId.update_dataset: Update an existing BigQuery dataset's metadata, including its friendly name, description, labels, and default expiration settings. NeedsdatasetId.execute_query: Run a GoogleSQL (standard SQL) query against BigQuery. Needsquery.create_dataset: Create a new BigQuery dataset. NeedsdatasetId.insert_rows: Stream rows into a BigQuery table using the streaming insert API. NeedsdatasetId,tableIdandrows.load_data: Load data from Google Cloud Storage into a BigQuery table. NeedsdatasetId,tableId,sourceUrisandsourceFormat.create_table: Create a new BigQuery table, view, or materialized view. NeedsdatasetIdandtableId.update_model: Update BigQuery ML model metadata such as friendly name, description, expiration time, and labels. NeedsdatasetIdandmodelId.
Destructive tools (5)
delete_routine: Permanently delete a BigQuery routine (UDF, procedure, or TVF). NeedsdatasetIdandroutineId.cancel_job: Cancel a running BigQuery job. NeedsjobId.delete_dataset: Delete a BigQuery dataset. NeedsdatasetId.delete_table: Permanently delete a BigQuery table or view. NeedsdatasetIdandtableId.delete_model: Permanently delete a BigQuery ML model from a dataset. NeedsdatasetIdandmodelId.
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, Cursor, Codex and ChatGPT: connect each client to your portal and use BigQuery there
- Create custom OAuth credentials: the Provider Auth screens in more detail
- Tool permissions: tool filters and what employees see
- Google Workspace guide: the consent screen and the OAuth client in Google Cloud
- BigQuery on metorial.com: the integration overview