Pre-flight query cost & result-size guardrails for AI agents across BigQuery and Snowflake
- ✓Open-source license (MIT)
- ✓Actively maintained (<30d)
- ✓Clear description
- ✓Documented (README)
claude mcp add cost-guard-mcp -- uvx cost-guard-mcp{
"mcpServers": {
"cost-guard-mcp": {
"command": "uvx",
"args": ["cost-guard-mcp"]
}
}
}Resumen de MCP Servers
# cost-guard-mcp
<!-- mcp-name: io.github.mcpsmiths/cost-guard-mcp -->
Pre-flight query cost & result-size guardrails for AI agents, across BigQuery and Snowflake — before the query ever runs.
## Why
An AI agent using a warehouse MCP can silently trigger a full-table scan that costs hundreds of dollars, or return millions of rows that flood its own context window. No existing warehouse MCP tells the agent "how much will this cost" or "how much data will this return" *before* running the query.
## What makes this different
- **Every cost estimate discloses its accuracy tier** — `PRECISE` (BigQuery `dryRun`), `UPPER_BOUND` (Snowflake `EXPLAIN`), or `HEURISTIC` (Databricks, not yet shipped) — so your agent never over-trusts a heuristic number.
- **Per-call bounds** — `run_query_bounded` takes `max_bytes_billed` / `max_rows` / `max_estimated_cost_usd` on each call; no shared session state required.
- **Zero infrastructure** — a single local stdio process. No database, no gateway, no Docker Compose.
## Tools
- `describe_engine_capabilities(engine)` — what's exact vs. approximate for this engine.
- `estimate_query_cost(engine, sql, warehouse?)` — pre-flight cost estimate, tagged with its accuracy tier.
- `run_query_bounded(engine, sql, max_bytes_billed?, max_rows?, max_estimated_cost_usd?)` — refuses to run if the estimate exceeds your bound.
## Setup
### BigQuery
Set `GOOGLE_APPLICATION_CREDENTIALS` to a service-account key file path (or run `gcloud auth application-default login`).
### Snowflake
Set `SNOWFLAKE_ACCOUNT`, `SNOWFLAKE_USER`, `SNOWFLAKE_ROLE` (required — no default, never `ACCOUNTADMIN`), and either `SNOWFLAKE_PRIVATE_KEY_PATH` (preferred) or `SNOWFLAKE_PASSWORD` (discouraged).
### A note on credentials with MCP hosts
Whatever MCP client/host you use (Claude Desktop, etc.) spawns this server as its own subprocess — it does **not** automatically inherit your shell's environment variables, even if they're set in your `.zshrc`/`.bashrc`. Put them directly in the host's server config instead. For Claude Desktop's `claude_desktop_config.json`:
```json
{
"mcpServers": {
"cost-guard-mcp": {
"command": "uv",
"args": ["run", "--directory", "/path/to/cost-guard-mcp", "cost-guard-mcp"],
"env": {
"GOOGLE_APPLICATION_CREDENTIALS": "/path/to/service-account.json",
"BIGQUERY_PROJECT": "your-project-id",
"SNOWFLAKE_ACCOUNT": "your-account",
"SNOWFLAKE_USER": "your-user",
"SNOWFLAKE_ROLE": "your-role",
"SNOWFLAKE_PRIVATE_KEY_PATH": "/path/to/rsa_key.p8"
}
}
}
}
```
## Install
Not yet published to PyPI — for now, clone and run directly:
```bash
git clone https://github.com/mcpsmiths/cost-guard-mcp.git
cd cost-guard-mcp
uv sync
uv run cost-guard-mcp
```
Once published, `uvx cost-guard-mcp` will work as a one-line install.
## Known limitations
- Databricks is not yet supported (deferred past v1).
- Snowflake's `UPPER_BOUND` estimate excludes Cortex AI Function ("AI Credits") cost.
- BigQuery Editions/capacity-billed projects cannot get a dollar estimate — only a byte count (capacity billing has no fixed $/byte rate).
## License
MIT
Lo que la gente pregunta sobre cost-guard-mcp
¿Qué es mcpsmiths/cost-guard-mcp?
+
mcpsmiths/cost-guard-mcp es mcp servers para el ecosistema de Claude AI. Pre-flight query cost & result-size guardrails for AI agents across BigQuery and Snowflake Tiene 0 estrellas en GitHub y su última actualización registrada es del 2026-09-12.
¿Cómo se instala cost-guard-mcp?
+
Puedes instalar cost-guard-mcp clonando el repositorio (https://github.com/mcpsmiths/cost-guard-mcp) o siguiendo las instrucciones del README en GitHub. ClaudeWave también te ofrece bloques de instalación rápida en esta misma página.
¿Es seguro usar mcpsmiths/cost-guard-mcp?
+
Nuestro agente de seguridad ha analizado mcpsmiths/cost-guard-mcp y le ha asignado un Trust Score de 87/100 (tier: Trusted). Revisa el desglose completo de comprobaciones superadas y flags en esta página.
¿Quién mantiene mcpsmiths/cost-guard-mcp?
+
mcpsmiths/cost-guard-mcp es mantenido por mcpsmiths. La última actividad registrada en GitHub es del 2026-09-12, con 0 issues abiertos.
¿Hay alternativas a cost-guard-mcp?
+
Sí. En ClaudeWave puedes explorar mcp servers similares en /categories/mcp, ordenados por popularidad o actividad reciente.
Despliega cost-guard-mcp en tu cloud
Lleva este repo a producción en minutos. Cada plataforma genera su propio entorno con variables de entorno editables.
¿Mantienes este repo? Añade un badge a tu README
Pega el badge en tu README de GitHub para mostrar que está auditado por ClaudeWave. Cada badge enlaza de vuelta a esta página y muestra el Trust Score actual.
[](https://claudewave.com/repo/mcpsmiths-cost-guard-mcp)<a href="https://claudewave.com/repo/mcpsmiths-cost-guard-mcp"><img src="https://claudewave.com/api/badge/mcpsmiths-cost-guard-mcp" alt="Featured on ClaudeWave: mcpsmiths/cost-guard-mcp" width="320" height="64" /></a>Más MCP Servers
Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.
User-friendly AI Interface (Supports Ollama, OpenAI API, ...)
An open-source AI agent that brings the power of Gemini directly into your terminal.
Real-time global intelligence dashboard. AI-powered news aggregation, geopolitical monitoring, and infrastructure tracking in a unified situational awareness interface
🕷️ An adaptive Web Scraping framework that handles everything from a single request to a full-scale crawl!
The fastest path to AI-powered full stack observability, even for lean teams.