BigQuery MCP Server
Aembit supports the official BigQuery MCP server, which lets AI Agent: A software workload that authenticates to systems, requests credentials, and accesses resources, either on behalf of a person or on its own. Aembit secures AI agents with the same identity-first model it uses for any workload. User-driven agents such as Claude Desktop also carry a blended identity that ties access to both the user and the agent.Learn more explore datasets and run SQL queries through Model Context Protocol: A standard protocol for AI agent and server interactions that defines how AI assistants communicate with external tools and data sources.Learn more(opens in new tab) tools.
This page describes how to configure BigQuery as an MCP Server: A server that implements the Model Context Protocol to provide tools, resources, or data to AI agents and MCP clients.Learn more(opens in new tab) behind the Aembit MCP Identity Gateway: A component that brokers MCP traffic between MCP clients and target MCP servers, validating authorization and presenting Aembit-managed credentials on each request.Learn more. Each user authenticates with their own Google identity, and the Gateway injects their token into MCP requests.
Prerequisites
Section titled “Prerequisites”Before you begin, ensure you have the following:
- A Google Cloud project where you can enable APIs and create OAuth credentials
- A BigQuery dataset with data to query
- A configured Aembit MCP Identity Gateway
Requirements and considerations
Section titled “Requirements and considerations”Before you configure BigQuery, review these requirements and behaviors specific to BigQuery’s MCP server.
- Each user needs their own BigQuery access. The Gateway authenticates with each user’s Google identity, so
BigQuery enforces that user’s IAM roles rather than a shared service account. Also grant
roles/bigquery.jobUser; without it, BigQuery rejects theexecute_sqltool. - This guide grants read-only access. It uses the
bigquery.readonlyscope, which covers browsing datasets and running queries. Add a broader scope if your agents need to modify data.
Set up your Google Cloud Platform project
Section titled “Set up your Google Cloud Platform project”Configure a Google Cloud project with the BigQuery API, user permissions, and an OAuth client.
-
In the Google Cloud console, select the project you want to use.
-
Enable the BigQuery API (
bigquery.googleapis.com) for the project. -
Grant each user who queries BigQuery the
roles/bigquery.dataViewerandroles/bigquery.jobUserIAM roles. -
Go to the Credentials page, click Create Credentials, then select OAuth client ID. If your project has no consent screen, configure one first: choose a User type, enter the app details, then add the
https://www.googleapis.com/auth/bigquery.readonlyscope. -
For Application type, select Web application, enter a name, then click Create. Leave Authorized redirect URIs empty for now. You add the Aembit Callback URL after you create the Credential Provider.
-
Copy the Client ID and Client secret, and store them for the next section.
Configure the Credential Provider
Section titled “Configure the Credential Provider”Create an MCP User-Based Access Token Credential Provider: Credential Providers obtain the specific access credentials—such as API keys, OAuth tokens, or temporary cloud credentials—that Client Workloads need to authenticate to Server Workloads.Learn more in Aembit.
-
Log into your Aembit Tenant.
-
Go to Credential Providers in the left sidebar and click + New.
-
Configure the following fields:
Field Value Name A user-friendly name Credential Type MCP User-Based Access Token MCP Server URL https://bigquery.googleapis.com/mcpClient ID The Client ID you copied from Google Cloud Client Secret The Client Secret you copied from Google Cloud Scopes https://www.googleapis.com/auth/bigquery.readonlyPKCE Required On For MCP Server URL, click Discover to populate the Authorization URL and Token URL.
-
Click Save.
-
Copy the read-only Callback URL from the Credential Provider.
Finish configuring the OAuth client
Section titled “Finish configuring the OAuth client”Return to the OAuth client in the Google Cloud console.
-
Open the Web application OAuth client you created.
-
Under Authorized redirect URIs, click Add URI, paste the Aembit Callback URL, then click Save.
Authorize the Credential Provider
Section titled “Authorize the Credential Provider”-
Return to the Credential Provider in Aembit and click Authorize.
-
Choose your Google Account and approve access. The Credential Provider status changes to Ready when the flow completes.
Create the Server Workload
Section titled “Create the Server Workload”-
Go to Server Workloads in the left sidebar and click + New.
-
Configure the following fields:
Field Value Name A user-friendly name Host bigquery.googleapis.comApplication Protocol MCP Port 443 with TLS URL Path /mcpAuthentication method HTTP Authentication Authentication scheme Bearer -
Click Save.
Create an Access Policy
Section titled “Create an Access Policy”Create an Access Policy: Access Policies define, enforce, and audit access between Client and Server Workloads by cryptographically verifying workload identity and contextual factors rather than relying on static secrets.Learn more linking your Client Workload: Client Workloads represent software applications, scripts, or automated processes that initiate access requests to Server Workloads, operating autonomously without direct user interaction.Learn more (the AI agent), the MCP User-Based Access Token Credential Provider, and the BigQuery Server Workload. See Access Policies for details.
Verify
Section titled “Verify”After a user authorizes access, the Aembit AI Access Authorized page lists the BigQuery MCP Server as Ready.
The AI agent can then call BigQuery MCP tools (such as execute_sql) through the Gateway.