Open source MCP server that gives your AI safe, cost-aware access to BigQuery — including schema exploration, query execution, and spend analysis.
View on GitHubFull table scans. Missing partitions. Bad joins. Silent killers of your BigQuery bill.
Detect full table scans, missing partition filters, inefficient joins, and other costly anti-patterns instantly.
Reduce cost using partition pruning, clustering strategies, predicate pushdown, and query simplification.
Automatically generate production-ready SQL that is faster, cheaper, and easier to maintain.
From query patterns to schema design to security — BqForge knows it all.
A two-step workflow. Ask a question, get focused best-practice content — within your token budget.
Type a question like "how do I reduce query cost?" — no special syntax needed. Works inside Claude, Cursor, or any MCP-compatible client.
BqForge scores all 80+ practices against your question and returns a ranked list of the most relevant practice IDs with severity and impact tags.
Fetches the full content of matched practices, packed into your token budget. Do's, don'ts, and ready-to-run SQL examples — cited by practice ID.
Best-practice tools plus live GCP tools — use them individually or let your AI chain them automatically.
resolve_topic
Resolve a natural-language question to ranked practice IDs with relevance scores. Always the first step.
get_practices
Fetch focused practice content within a token budget. Assembles the best-matching practices in relevance order.
review_query
Paste any SQL and get instant warnings — SELECT *, missing partition filters, CROSS JOINs, non-deterministic functions, and more.
review_query_with_schema
Schema-aware SQL review — fetches actual partition and clustering columns from BigQuery to verify WHERE clauses filter on the real partition column.
get_best_practices
Retrieve every practice in a full category at once — query_optimization, schema_design, cost_management, security, and more.
search_practices
Full-text keyword search across all practice titles, descriptions, and examples.
get_practice_detail
Get the full detail for a single practice by ID — e.g. QO-002 for partition filter guidance.
list_all_practice_ids
Compact list of every practice ID and title across all 12 categories — useful for browsing what BqForge knows.
dry_run_query
Estimate bytes billed and cost for any SQL before executing — without running the query.
execute_query
Run a BigQuery SQL query and return results directly inside your AI session, with a configurable bytes-billed cap.
explore_schema
Inspect table schema, partition info, clustering fields, and row count for any BigQuery table.
query_history
Surface the most expensive queries run in your project over the past N days, ranked by bytes billed.
get_cost_attribution
Break down BigQuery spend by user, label, or dataset over a configurable time window.
nl_to_sql
Describe what you want in plain English and generate a best-practice BigQuery SQL query, scoped to real table schemas.
detect_performance_regression
Compare recent query performance against a baseline period to catch regressions before they become expensive.
map_table_lineage
Trace upstream and downstream dependencies for any table using BigQuery job history.
Works with Claude Desktop and any MCP-compatible client.
git clone https://github.com/sreekanth-kc/BqForge cd BqForge python3 -m venv .venv && source .venv/bin/activate pip install -r requirements.txt
// ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"bqforge": {
"command": "/path/to/.venv/bin/python",
"args": ["/path/to/BqForge/server.py"]
}
}
}
# Type this in Claude to activate automatic BqForge lookups
use bqforge