# How to connect Google BigQuery to AI agents?

Connect Google BigQuery to Sequel and query petabytes of data in natural language from the app or any MCP client.

Connect Google BigQuery to Sequel and query it in plain English — from the Sequel app or any AI tool wired up to the [MCP server](/docs/install). BigQuery is Google's fully-managed, serverless data warehouse, and Sequel connects to it with a read-only Google sign-in so you can ask questions across your datasets without writing GoogleSQL by hand.

## What you'll need

- A **Google Cloud project** with the **BigQuery API** enabled.
- A **Google account** with read access to the datasets you want to query — in practice the `roles/bigquery.dataViewer` role (to read tables) and `roles/bigquery.jobUser` role (to run queries).
- Your **GCP Project ID** — the unique identifier for your project, e.g. `my-company-analytics-123`. You'll find it at the top of the Google Cloud Console, or by running `gcloud config get-value project`.

<Callout type="tip" title="Connect with a least-privilege account">
Sign in with an account that only has read access to the datasets you intend to expose. Sequel requests the read-only `bigquery.readonly` scope, so it can run `SELECT` queries but can never modify your data.
</Callout>

## Connect it

<Steps>
<Step title="Open a new connection">
In the Sequel dashboard, go to **Connections → New connection** and choose **BigQuery**.
</Step>

<Step title="Sign in with Google">
Authorize Sequel through Google OAuth 2.0. Sequel only requests the read-only `bigquery.readonly` scope — there are no service-account JSON keys to create or manage.
</Step>

<Step title="Enter your GCP Project ID">
Provide the project you want to query.

<CodeBlock language="bash" label="GCP Project ID">my-company-analytics-123</CodeBlock>

Sequel verifies the project, confirms the BigQuery API is enabled, and checks that your account can list datasets.
</Step>

<Step title="Test and save">
Sequel reads your datasets and table schemas. A green check means it's live. You can restrict schema introspection to specific datasets later from the connection settings.
</Step>
</Steps>

## Try it

Once connected, ask things like:

- "What are the top 10 events by count this week?"
- "Show me daily revenue for the past 30 days as a line chart."
- "Which users had the highest session count last month?"
- "List all tables in my analytics dataset with row counts."

## Troubleshooting

| Symptom | Likely fix |
| --- | --- |
| "Access denied" / 403 | Make sure the BigQuery API is enabled and your account has `bigquery.dataViewer` (read) and `bigquery.jobUser` (run queries) roles. |
| "Project not found" / 404 | Double-check the GCP Project ID — use the project ID, not the project name or number. |
| Queries scan too many bytes | BigQuery bills per bytes scanned. Add an instruction in the connection settings to always filter by partition columns on large tables. |

## Related

- [Connecting your first data source](/docs/connecting-your-first-data-source)
- [Chatting with your data](/docs/chatting-with-your-data)
- [Browse all integrations](/docs/integrations)
