BigQuery MCP for outside agents
Vuon serves a drop-in replacement for Google's BigQuery MCP server. An agent switches by changing the server URL: it keeps the same tool names and arguments, but every query is checked by Vuon's SQL checker, held to caps you control, and recorded on Query checks under the agent that sent it.
This is the BigQuery guide, and the full reference for clients, enforcement modes, caps, and attribution. Those are Vuon's, not BigQuery's, and work the same way on the Snowflake, Databricks, and Redshift servers.
Overview
The server is at:
https://<workspace>.vuon.ai/api/mcp/bigquery
It exposes the nine tools of Google's BigQuery MCP server, in Google's order and with Google's input schemas:
| Tool | What it does here |
|---|---|
list_dataset_ids | Lists the datasets of the client's connection. |
list_table_ids | Lists the tables of one dataset. |
get_dataset_info | Dataset metadata, with how many tables Vuon has documented. |
get_table_info | Table schema and size, plus a vuon block with the documentation Vuon's checker enforces: column values, joins, row validity, and similar declarations. |
execute_sql_readonly | Checks, then runs one read-only SELECT. |
execute_sql | Accepts the same queries as execute_sql_readonly and refuses everything else. |
get_query_results | Returns a page of a finished job's rows, or waits for a running one. |
get_job | A job's status, with Vuon's check outcome. |
cancel_job | Cancels a job that is still running. |
The dataset and table tools answer from Vuon's catalog of the connection, not from BigQuery directly: the tables Vuon has synced and has not hidden from agents.
The server must be enabled for your workspace first. It is off by default and independent of the Vuon MCP server; contact Vuon to turn it on. Until then every request is refused with a 403 saying the BigQuery-compatible endpoint is not enabled for the organization.
Use this server for every BigQuery query an outside agent runs, and add the Vuon MCP server for dataset context and metrics. See the recommended setup. If you're wiring up a bot that many people talk to, see Connect your data agent.
Clients
Vuon tracks each outside agent as a client, the way Sentry groups one application's events under a project. A client has:
- A name, such as "Claude Code" or "Nightly revenue agent".
- One BigQuery connection that it queries. Only a shared BigQuery connection works: not archived, not one member's personal connection, and not one authorized through a member's desktop sign-in, which the server cannot use.
- An enforcement mode, which decides whether the SQL checker blocks queries.
- Caps on each query it runs.
- Tools: which MCP tools the agent may use, on both servers. See Tools.
- A service account: the connection's by default, or the client's own JSON key, so different agents can hold different BigQuery grants on the same connection. The connection's project, catalog, documentation, and SQL checks stay shared either way. A client's own account needs the same grants a connection's account needs to run queries: BigQuery Job User plus read access to the tables (see BigQuery setup). Vuon checks only that the pasted text is a service account JSON key; it doesn't test the key against BigQuery when you save it, so a wrong or under-granted key shows up as an error on the agent's first query.
- Credentials: API keys created for it, or the OAuth application it signs in with.
Which client a request belongs to is decided by its credential alone. A header or a label in a call can describe a request, never change who sent it.
Create one client per agent, so Query checks can tell them apart and each can have its own keys, enforcement, and caps. A bot that many people talk to is still one agent, so it is one client; the people behind it are told apart by end user.
Manage clients
Workspace admins manage clients in Settings → Databases. Open the BigQuery database and find its Outside agents list. Each client opens its own page with Connect (the server URL and project), Tools, Keys (which you can revoke there, and which shows the member each key acts as), Checks and caps, and Activity, a link to Query checks filtered to the client.
Clients build on Query checks, so the Outside agents list appears once Query checks is available for your workspace.
Auto-created clients
You don't have to create a client before an agent connects. Vuon creates one when it sees a credential it doesn't know:
- An API key that isn't bound to a client gets a new client named Key: <key name>, and the key is bound to it.
- An OAuth application (an MCP client signing in for the first time) gets a client named after the application, or
OAuth app <id>if its name can't be looked up.
These clients wait for a connection. Until an admin gives one a BigQuery connection, every query it sends is refused with a message saying the client has no BigQuery connection yet. They appear under Waiting for a connection in the Outside agents list, where you can add them to the connection or merge them into a client you already manage.
Merge and archive
- Merge folds one client into another. The source's keys (including revoked ones) and its OAuth application move to the target, and the source is archived. Queries the source already recorded stay under its name. Two clients that both belong to an OAuth application can't be merged, because a client can belong to only one.
- Archive retires a client. Keys created for it stop working immediately on both servers. A person's own key that Vuon auto-bound to it is refused here but keeps working on the Vuon server as that person's key. Its OAuth application is released, so that application's next sign-in opens a new client. There is no unarchive.
Tools
On the client's page, under Tools, admins choose which MCP tools the agent may use. Switch off a whole group or a single tool; changes save immediately. Any group or tool can be switched off for any client. A tool that is off is hidden from tools/list and refused if the agent calls it directly, on both servers.
Every tool is on by default. Vuon stores the tools that are off, so a tool added later starts on. whoami is always available and is in no group.
| Server | Group | Tools |
|---|---|---|
| BigQuery | Browse datasets and tables | list_dataset_ids, get_dataset_info, list_table_ids, get_table_info |
| BigQuery | Run queries | execute_sql_readonly, execute_sql, get_query_results, get_job, cancel_job |
| Vuon | Dataset context | explore_context |
| Vuon | Charts | explore_dataset |
| Vuon | Transform results | transform_results |
| Vuon | Read metrics | list_metrics, search_metrics, get_metric |
| Vuon | Create metrics | create_metric |
| Vuon | Query checks evidence | get_query_check_issue, get_query_check_occurrence |
Create metrics and Query checks evidence are out of reach for a key created for the client: they only work for an OAuth sign-in whose role allows them, or a person's own key or sign-in bound to the client. For a client without an OAuth application, those two groups carry a note saying so, and you can still switch them off.
Charts (explore_dataset) is on by default. A key created for the client charts as the client's bot, except in a workspace that limits Explorer to email domains; see explore_dataset.
Transform results (transform_results) is on by default. It transforms the results of this client's own queries with DuckDB on the stored result, so it never queries BigQuery and isn't recorded on Query checks; see transform_results. Switch it off to keep the agent to queries Vuon checks.
The Vuon groups appear only where the Vuon server is enabled for your workspace. Where it isn't, the Tools section says Vuon's own MCP server is not enabled, so agents reach only the BigQuery server, and the client's Connect section shows no Vuon URL.
For example, turn off Run queries to let an agent browse the catalog without running SQL, or turn off Browse datasets and tables to keep it to queries.
Enforcement modes
Enforcement decides what the SQL checker does with a query it would reject. Every query is checked and recorded in every mode. New and auto-created clients start in Observe.
| Mode | Behavior |
|---|---|
| Observe | Runs every query and records what the checker would have blocked. For those queries the response says so: vuon.check.outcome is would_block. |
| Standard | Blocks queries the standard checks reject. |
| Strict | Blocks with the strict checks too: the checker also treats its row-validity, lifecycle, session-attribution, versioned-definition, and negative-duration findings as blocking. These are correctness checks on the SQL's meaning. |
Strict doesn't block SELECT *, a missing LIMIT, or a full table scan. The checker blocks a scan only through its performance advice, in every mode except Observe: a table of 100 million rows or more scanned twice across CTEs or subqueries, or read in an IN (SELECT ...) subquery. Beyond that, the only limit on how much a query scans is the byte cap under Caps.
A blocked query is not run. The agent gets a tool error that starts "Vuon checked this query and did not run it", with each error and warning by line and column, and "Fix the SQL and run it again; the same SQL is refused again." That is enough for an agent to correct the SQL and retry.
A good rollout is to start a new agent in Observe, read what Query checks records for a few days, then move it to Standard or Strict.
Caps
Each query is held to the client's caps, on top of the checker:
- Bytes billed. Vuon asks BigQuery for a dry run of the query first. If the query would scan more than the client's cap, it is refused before it runs, with the number of bytes and a suggestion to narrow it, for example with a partition or date filter. When a client sets no cap, a default of 100 GB (100,000,000,000 bytes) per query applies. The cap is also passed to BigQuery as
maximumBytesBilledon the job. - Job timeout. The client's job timeout and a call's own
jobTimeoutMsboth apply; the shorter one wins. - Daily scan budget. Every query is held against your workspace's daily warehouse scan budget, which is why every query needs a byte cap.
Admins can't set a client's caps from the client form yet. A client that carries its own caps runs under them, and the default byte cap applies to everything else.
Set up a client
- Sign in as a workspace admin. The client's keys act as its bot user, not as you, so any admin can create them (see API keys).
- In Settings → Databases, open the BigQuery database and find its Outside agents list.
- Click New client, give it a name, pick an enforcement mode, and choose which service account it runs as (the connection's, or its own JSON key). The client queries the database you opened. Click Create and add a key.
- Vuon shows the key and the MCP config once, so copy them before closing the dialog. To add another key later, open the client's page and click New key and MCP config.
- Paste the config into the agent's MCP settings, or store the key as a secret in the agent's environment; see Connect your data agent.
- Optionally, open Tools on the client's page to turn off tools the agent shouldn't have.
To set up an auto-created client instead, find it under Waiting for a connection in the same list and click Add to this connection, or merge it into an existing client.
The setup contains the server URLs, the key, an optional environment, and the BigQuery project the agent passes as projectId. Where your workspace has the Vuon server enabled and the client has any Vuon-server tool a key can reach turned on, it gives both servers with the same key: vuon-bigquery-<client slug> for /api/mcp/bigquery and vuon-<client slug> for /api/mcp. The environment header is sent only to the BigQuery server. If the Vuon server isn't enabled for your workspace, or every such Vuon-server tool is off, the setup (and the key dialog) has only the BigQuery server. Any server names work.
Claude Code
claude mcp add --transport http vuon-bigquery https://<workspace>.vuon.ai/api/mcp/bigquery \
--header 'Authorization: Bearer sk_live_YOUR_KEY' \
--header 'X-Vuon-Environment: production'
mcpServers JSON (Cursor, Claude Desktop, and others)
{
"mcpServers": {
"vuon-bigquery": {
"type": "http",
"url": "https://<workspace>.vuon.ai/api/mcp/bigquery",
"headers": {
"Authorization": "Bearer sk_live_YOUR_KEY",
"X-Vuon-Environment": "production"
}
}
}
}
To also give the agent dataset context, charts, transforms of its query results, and metrics, add the Vuon MCP server to the same config; see the recommended setup. Remove Google's own BigQuery MCP server from the config, since the tool names are the same.
Keys and OAuth apps
- API keys are created for a client by a workspace admin and authenticate as
Bearer sk_live_.... What a client key can reach and who it acts as is described once, under API keys on the Vuon server page. On this server it can use every tool the client has on. A revoked or expired key is refused, and so is a key created for an archived client, on both servers. A person's own key that Vuon auto-bound to a client keeps working on the Vuon server after that client is archived, but is refused here. - OAuth sign-in needs no key. The MCP client is sent to Vuon's sign-in when its first request gets a
401, and its OAuth application becomes the client. The person must be a workspace member whose role allows product reads, which grantsmcp:query.
Only these two credentials work on this server. Vuon's own in-app agents and signed-in browser sessions are refused, because the in-app agent queries through its own tools.
The project
Every tool takes a projectId, and Vuon answers for exactly one project: the BigQuery project of the client's connection. A call that names another project fails with a message that names the right one, so an agent can correct itself. The job runs as the connection's service account, or as the client's own if it has one, so the agent never needs Google credentials of its own.
Usage
Run a query
An agent calls execute_sql_readonly with a projectId and a query. Vuon then:
- Checks that the SQL is one read-only statement.
- Runs the SQL checker at the client's enforcement level and records the outcome on Query checks.
- Plans the query with a BigQuery dry run, confirms BigQuery classifies it as a
SELECT, and compares the bytes it would scan to the cap. - Runs it through Vuon's node execution and returns the first page of rows.
The result is in Google's field names (jobComplete, jobReference, schema, rows, totalRows, totalBytesProcessed, cacheHit) plus a vuon block with the check outcome (passed, would_block, or not_validated), any warnings, and where the result lives in Vuon:
flowId: the flow the query ran in. A flow holds one conversation's work: one per session id (see Attribution), or one per client when the agent sends none.nodeId: the query's node in that flow. The same SQL in the same flow reuses its node.nodeRunId: the run of that node that holds this result, stored as Parquet.outputTableName: the name the Vuon server'stransform_resultsreads this result under, written{outputTableName:<nodeId>}in its SQL.
get_query_results returns the same vuon fields for a finished job. A dry run returns only the flowId the query would run in.
To reshape results with DuckDB without querying BigQuery again, use the Vuon server's transform_results: its SQL reads a result as {outputTableName:<nodeId>}, and can join several.
"vuon": {
"check": { "outcome": "passed" },
"flowId": "fl_mcp_…",
"nodeId": "4f1c…",
"nodeRunId": "9b0e…",
"outputTableName": "node_4f1c…"
}
Result reuse
Vuon reuses a result already computed for the same SQL, up to 24 hours old, the same window BigQuery's own query cache uses. A reused result reports cacheHit: true and totalBytesProcessed: "0". A result older than 24 hours is run again. A client that runs as its own service account only reuses results computed for that client and key.
Dry runs
dryRun: true returns the schema and the bytes the query would scan without running it. The query is still checked and recorded.
Long queries and paging
The call waits for the query for timeoutMs (20 seconds by default, at most 60). If the query is still running, the response has jobComplete: false and a jobId. Pass that jobId to get_query_results, which waits up to 10 seconds by default, and use get_job for status or cancel_job to stop it.
Each response carries at most 3,000 rows. When there are more, totalRows says how many and a pageToken continues the listing; startIndex also works.
Job ids
A job id is the id of the Query checks event recorded for the call, so the same id links a job to its place in Query checks. Job tools only see the client's own jobs; another client's job id is reported as not found. cancel_job stops a job that is still running and leaves a finished one alone.
BigQuery jobs are labeled vuon_mcp, vuon_client, and vuon_event, so your warehouse's own job history shows where a query came from. Labels the agent passes are kept when they follow BigQuery's label rules.
Attribution: environment, session, and end user
Attribution describes a request. It never identifies the client, which the credential does, and it never grants or limits access.
- Environment. Send an
X-Vuon-Environmentheader (for exampleproduction) to keep a client's staging and production events apart. It is optional and set once in the MCP config. - Session. Send an
X-Vuon-Session-Idheader with one id per conversation. Vuon groups the conversation's queries on Query checks, and keeps its queries and transforms in one flow of their own. Send the same header to the Vuon server too, sotransform_resultsworks in the same flow. It takes no labels: without the header, it works in the flow of the nodes it reads, and with a different session it can't see this one's queries.labels: { "vuon_session": "<id>" }on a SQL call also sets it. The session id isn't verified: it only groups the client's own work, and never grants or limits access. - End user. Send an
X-Vuon-End-Userheader with who the query is for, for exampleslack:U0123ABC. Vuon records it as the event's end user. The value is trimmed and clipped to 200 characters, and a blank value is ignored. Your agent's code sets it, because a model can't know who is asking; see Identify who asked.labels: { "vuon_user": "<id>" }on a call records the same thing, and is used only when the header is absent or blank. The header is unverified; to have Query checks show the end user as verified, the agent also sends a signedX-Vuon-End-User-Token, see Verify the end user. - Which wins. For the environment and the session, a
vuon_envorvuon_sessionlabel on a call overrides the header. For the end user, the header overrides thevuon_userlabel, so a model can't change who the query was for.
The end user is attribution only. With or without it, a client key's queries run as the client's bot user, so every person behind an agent gets the client's access, and Vuon doesn't support per-person permissions yet.
Where queries show up
Every query an agent sends, including blocked ones, dry runs, and ones Observe let through, is recorded on Query checks (Settings → Query checks, workspace admins only) under its client. Filter by client, and by environment within a client, to see one agent's queries. Each record keeps the SQL, the checker's outcome, whether the query would have been blocked, and the environment, session, and end-user attribution the agent sent. The end user shows as end user, or a dash when the call named none. Ran as shows who the query ran as: the client's bot (<client name> (bot)) for a client key.
Transforms of a query's result with the Vuon server's transform_results are not recorded here: they run on the stored result and never reach BigQuery.
Vuon also remembers the name and version the MCP client reported when it connected (for example "Claude Code 2.1.4"), for display only. The client chooses what to report, so it never identifies the caller.
Limits
- Read-only. One
SELECT, optionally starting withWITH. Keywords that write, change the session, or run a procedure (INSERT,CREATE,DROP,SET,CALL, and similar) are refused, and so are multiple statements.execute_sqlis held to the same rule, so it cannot run DDL or DML even though Google's version can. - One project.
projectIdmust equal the connection's project. - One connection per client. To query another connection, use another client.
- Catalog metadata.
list_dataset_idsand the other metadata tools list what Vuon has synced and not hidden from agents, not everything in the BigQuery project. - Rows. 3,000 per response, with paging.
- Own service account and the catalog. Dataset and table listings come from the connection's catalog, so a client with its own service account may see tables its account can't query.
Troubleshooting
The server answers 403 "not enabled"
The BigQuery-compatible endpoint is off for your workspace. Contact Vuon to enable it.
"The BigQuery-compatible MCP endpoint is for outside agents"
The credential is a Vuon agent's or a signed-in browser's. Connect with an API key or an OAuth sign-in instead.
The client "…" has no BigQuery connection yet
It is an auto-created client, or its connection was archived or deleted. An admin gives it a connection in Settings → Databases, on the BigQuery database's Outside agents list.
Project "…" is not available on this server
The call's projectId doesn't match the client's connection. Use the project the error names.
"Vuon checked this query and did not run it"
The checker blocked the query at the client's enforcement level. The message lists the problems by line and column. Fix the SQL and retry. If the client should only observe, set it to Observe.
The query would scan more than the client may bill
The dry run found the query scans more bytes than the client's cap. Narrow the query, for example with a partition or date filter.
A tool is missing from the tools list, or is refused
An admin may have turned it off for the agent's client. Check the client's Tools section; see Tools. A tool that is off is hidden from tools/list and refused if called.
"Not found: Job …"
get_query_results, get_job, and cancel_job need a job id from an execute_sql_readonly call made by the same client.
Queries fail for a client with its own service account
Vuon doesn't test a client's own key when it is saved, so a malformed key or an account without the needed grants (BigQuery Job User and read access to the tables) fails when the agent first queries. Check the account's roles in Google Cloud, or paste a corrected key in the client's settings.
The API key or client was refused
The key was revoked or expired, or its client was archived. Ask a workspace admin for a key from an active client. (On the Vuon server, a person's own key that was auto-bound to an archived client still works.) Keys also stop working if the member they act as is deactivated.
FAQ
How is this different from Google's BigQuery MCP server?
The tool names and arguments are the same, so an agent's prompts carry over. The differences are that Vuon answers for one project, runs read-only queries only, checks every query before running it, holds it to the client's caps, runs it as the connection's service account (or the client's own) rather than the agent's own Google identity, and records it under the client.
Does the agent need Google credentials?
No. Vuon runs the query as the connection's service account, or as the client's own if you gave it one. The agent only needs its Vuon key or OAuth sign-in.
Can an agent write to BigQuery through this server?
No. Only read-only queries run.
Should I use Observe or Standard?
Start in Observe to see what the checker would block without disrupting the agent, then move to Standard or Strict once the recorded queries look right.