MCP Gateway · Claude Code
Connect BigQuery to Claude Code
Data engineers change warehouse tables from the same terminal where they write the pipeline code. With BigQuery behind the Speakeasy MCP Gateway, Claude Code can inspect a table before a migration, verify a backfill with read-only SQL and, where a role allows it, run statements that write. Agent hooks let Speakeasy allow or deny each query before Claude Code runs it.
- Category
- Data & analytics
- Tools
- 6
- Authentication
- OAuth
- Claude Code
- CLI
Behind the MCP Gateway
Run BigQuery MCP behind the MCP Gateway
One URL for every agent, sign-in through your IdP, RBAC down to the tool, and every BigQuery call inspected and logged.
Before you start
What BigQuery needs first
A Google Cloud project administrator with IAM admin access does the BigQuery side of the setup.
- You need a Google Account that can administer the project and create OAuth credentials.
- Granting roles needs IAM admin access, such as Project IAM Admin.
- Billing is optional for initial setup.
- External apps in Testing allow at most 100 test users, and authorizations expire after seven days.
In BigQuery
- Enable the BigQuery API in the project.
- Grant each user MCP Tool User, BigQuery Job User, and BigQuery Data Viewer.
- Configure the OAuth consent screen as Internal or External.
- For External apps, add the BigQuery scope and test users, or publish the app.
- Create an OAuth client and copy its credentials.
Set up
Add BigQuery to Claude Code in 4 steps
- 01
Add BigQuery from the catalog
An admin finds BigQuery in the MCP Catalog (MCP Gateway > MCP > Catalog) and clicks Add. Speakeasy registers the vendor's server as a remote MCP server and proxies sessions to it. Nothing is copied or re-hosted.
BigQuery uses OAuth. Servers that support dynamic client registration get their OAuth configuration applied automatically.
Where MCP-scoped policies are enabled, the install offers a recommended risk policy for the new server that detects secrets and PII and inspects tool requests and responses.
- 02
Choose who can use BigQuery
Give teams the
mcp:connectscope on the BigQuery server through team access or a role. The organization gateway works out each person's servers from their live access, so granting access adds BigQuery to their gateway on the next call, and removing it takes it away. - 03
Connect Claude Code
Add the organization gateway as an HTTP MCP server, then authenticate from /mcp.
Run the command below with your organization gateway URL.
Open
/mcpin Claude Code and choose Authenticate to sign in.claude mcp add --transport http --scope user \ 'speakeasy' \ 'https://<organization host>/mcp/gateway/<organization slug>' - 04
Sign in and use BigQuery from Claude Code
The first time Claude Code connects, it opens a browser so the person can sign in to Speakeasy through your identity provider.
BigQuery needs its own OAuth grant, so each person connects it once. Until they do, BigQuery calls fail while the rest of the gateway keeps working.
From then on, BigQuery's tools appear in Claude Code, limited to what the person's access allows, and every call lands in the gateway's tool logs.
To roll it out to a whole team, publish the server in a plugin and register the plugin marketplace in Claude Code's managed settings, so every member gets it without running the command. The device agent can also write and reapply these settings on each laptop.
Use cases
What Claude Code users do with BigQuery
Inspect a table before a migration
Before writing a schema change, Claude Code reads the table's metadata so the migration matches the columns and types that actually exist in the warehouse.
Verify a backfill with read-only SQL
After a backfill script finishes, Claude Code runs read-only checks on counts and nulls to confirm the data landed, with no risk of changing it.
Run a write only where allowed
Statements that modify data go through execute_sql, which you can grant to the data platform role and withhold from everyone else at the gateway.
Tools
6 tools
Each BigQuery tool can be allowed or denied per team and role at the MCP Gateway before Claude Code sees it.
list_dataset_ids
List BigQuery dataset IDs in a Google Cloud project.
get_dataset_info
Get metadata information about a BigQuery dataset.
list_table_ids
List table ids in a BigQuery dataset.
get_table_info
Get metadata information about a BigQuery table.
execute_sql_readonly
Run a read-only SQL query in the project and return the result. Prefer this tool over execute_sql if possible.
execute_sql
Run a SQL query in the project and return the result. Prefer the execute_sql_readonly tool if possible.
Control
What Speakeasy can see and stop in Claude Code
The gateway covers every client the same way. The rest depends on what Claude Code exposes to Speakeasy.
Tool logs
Gateway
Every BigQuery call is logged with the person and the client that made it.
Access by role
Gateway
People reach only the BigQuery tools their team or role allows.
Request and response blocking
Gateway
A risk policy scoped to BigQuery can reject a tool request before it reaches the server, or withhold a result from Claude Code. MCP-scoped policies are enabled per organization.
Prompt and tool-call blocking
Claude Code
Agent hooks send each prompt and tool call to Speakeasy, which allows or denies it before Claude Code runs it.
User attribution
Claude Code
Claude Code's OpenTelemetry exporter ties each session to a named person. Without it, activity can't be attributed.
Budgets
Claude Code
Spend limits can block Claude Code traffic once a budget is reached.
Device agent and MDM
Claude Code
The device agent installs the marketplace, plugin and telemetry settings and reapplies them every minute. It deploys through MDM.
Anthropic inference hooks
Claude Code
On Claude Enterprise, prompts can be checked before inference with nothing installed on the device (beta).
- Claude Code on the web doesn't use the laptop setup. It needs the device agent in a shared Anthropic-hosted environment.
- Plugin marketplace URLs for Claude Code carry an access token, so share install snippets only through a private channel.
Questions
Frequently asked questions
Can I give Claude Code read-only access to BigQuery?
Which Google Cloud roles does each developer need?
How do Claude Code users get BigQuery?
Are BigQuery calls from Claude Code logged?
Connect more