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.
What it does
Paste a BigQuery SQL query and the agent:
Static analysis — instantly flags
SELECT *, missing partition filters, cartesian joinsSchema fetch — reads partition keys, clustering fields, and row counts from BigQuery
Cost estimate — dry-runs the query to get bytes scanned without executing it
Rewrite — returns improved SQL with a plain-English explanation
Severity rating —
none/low/medium/high/critical
Related MCP server: bigquery-mcp
Architecture
The agent is modelled as a LangGraph state machine:
call_llm — sends messages + tools to Claude/Gemini
run_tools — dispatches
get_table_schema,dry_run_sql,write_reportroute — conditional edge: loop back if tool calls remain, stop when
write_reportis called
Three trigger modes
Mode | How |
CLI |
|
Web UI |
|
MCP | Any MCP-compatible client (Claude Code, Cursor, Zed, OpenClaw) |
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 tier: aistudio.google.com
# or: export ANTHROPIC_API_KEY=your-key
gcloud auth application-default loginMCP (Claude Code)
claude mcp add -s user sql-review -- \
/path/to/venv/bin/python /path/to/mcp_server.pyTools available in any MCP client:
review_sql— full agentic review (LLM + BQ)quick_check— instant static analysis, no LLM needed
CLI usage
python agent.py --sql "SELECT * FROM \`project.dataset.table\`"
python agent.py --file query.sql --verboseWeb UI

python server.py
# open http://localhost:5001Tests
pytest
pytest tests/test_tools.py -vProject structure
sql-review-agent/
├── agent.py ← raw tool-use loop (Claude + Gemini)
├── graph_agent.py ← LangGraph state machine (drop-in replacement)
├── mcp_server.py ← FastMCP server (review_sql + quick_check tools)
├── server.py ← Flask web UI + JSON API
├── tools/
│ ├── bq_tools.py ← dry_run, schema, metadata, read-only guard
│ └── sql_tools.py ← static analysis, table extraction
├── tests/
│ ├── test_tools.py ← 24 unit tests
│ └── test_agent.py ← 7 unit tests
└── docs/
├── architecture_graph.svg ← state machine diagram
└── web_ui.png ← Flask UI screenshotStack
Python · BigQuery · Claude API · Gemini API · LangGraph · FastMCP · Flask · pytest
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 Connectors
Paid remote MCP for governed database query review, SQL simulation, approvals, and audits.
DBRE-grade SQL analysis inside any MCP client. No connection. No install. Paste a query.
The BigQuery remote MCP server is a fully managed service that uses the Model Context Protocol to connect AI applications and LLMs to BigQuery data sources. It provides secure, standardized tools for AI agents to list datasets and tables, retrieve schemas, generate and execute SQL queries through natural language, and analyze data—enabling direct access to enterprise analytics data without requiring manual SQL coding.
Query your org's data in natural language — read-only MCP access to SQL, NoSQL, files & warehouses.
Related MCP Servers
- AlicenseBqualityAmaintenanceEnables validation and dry-run analysis of BigQuery SQL queries without execution. Provides cost estimates, schema previews, and syntax validation for BigQuery queries.91MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to query and analyze Google BigQuery data, including schema browsing, running queries, and comparing datasets through natural language.MIT
- AlicenseNot gradedqualityDmaintenanceMCP server for secure BigQuery access across multiple Google Cloud projects, enabling querying, schema exploration, and data analysis with SQL validation and read-only controls.2MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI assistants to query BigQuery read-only via MCP with enforced dataset boundaries, result limits, and audit labels.MIT
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/ARAVINDHRAJA123/sql-review-agent'
If you have feedback or need assistance with the MCP directory API, please join our Discord server