> For the complete documentation index, see [llms.txt](https://www.cakewalk.security/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.cakewalk.security/docs/ai-agent-access/connections-and-integrations/agent-connections/google-bigquery.md).

# Google BigQuery

Connect your company's Google Cloud project to Cakewalk so agents can list datasets and tables and run SQL in BigQuery through the gateway. A Google Cloud admin creates one OAuth client first.

Connect your company's Google Cloud project to Cakewalk's MCP Gateway. Every agent tool call against BigQuery passes through the gateway and is evaluated against your Policies.

## Setup Flow: Register Your Own OAuth Client

Google runs a remote BigQuery MCP server at `https://bigquery.googleapis.com/mcp`. Google's MCP servers do not register clients automatically, so a Google Cloud admin creates one OAuth client in your project and hands the Client ID and Client Secret to your Cakewalk Admin. That happens once per company. After that, each employee signs in with their own Google account, and BigQuery applies that person's IAM permissions.

## Requirements

* A Google Cloud project owner or editor who can enable APIs, grant IAM roles and create OAuth clients in **Google Auth Platform**.
* A Cakewalk Admin, to add the Connection and enter the credentials.

## Step 1: Enable the BigQuery API

In the Google Cloud console, open **APIs & Services > Library**, search for **BigQuery API** and select **Enable**. The BigQuery MCP server is enabled together with the API. There is no separate switch.

## Step 2: Grant the IAM Roles

Every employee who connects needs these roles on the project, under **IAM & Admin > IAM > Grant access**:

| Role                                                   | Why                                |
| ------------------------------------------------------ | ---------------------------------- |
| **MCP Tool User** (`roles/mcp.toolUser`)               | Allows calls to Google's MCP tools |
| **BigQuery Job User** (`roles/bigquery.jobUser`)       | Allows running queries             |
| **BigQuery Data Viewer** (`roles/bigquery.dataViewer`) | Allows reading table data          |

Grant the roles to a Google group to manage access for many employees at once. BigQuery enforces these roles on every tool call, so they are also your narrowest control over which data agents can read.

## Step 3: Set Up Google Auth Platform

1. Open **Google Auth Platform** in the Google Cloud console and select **Get started**.
2. Enter an app name your team recognizes, for example Cakewalk, and a support email.
3. Under **Audience**, select **Internal**. Only accounts in your Google Workspace organization can then sign in, and Google does not need to review the app.
4. Enter a contact email and select **Create**.

## Step 4: Create the OAuth Client

1. In **Google Auth Platform**, go to **Clients** and select **Create client**.
2. For **Application type**, select **Web application**.
3. Enter a name, for example Cakewalk Gateway.
4. Under **Authorized redirect URIs**, select **+ Add URI** and enter Cakewalk's redirect URI:

   ```
   https://mcp-gateway.getcakewalk.io/api/v1/Auth/Callback
   ```
5. Select **Create** and copy the **Client ID** and **Client Secret**. Google shows the secret only once, so store it somewhere safe or download the JSON file.

## Step 5: Add the Connection in Cakewalk

1. Open <https://app.getcakewalk.io>.
2. Go to **Connections**, select **Add org connection**, then **Browse catalog**.
3. Select **Google BigQuery** and select **Continue**.
4. Enter the **Client ID** and **Client Secret** from Step 4.
5. Select **Confirm**.

Credentials are encrypted in your browser before they reach Cakewalk.

## Step 6: Employees Connect

From an agent platform connected to Cakewalk, the employee connects Google BigQuery, signs in with their Google account and allows access. Each call then runs with that employee's IAM roles from Step 2, and each call is still evaluated against your Policies.

## What Agents Can Do

The BigQuery MCP server offers tools to list datasets and tables, read table and dataset details, and run SQL. A separate read-only SQL tool only allows queries that do not change data. Google limits results to 3,000 rows per query and stops queries after three minutes. Google Drive external tables are not supported. Query costs follow your normal BigQuery pricing for the project.

## Verifying It Works

The Google BigQuery Connection card flips to Active on All Connections. From an agent platform connected to Cakewalk, ask the agent to run a small query, for example:

```
SELECT word, word_count FROM `bigquery-public-data.samples.shakespeare` LIMIT 5
```

If BigQuery returns rows, the Connection is live.

## Troubleshooting

* **Google shows a redirect URI mismatch error.** The **Authorized redirect URIs** entry must match `https://mcp-gateway.getcakewalk.io/api/v1/Auth/Callback` exactly, with no trailing slash.
* **Google blocks the sign in or says the app is not verified.** The **Audience** is set to External. Switch it to **Internal**, or add the employee as a test user under **Audience**.
* **Tool calls return a permission error.** The employee is missing one of the roles from Step 2 on the project that holds the data.
* **Tool calls say the API is not enabled.** Enable the BigQuery API in the project (Step 1).
* **The Connection does not appear in the catalog.** Add BigQuery as a custom Connection instead: Connection type **OAuth with client ID and secret**, **MCP Url** `https://bigquery.googleapis.com/mcp`. See [Add a Custom Connection](https://www.cakewalk.security/docs/ai-agent-access/how-to-guides/connections/add-a-custom-connection.md).

## Learn More

* [Use the BigQuery remote MCP server](https://docs.cloud.google.com/bigquery/docs/use-bigquery-mcp)
* [Authenticate to Google Cloud MCP servers](https://docs.cloud.google.com/mcp/authenticate-mcp)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://www.cakewalk.security/docs/ai-agent-access/connections-and-integrations/agent-connections/google-bigquery.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
