BQ Agent Gateway
Provides read-only access to Google BigQuery, enabling listing datasets and tables, describing table schemas, estimating query costs, and running SELECT queries with safety guardrails against expensive or destructive operations.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@BQ Agent GatewayWhat tables are in the analytics dataset?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
BQ Agent Gateway
A read-only MCP server that connects Claude to BigQuery with layered guardrails against dangerous and expensive SQL.
What it blocks
Static AST validation (parsed with sqlglot, not regex):
Anything that isn't a
SELECT(noINSERT/UPDATE/DELETE/MERGE/DDL)SELECT *andtable.*(butCOUNT(*)is fine)CROSS JOINand implicit cartesian products (comma joins with noON)Multiple statements in one call (blocks
SELECT 1; DROP TABLE ...)Queries referencing datasets outside an allowlist
Missing
LIMIT(auto-injected by default) and over-largeLIMITs
BigQuery cost gate:
A dry-run estimates bytes scanned before running; over-threshold queries are rejected
Execution sets
maximum_bytes_billedas a hard server-side cap, so even a mis-estimate can't overspend — BigQuery kills the job insteadRow count and wall-clock timeout are capped
Related MCP server: BigQuery MCP Server
Tools exposed
list_datasets, list_tables, describe_table, estimate_query_cost, run_query.
Setup
pip install -r requirements.txt # or: uv pip install -r requirements.txt
cp .env.example .env # then edit values
# Auth: either set GOOGLE_APPLICATION_CREDENTIALS to a service-account key,
# or run:
gcloud auth application-default loginGive the service account only what it needs:
roles/bigquery.dataViewer + roles/bigquery.jobUser. The dataViewer role
cannot mutate data, so the read-only guarantee is enforced at the IAM layer too,
not just in code.
Run
# stdio (for Claude Desktop)
python server.py
# or HTTP
fastmcp run server.py --transport http --port 8000Register with Claude Desktop
Edit claude_desktop_config.json
(macOS: ~/Library/Application Support/Claude/,
Windows: %APPDATA%\Claude\):
{
"mcpServers": {
"bq-agent-gateway": {
"command": "python",
"args": ["/absolute/path/to/bq-agent-gateway/server.py"],
"env": {
"BQ_PROJECT": "my-gcp-project",
"GOOGLE_APPLICATION_CREDENTIALS": "/absolute/path/to/key.json",
"BQ_ALLOWED_DATASETS": "analytics,prod_reporting",
"BQ_MAX_BYTES_SCANNED_GIB": "5"
}
}
}
}Restart Claude Desktop; the BigQuery tools appear in the tools menu.
Design notes / defense in depth
The guardrails are structured as independent layers so a bypass of one doesn't defeat the rest:
IAM — read-only service account can't write regardless of SQL.
AST validation — shape checks that regex can't do reliably.
Dry-run cost gate — the real budget protection for BigQuery.
maximum_bytes_billed— hard cap enforced by BigQuery itself.Row/time caps — bound the response size and latency.
Toggle any static rule via env vars (see .env.example) without touching code.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityDmaintenanceEnables natural language exploration and querying of Google BigQuery datasets through four tools: listing datasets, inspecting table schemas, generating SQL queries with LLM assistance, and executing approved queries.Last updated1MIT
- Alicense-qualityBmaintenanceEnables LLMs to explore BigQuery datasets and tables, run safe read-only queries, and optionally perform vector search using BigQuery embeddings.Last updated9MIT
- Alicense-qualityCmaintenanceEnables AI agents to interact with Google BigQuery databases through natural language queries and schema exploration.Last updated10MIT
- Alicense-qualityCmaintenanceEnables AI assistants to query and analyze Google BigQuery data, including schema browsing, running queries, and comparing datasets through natural language.Last updatedMIT
Related MCP Connectors
Bounded tools for rendering, extraction, RAG, enrichment, local discovery and review analysis.
Query PostgreSQL databases in plain English — LLM-generated, safety-validated SQL.
233 tools for Google, Microsoft, TikTok, LinkedIn Ads in Claude or ChatGPT. Writes need approval.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/durjoi/bq_agent_gateway'
If you have feedback or need assistance with the MCP directory API, please join our Discord server