BqForge

Open source MCP server that gives your AI safe, cost-aware access to BigQuery — including schema exploration, query execution, and spend analysis.

View on GitHub

Stop burning money on bad queries.

Full table scans. Missing partitions. Bad joins. Silent killers of your BigQuery bill.

80+
Practices
12
Categories
30+
MCP Tools
0
Config needed
01

Analyze

Detect full table scans, missing partition filters, inefficient joins, and other costly anti-patterns instantly.

02

Optimize

Reduce cost using partition pruning, clustering strategies, predicate pushdown, and query simplification.

03

Rewrite

Automatically generate production-ready SQL that is faster, cheaper, and easier to maintain.

12 categories. Every angle covered.

From query patterns to schema design to security — BqForge knows it all.

QO-xxx
Query Optimization
SD-xxx
Schema Design
CO-xxx
Cost Management
SE-xxx
Security & Access
MV-xxx
Materialized Views
MO-xxx
Monitoring
DI-xxx
Data Ingestion
WM-xxx
Workload Management
PT-xxx
Partitioning
SP-xxx
Storage Pricing
AV-xxx
Authorized Views
SQ-xxx
Scheduled Queries

How it works

A two-step workflow. Ask a question, get focused best-practice content — within your token budget.

01

Ask in plain English

Type a question like "how do I reduce query cost?" — no special syntax needed. Works inside Claude, Cursor, or any MCP-compatible client.

02

resolve_topic

BqForge scores all 80+ practices against your question and returns a ranked list of the most relevant practice IDs with severity and impact tags.

03

get_practices

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.

30+ tools. Every workflow covered.

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.

Live GCP Tools (optional credentials)
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.

Get started in 3 steps.

Works with Claude Desktop and any MCP-compatible client.

Step 1 — Install
git clone https://github.com/sreekanth-kc/BqForge
cd BqForge
python3 -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
Step 2 — Add to Claude Desktop
// ~/Library/Application Support/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "bqforge": {
      "command": "/path/to/.venv/bin/python",
      "args": ["/path/to/BqForge/server.py"]
    }
  }
}
Step 3 — Activate
# Type this in Claude to activate automatic BqForge lookups
use bqforge