Why I Built cost-guard-mcp: Pre-Flight Cost Guardrails for AI Agents Talking to Data Warehouses
Description and use
cost-guard-mcp enables agents to safely interact with BigQuery and Snowflake by providing accurate cost estimates, enforcing execution limits, and refusing unsafe queries, thereby preventing unexpected charges and data overload.
Problem
AI agents can run expensive or data‑heavy queries on data warehouses without prior cost or size estimation, leading to unexpected bills and context overflow.
Outcome
cost-guard-mcp enables agents to safely interact with BigQuery and Snowflake by providing accurate cost estimates, enforcing execution limits, and refusing unsafe queries, thereby preventing unexpected charges and data overload.
Workflow
- 1. Agent calls describe_engine_capabilities(engine) to learn engine limits. 2. Agent calls estimate_query_cost(engine, sql, warehouse) to receive a CostEstimate with accuracy_tier. 3. Agent reviews estimate and decides to proceed. 4. Agent calls run_query_bounded(engine, sql, max_bytes_billed, max_rows, max_estimated_cost_usd). 5. cost-guard-mcp enforces caps, returns BoundedQueryResult or refuses if limits exceeded.
- Record date: 2026-09-18T23:15:26.882Z