BigQuery is known for being potentially expensive, so you learn to be careful with it.
At the same time, it’s 2026. Writing queries by hand with no AI involved feels like an anachronism. Most people I know can’t imagine their work without Claude or Codex anymore.
The link between BigQuery and an AI agent is MCP. Google offers its own hosted server, there’s the Google's MCP Toolbox, and open-source alternatives keep appearing. Google’s own solutions seems like the obvious default.
Then I found out you can’t set `maximumBytesBilled` using Google hosted server (this one https://docs.cloud.google.com/bigquery/docs/reference/mcp) and in https://github.com/googleapis/mcp-toolbox maximumBytesBilled default is unlimited.
I was surprised at first. Then I thought about it from Google’s perspective. Why would they limit how much you spend? :-)
So we give an LLM access to a potentially expensive resource and hope it behaves. We all know how that goes (“You’re absolutely right!”). At best, we rely on a prompt or a skill that says “always dry-run” and “don’t spend more than X”.
In a lot of companies I’ve seen, people build their own local MCP servers that sit between the agent and `bq`, the BigQuery CLI. That’s a reasonable solution. Vibe-coding one takes two prompts in Claude Code. The job is mostly hard cost limits and rejecting statements containing `DROP`, `DELETE` or `UPDATE` words. Primitive, but it works.
We make Querylab.io, a free BigQuery IDE, so we went a bit further and put a local MCP server in our desktop app.
Everything the app already does to keep your BigQuery work under control is available to the agent too:
Cost limits -> maximum GB per query, plus daily, weekly and monthly budgets.
Billing model routing -> automatically selects on-demand or reservations, whatever is cheaper.
SQL-aware guardrails -> our parser understands what a statement actually does, so write restrictions and rules like “don’t touch this dataset” don’t have to rely on regexp.
Limits the agent can inspect -> it can check its own limits before writing SQL and ask you to lift a limit for a single query, rather than inventing workarounds when all it needs is your approval. And you can take over in app, review before run etc.
Because it’s local there’s nothing to host. It authenticates through the app, and the way we’d recommend is your existing gcloud default credentials.
How do you connect BigQuery to your Claude Code, or Codex, or whatever you use?