sql-review-agent
Provides integration with Google BigQuery for dry-running SQL queries, estimating costs, and retrieving schema information to review and suggest improvements for BigQuery SQL queries.
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., "@sql-review-agentReview query: SELECT * FROM orders"
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.
SQL Review Agent
An agentic AI system that reviews BigQuery SQL queries before you run them — catching performance issues, estimating cost, and suggesting rewrites.
Work in progress. Building incrementally — check back for updates.
What it does
Paste a BigQuery SQL query and the agent:
Dry-runs it — gets the estimated bytes scanned (= cost) without executing
Reads your schema — understands partition keys, clustering, column types
Flags issues — full table scans, missing partition filters, cartesian joins,
SELECT *Suggests a rewrite — returns improved SQL with explanation
Reports severity — low / medium / high / critical
Input SQL
│
▼
dry_run() get_schema()
→ bytes scanned → partition keys, types, row count
│
▼
Issue detection + rewrite suggestion
│
▼
ReviewReport (cost · issues · rewritten SQL · severity)Related MCP server: BigQuery FinOps MCP Server
Three trigger modes
CLI —
python agent.py --sql "SELECT * FROM ..."Web UI — paste SQL in browser, see review results
MCP — any MCP-compatible client (Claude Code, OpenClaw, Cursor, Zed)
Stack
Claude / Gemini — LLM provider (auto-detected, free Gemini supported)
BigQuery —
dry_runfor cost estimation, schema introspectionFlask — web UI
FastMCP — MCP server
pytest — test suite
Setup
git clone https://github.com/ARAVINDHRAJA123/sql-review-agent.git
cd sql-review-agent
python3 -m venv venv && source venv/bin/activate
pip install -r requirements.txt
export GCP_PROJECT=your-project
export BQ_LOCATION=asia-south1
export GEMINI_API_KEY=your-key # free: aistudio.google.com
# or: export ANTHROPIC_API_KEY=your-key
gcloud auth application-default loginProject structure
sql-review-agent/
├── agent.py ← agentic review loop (coming Day 3)
├── server.py ← Flask web UI (coming Day 4)
├── mcp_server.py ← FastMCP server (coming Day 5)
├── tools/
│ ├── bq_tools.py ← dry_run, schema, metadata (coming Day 2)
│ └── sql_tools.py ← SQL parsing helpers (coming Day 2)
├── tests/
├── docs/
└── requirements.txtThis 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.
Latest Blog Posts
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/ARAVINDHRAJA123/sql-review-agent'
If you have feedback or need assistance with the MCP directory API, please join our Discord server