Complete AI Training
Start for Free

Your job's AI kit

Get your AI kit

Tell us who you are and what you do. We show you your kit right away and email you the link: skills, prompts, AI agents, MCP servers and courses for your job.

500+ jobs ready, and we make a kit for any other job. No payment needed to look.

Share

MCP server · Analytics

Cost Guard MCP server

by mcpsmiths

Check how much a database query will cost and how many rows it returns before your AI runs it.

Cost Guard is a small helper that checks the price and size of a database query before it runs. It works with BigQuery, Snowflake, and Databricks, the big data warehouses companies use. It is handy if you or your AI ever ask a data question and worry about a surprise bill or a flood of rows.

What is an MCP server? The 30-second version

On its own, your AI can only chat. An MCP server is a small helper program that gives your AI a new skill or a connection to another service. This one connects your AI to your data warehouse, so it can look up the cost and size of a query before running it. You ask a question, your AI uses this helper to check the numbers, and only then does it decide whether to run the query.

What this MCP server does

You ask your AI a data question, like how many orders were placed last month. Your AI writes the database query and hands it to this helper. The helper asks the warehouse for an estimate of how many bytes the query will read and roughly what it will cost. It labels that estimate with an accuracy tier so your AI knows how much to trust it. If the estimate is over the limits you set, the helper refuses to run the query and tells your AI why.

What you can do with it

  • Check whether your database login works before running anything
  • Estimate how many bytes and dollars a query will use
  • See whether an estimate is exact, an upper bound, or just a rough guess
  • Set a maximum cost, byte, or row limit for each query
  • Stop a query before it runs if it would go over your limit
  • Cap how many rows come back so your AI does not get flooded
  • See clearly whether a query actually ran or was refused

Try asking your AI

  • “Before you run that, check how much it will cost.”
  • “Estimate the bytes for a query that counts all rows in the sales table.”
  • “Run this query but do not spend more than 5 dollars.”
  • “Run this query and give me at most 500 rows.”

What it gives back to you

You get back a short answer in the chat: the estimated bytes, an estimated dollar figure when the warehouse supports it, and a label saying how accurate that estimate is. If the query runs, you get the rows themselves, capped at the row limit you set. Every result also says whether the query actually ran or was refused, so you always know what happened.

Before you start

What you need

  • A BigQuery, Snowflake, or Databricks account with access to a data warehouse
  • Login details for that warehouse, like a key file or a token (the setup steps explain how to get these)
  • The uvx tool installed, or Docker if you prefer that route
  • Your MCP client config file, since it does not pick up your normal computer settings automatically

Good to know

It can run queries that cost real money on your warehouse, so set sensible limits and use a read-only login where you can.

Install it with your AI

Add Cost Guard MCP server to your AI, no technical skills needed

You don't install anything by hand. You copy one prompt, paste it into an AI that can work on your computer, and it checks, installs and connects the server for you, asking you when it needs something.

Sign in to get the install prompt

Members get a ready-made prompt that lets the Claude desktop app check Cost Guard MCP server, install it and connect it for them, step by step. You don't need any technical skills: you copy, paste and answer a few questions. Your connected AI can also find and install any of the 5,046 MCP servers here for you.

Sign in Start for Free

Who it's for

Anyone who asks an AI to query a company data warehouse and wants to avoid surprise bills or huge result sets, especially analysts and data teams.

Jobs it suits