mcp-server

v2.0.0
@biqblue/mcp-server Checked 2 days ago Published 1 month ago

BIQ BLUE MCP Server - BigQuery cost optimization for coding agents: savings opportunities, playbooks, code tracing and impact verification

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

biqblue_init

Connect to BIQ BLUE (device-flow sign-in on first use, credentials saved in ~/.biq/mcp-config.json) and check connectivity. Call it first, or again when another tool reports an authentication error. SCOPE: This MCP server covers Google BigQuery exclusively (queries, costs, slots, reservations, BI Engine, BigQuery Storage, table/dataset schemas). It does NOT cover other GCP services such as Cloud Run, Cloud Storage, GKE, Pub/Sub, etc.

ParameterTypeDescription
app_urlstringYour instance to connect to (e.g. https://customer.biq.blue). Leave empty to use your default instance.

biqblue_overview

START HERE. High-level brief of the BigQuery bill: compute spend over the last 30 days vs the 30 days before (by pricing model: on-demand, slot reservations, BI Engine), storage cost, top projects and users, and the realistic monthly savings with the top opportunities (overlapping optimizations counted once). Then use biqblue_opportunities / biqblue_plan to act.

biqblue_opportunities

Ranked list of BigQuery savings opportunities (same rules as the BIQ BLUE savings page) with their targets: projects / users to move to autoscaling or on-demand, reservations to switch to fluid scaling, recurring queries to fix (with query_hash), datasets to switch billing model, unused tables, BI Engine candidates. Each opportunity has a change_type — "code" (SQL in the applications → pull request), "infra" (BigQuery reservations / datasets / tables → IaC PR or console commands), "config" (BIQ BLUE alerting). Opportunities in the same group or overlapping are alternatives: counted_in_to…

ParameterTypeDescription
categorystring
change_typestringOnly opportunities fixed this way (e.g. "code" for what can be fixed by a PR in the application repositories)
min_savingsnumberMinimum monthly savings

biqblue_plan

Step-by-step playbook to apply one savings opportunity, written for a coding agent: evidence and estimated savings, how to locate the code, exact SQL / DDL / bq commands, validation (dry run) and safety checks, what goes in a pull request vs what needs the user's approval. Use the id and target from biqblue_opportunities (target is required for per-target opportunities: project / user id, reservation name, query_hash, BI Engine project).

ParameterTypeDescription
id *stringOpportunity id, e.g. "recurring-queries", "easy-autoscaling", "storage-billing"
targetstringTarget of the opportunity (see targets[].target in biqblue_opportunities)

biqblue_query_sources

Fingerprint of a recurring query (by query_hash, from biqblue_opportunities / biqblue_jobs) to find which code sends it: likely origin (application, dbt, scheduled job, Looker Studio, Sheets, human), service accounts, projects, job labels (repository, dbt, topic…), run frequency and hours, sample job ids, and distinctive SQL fragments to grep in the repositories.

ParameterTypeDescription
query_hash *stringSHA-256 hex of the SQL text
whenstringTime range (default: last30)

biqblue_jobs

Search BigQuery jobs enriched by BIQ BLUE (cost, pricing model, detected improvements such as missing partition / cluster filters, tables used, query_hash). Filter by project, user, table, improvement or SQL text — e.g. find the jobs reading a table used in the code you are changing. Max 100 jobs.

ParameterTypeDescription
cost_minnumber
improvementstringComma-separated: partitioning, clustering, bi-engine, flex, on-demand
limitnumberDefault 20, max 100
projectstring
query_likestringCase-insensitive text contained in the SQL
servicestringPricing model (flex = slot reservation)
sortstringe.g. cost:desc (default), start_time:desc, duration_ms:desc
table_referencestringproject.dataset.table read by the job
userstringuser_email / service account
whenstringTime range (default: last30)

biqblue_verify

Measure the real impact of an optimization once deployed: daily cost, jobs, bytes and slot-hours before vs after a date, for a project, a user (service account), a reservation or a single recurring query (query_hash). Use it a few days after the change to report the achieved savings (e.g. as a PR comment).

ParameterTypeDescription
since *stringDate of the change (YYYY-MM-DD)
daysnumberDays compared on each side (default 14, max 90)
projectstring
query_hashstringSHA-256 hex of the SQL text
reservationstringreservation_id
userstringuser_email / service account