Supabase
MCP server for interacting with the Supabase platform
作者提供的说明(英文原文)
Pre-flight query cost and result-size guardrails for AI agents on BigQuery, Snowflake, Databricks
这三项永远不会合并成一个分数:意见、测量和人气是不同的东西。
我们还没有为它写通俗的介绍。下面是我们从注册中心读取到的事实。
选择你使用的 AI 应用,然后复制设置。
GOOGLE_APPLICATION_CREDENTIALS, SNOWFLAKE_ACCOUNT, SNOWFLAKE_USER, SNOWFLAKE_ROLE, SNOWFLAKE_SECONDARY_ROLES, SNOWFLAKE_PRIVATE_KEY_PATH, SNOWFLAKE_PRIVATE_KEY_PASSPHRASE, SNOWFLAKE_PASSWORD, SNOWFLAKE_EDITION, DATABRICKS_SERVER_HOSTNAME, DATABRICKS_HTTP_PATH, DATABRICKS_TOKEN, DATABRICKS_CLIENT_ID, DATABRICKS_CLIENT_SECRET, COST_GUARD_ALLOW_MULTI_STATEMENT_SQL, COST_GUARD_ALLOW_WRITE_STATEMENTS, COST_GUARD_MAX_IN_FLIGHT_QUERIES, COST_GUARD_DATABRICKS_ALLOW_WAREHOUSE_START, COST_GUARD_SNOWFLAKE_ALLOW_WAREHOUSE_RESUME标为机密的值是你账户的钥匙。千万不要分享给别人,也不要粘贴到聊天里。
你需要
你用的是哪个应用?
在上方选择你的应用。我们会记住它,下次按钮会显示“安装到 …”。
打开 Claude Desktop → Settings → Developer → Edit Config,把下面的内容粘贴到 claude_desktop_config.json
{
"mcpServers": {
"cost-guard": {
"command": "uvx",
"args": [
"cost-guard-mcp"
],
"env": {
"GOOGLE_APPLICATION_CREDENTIALS": "your-value",
"SNOWFLAKE_ACCOUNT": "your-value",
"SNOWFLAKE_USER": "your-value",
"SNOWFLAKE_ROLE": "your-value",
"SNOWFLAKE_SECONDARY_ROLES": "your-value",
"SNOWFLAKE_PRIVATE_KEY_PATH": "your-value",
"SNOWFLAKE_PRIVATE_KEY_PASSPHRASE": "your-value",
"SNOWFLAKE_PASSWORD": "your-value",
"SNOWFLAKE_EDITION": "your-value",
"DATABRICKS_SERVER_HOSTNAME": "your-value",
"DATABRICKS_HTTP_PATH": "your-value",
"DATABRICKS_TOKEN": "your-value",
"DATABRICKS_CLIENT_ID": "your-value",
"DATABRICKS_CLIENT_SECRET": "your-value",
"COST_GUARD_ALLOW_MULTI_STATEMENT_SQL": "your-value",
"COST_GUARD_ALLOW_WRITE_STATEMENTS": "your-value",
"COST_GUARD_MAX_IN_FLIGHT_QUERIES": "your-value",
"COST_GUARD_DATABRICKS_ALLOW_WAREHOUSE_START": "your-value",
"COST_GUARD_SNOWFLAKE_ALLOW_WAREHOUSE_RESUME": "your-value"
}
}
}
}在终端中运行这条命令
claude mcp add cost-guard --env GOOGLE_APPLICATION_CREDENTIALS=your-value --env SNOWFLAKE_ACCOUNT=your-value --env SNOWFLAKE_USER=your-value --env SNOWFLAKE_ROLE=your-value --env SNOWFLAKE_SECONDARY_ROLES=your-value --env SNOWFLAKE_PRIVATE_KEY_PATH=your-value --env SNOWFLAKE_PRIVATE_KEY_PASSPHRASE=your-value --env SNOWFLAKE_PASSWORD=your-value --env SNOWFLAKE_EDITION=your-value --env DATABRICKS_SERVER_HOSTNAME=your-value --env DATABRICKS_HTTP_PATH=your-value --env DATABRICKS_TOKEN=your-value --env DATABRICKS_CLIENT_ID=your-value --env DATABRICKS_CLIENT_SECRET=your-value --env COST_GUARD_ALLOW_MULTI_STATEMENT_SQL=your-value --env COST_GUARD_ALLOW_WRITE_STATEMENTS=your-value --env COST_GUARD_MAX_IN_FLIGHT_QUERIES=your-value --env COST_GUARD_DATABRICKS_ALLOW_WAREHOUSE_START=your-value --env COST_GUARD_SNOWFLAKE_ALLOW_WAREHOUSE_RESUME=your-value -- uvx cost-guard-mcp运行前请先填写空着的值。
粘贴到项目中的 .cursor/mcp.json,或 ~/.cursor/mcp.json
{
"mcpServers": {
"cost-guard": {
"command": "uvx",
"args": [
"cost-guard-mcp"
],
"env": {
"GOOGLE_APPLICATION_CREDENTIALS": "your-value",
"SNOWFLAKE_ACCOUNT": "your-value",
"SNOWFLAKE_USER": "your-value",
"SNOWFLAKE_ROLE": "your-value",
"SNOWFLAKE_SECONDARY_ROLES": "your-value",
"SNOWFLAKE_PRIVATE_KEY_PATH": "your-value",
"SNOWFLAKE_PRIVATE_KEY_PASSPHRASE": "your-value",
"SNOWFLAKE_PASSWORD": "your-value",
"SNOWFLAKE_EDITION": "your-value",
"DATABRICKS_SERVER_HOSTNAME": "your-value",
"DATABRICKS_HTTP_PATH": "your-value",
"DATABRICKS_TOKEN": "your-value",
"DATABRICKS_CLIENT_ID": "your-value",
"DATABRICKS_CLIENT_SECRET": "your-value",
"COST_GUARD_ALLOW_MULTI_STATEMENT_SQL": "your-value",
"COST_GUARD_ALLOW_WRITE_STATEMENTS": "your-value",
"COST_GUARD_MAX_IN_FLIGHT_QUERIES": "your-value",
"COST_GUARD_DATABRICKS_ALLOW_WAREHOUSE_START": "your-value",
"COST_GUARD_SNOWFLAKE_ALLOW_WAREHOUSE_RESUME": "your-value"
}
}
}
}浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。
粘贴到项目中的 .vscode/mcp.json
{
"servers": {
"cost-guard": {
"type": "stdio",
"command": "uvx",
"args": [
"cost-guard-mcp"
],
"env": {
"GOOGLE_APPLICATION_CREDENTIALS": "your-value",
"SNOWFLAKE_ACCOUNT": "your-value",
"SNOWFLAKE_USER": "your-value",
"SNOWFLAKE_ROLE": "your-value",
"SNOWFLAKE_SECONDARY_ROLES": "your-value",
"SNOWFLAKE_PRIVATE_KEY_PATH": "your-value",
"SNOWFLAKE_PRIVATE_KEY_PASSPHRASE": "your-value",
"SNOWFLAKE_PASSWORD": "your-value",
"SNOWFLAKE_EDITION": "your-value",
"DATABRICKS_SERVER_HOSTNAME": "your-value",
"DATABRICKS_HTTP_PATH": "your-value",
"DATABRICKS_TOKEN": "your-value",
"DATABRICKS_CLIENT_ID": "your-value",
"DATABRICKS_CLIENT_SECRET": "your-value",
"COST_GUARD_ALLOW_MULTI_STATEMENT_SQL": "your-value",
"COST_GUARD_ALLOW_WRITE_STATEMENTS": "your-value",
"COST_GUARD_MAX_IN_FLIGHT_QUERIES": "your-value",
"COST_GUARD_DATABRICKS_ALLOW_WAREHOUSE_START": "your-value",
"COST_GUARD_SNOWFLAKE_ALLOW_WAREHOUSE_RESUME": "your-value"
}
}
}
}浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。
这个服务器在你的电脑上运行,而 ChatGPT 只能连接互联网上的服务器。请选择其他应用。
你的选择通过 Cookie 保存在这台设备上,无需账户。
SNOWFLAKE_ACCOUNT envSNOWFLAKE_USER envSNOWFLAKE_ROLE envSNOWFLAKE_SECONDARY_ROLES envSNOWFLAKE_EDITION envDATABRICKS_SERVER_HOSTNAME envDATABRICKS_HTTP_PATH envDATABRICKS_CLIENT_ID envCOST_GUARD_ALLOW_MULTI_STATEMENT_SQL envCOST_GUARD_ALLOW_WRITE_STATEMENTS envCOST_GUARD_MAX_IN_FLIGHT_QUERIES envCOST_GUARD_DATABRICKS_ALLOW_WAREHOUSE_START envCOST_GUARD_SNOWFLAKE_ALLOW_WAREHOUSE_RESUME env这些设置是根据作者在注册中心的条目生成的。如果 README 的写法不同,请以 README 为准。
它在你的电脑上运行;安装后,工具列表会显示在你的 AI 应用中。
我们检查的是任何人都能看到的信息;我们没有阅读代码。不适用的检查项不计入总数。 · 检查于 2026年11月8日
注册名称已通过 GitHub 账户 mcpsmiths 验证,该账户拥有此仓库
我们还没有从 GitHub 读取这个仓库
我们还没有从 GitHub 读取这个仓库
它在你的电脑上运行,没有互联网端点
在你的电脑上运行,改用本地设置
它在你的电脑上运行;我们只能读取互联网端点的工具列表
与注册中心里这个分类中所有活跃的服务器比较。只有当发布者拥有该仓库时,星标数才计入。
它在 1 项适用的基础检查中通过了 1 项。我们没有阅读代码。在添加密钥或令牌之前,请先看看这个服务器要求哪些权限,并使用只具备所需权限的密钥。
你需要填写:GOOGLE_APPLICATION_CREDENTIALS, SNOWFLAKE_PRIVATE_KEY_PATH, SNOWFLAKE_PRIVATE_KEY_PASSPHRASE, SNOWFLAKE_PASSWORD, DATABRICKS_TOKEN, DATABRICKS_CLIENT_SECRET
它在你的电脑上运行。你的 AI 应用会在需要时启动它,数据不会经过作者的服务器(除非它自己调用在线服务)。
GitHub 仓库最后更新于–,最新版本(0.6.0)于19天前进入注册中心。
支持 MCP 的应用,例如 Claude Desktop、Claude Code、Cursor 和 VS Code。你的电脑上还需要有 Python (uv)。
同一分类中有:Supabase, MongoDB MCP Server, Elasticsearch MCP Server
同一分类中其他作者的服务器,按星标数排序。
如何看卡片:★ GitHub 星标i三大支柱:评价 · 检查 · 使用情况i更新 = 最新版本发布到注册中心的时间i
MCP server for interacting with the Supabase platform
MongoDB Model Context Protocol Server
MCP server for interacting with Elasticsearch
按原文从作者的仓库复制。PopNx MCP 没有审查或背书其内容。HTML、图片和脚本已被移除。链接会离开本站。
Pre-flight query cost & result-size guardrails for AI agents, across BigQuery, Snowflake, and Databricks — before the query ever runs.
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.
PRECISE (BigQuery dryRun), UPPER_BOUND (Snowflake EXPLAIN), or HEURISTIC (Databricks EXPLAIN COST) — so your agent never over-trusts a heuristic number.run_query_bounded takes max_bytes_billed / max_rows / max_estimated_cost_usd on each call; no shared session state required. max_rows defaults to 1000 and the serialised result is capped at 8 MiB; executed on every result says whether the query ran.check_credentials(engine, warehouse?) — verifies credentials/connectivity without running a real query or a dry run; call this first after configuring a new engine. Supports BigQuery, Snowflake, and Databricks. What runs: BigQuery makes one metadata call; Snowflake logs in, runs USE WAREHOUSE when a warehouse is given (SELECT CURRENT_WAREHOUSE() when none is), reads the pinned warehouse's SHOW WAREHOUSES row, and runs one session-context statement only when that row says STARTED — otherwise ok: true with a detail built from the row (the statement could resume a suspended warehouse); Databricks reads the configured SQL warehouse through the Warehouses API (a control-plane GET) and opens a session (SELECT current_user()) only when it is RUNNING — otherwise ok: false with no session (the session could start a stopped warehouse). An unreadable state counts as not running on both. Opt in with COST_GUARD_SNOWFLAKE_ALLOW_WAREHOUSE_RESUME=true / COST_GUARD_DATABRICKS_ALLOW_WAREHOUSE_START=true — see Known limitations.describe_engine_capabilities(engine) — what's exact vs. approximate for this engine.estimate_query_cost(engine, sql, warehouse?, warehouse_size?, edition?) — pre-flight cost estimate, tagged with its accuracy tier. Supports BigQuery, Snowflake, and Databricks. Accepts exactly one SQL statement per call, and only read statements by default — first keyword SELECT, WITH, VALUES, SHOW, DESCRIBE, DESC or EXPLAIN (see Known limitations). warehouse_size (Snowflake/Databricks) and edition (Snowflake) can only raise the estimate — the dollar figure is priced at the warehouse the query is pinned to, as the server observes it (the SHOW WAREHOUSES size/type/generation, or the Databricks Warehouses API), and at the operator-configured SNOWFLAKE_EDITION, whichever is higher. Warehouse types without a modelled rate (Snowpark-optimized, Databricks Classic/Pro) get a byte estimate but no dollar figure. On a Snowflake warehouse that is not STARTED the cloud-provider and query-history lookups are skipped (Gen1 rates at the observed size, heuristic runtime, caveat) — the query-history lookup is also skipped whenever no warehouse argument is given; on a Databricks warehouse that is not RUNNING, or whose state cannot be read, no session is opened and no byte or dollar figure is returned — see Known limitations.run_query_bounded(engine, sql, max_bytes_billed?, max_rows?, max_estimated_cost_usd?, warehouse?, warehouse_size?, edition?) — refuses to run if the estimate exceeds your bound. max_rows defaults to 1000 (pass a larger value to raise it); results over 8 MiB serialised are truncated to whole rows with reason: result_size_exceeded; executed: true on ok and on the two truncation refusals (row_cap_exceeded, result_size_exceeded — the query ran), false on every other refusal (the query was never submitted, or BigQuery refused to run it). Supports BigQuery, Snowflake, and Databricks. Accepts exactly one SQL statement per call, and only read statements by default — first keyword SELECT, WITH, VALUES, SHOW, DESCRIBE, DESC or EXPLAIN (see Known limitations). A max_estimated_cost_usd cap is checked against that observed-warehouse estimate and refuses when no dollar figure exists. Not gated on warehouse state: its estimate and execution may resume/start the warehouse. Result rows carry the constant rows_provenance: warehouse_data_untrusted: they are data the warehouse returned, never instructions.Set GOOGLE_APPLICATION_CREDENTIALS to a service-account key file path (or run gcloud auth application-default login).
Set SNOWFLAKE_ACCOUNT, SNOWFLAKE_USER, SNOWFLAKE_ROLE (required — no default, never ACCOUNTADMIN), and either SNOWFLAKE_PRIVATE_KEY_PATH (preferred) or SNOWFLAKE_PASSWORD (discouraged). Optionally set SNOWFLAKE_EDITION to the account's edition — standard (default), enterprise, business_critical or vps — which sets the USD/credit price of every estimate; the per-call edition argument can only raise it.
SNOWFLAKE_ROLE is the *only* authorization boundary for the SQL an agent sends through this server, so it is enforced, not just documented. ACCOUNTADMIN, SECURITYADMIN and ORGADMIN are rejected (case-insensitively, quoted or not) before any Snowflake connection is opened: the check runs when the Snowflake configuration is first loaded, which is on the first Snowflake tool call, so the server process itself starts regardless of the value and a bad role surfaces as check_credentials returning ok: false (or as a tool error from estimate_query_cost/run_query_bounded), not as a startup exit. Every session also activates only that role — secondary roles are pinned to NONE in the login request, so a user whose Snowflake DEFAULT_SECONDARY_ROLES is ('ALL') no longer lends every other role it holds to model-written SQL. SNOWFLAKE_USER should ideally hold no role other than SNOWFLAKE_ROLE.SNOWFLAKE_SECONDARY_ROLES (optional, default NONE; the only other value is ALL) is the opt-out for deployments that reached objects only through a secondary role. Prefer granting those objects to SNOWFLAKE_ROLE instead; set ALL only if you accept that the agent's SQL runs with every role the user holds. check_credentials reports the active secondary-role set (CURRENT_SECONDARY_ROLES()) so you can confirm what is in force.STATEMENT_TIMEOUT_IN_SECONDS: 60 s for check_credentials/estimate_query_cost, 120 s for run_query_bounded, matching its watchdog) so a query cannot keep running — and billing — if this process dies mid-call. The value is applied *read-then-lower*: the server reads the session's effective value first and only issues ALTER SESSION when that value is 0 (unbounded), unparseable, or above the target. A stricter account- or user-level policy (say 30 s) is therefore never raised; note that a session-level value would otherwise override account/user levels in Snowflake's parameter hierarchy (only the warehouse level combines lowest-wins).EXPLAIN USING JSON and the run_query_bounded execution are submitted with num_statements=1 and the session logs in with MULTI_STATEMENT_COUNT=1, so Snowflake itself rejects ;-separated text that the server-side scanner (see Known limitations) did not already refuse. There is no opt-out; multi-statement Snowflake text was never supported.COST_GUARD_SNOWFLAKE_ALLOW_WAREHOUSE_RESUME=true (optional, off by default; the value must be exactly true) lets check_credentials and estimate_query_cost run SELECT CURRENT_REGION(), the QUERY_HISTORY read and the session-context SELECT on a warehouse whose SHOW WAREHOUSES state is not STARTED (and the QUERY_HISTORY read without a warehouse argument), accepting that they can resume it and bill compute. See Known limitations for what is skipped by default.Set DATABRICKS_SERVER_HOSTNAME and DATABRICKS_HTTP_PATH (from the SQL warehouse's Connection Details tab), and either DATABRICKS_TOKEN (a personal access token, simplest) or DATABRICKS_CLIENT_ID + DATABRICKS_CLIENT_SECRET (OAuth machine-to-machine via a service principal, preferred for automated use). Only Serverless SQL warehouses are priced — a Classic/Pro warehouse gets a byte estimate but no dollar figure, see Known Limitations.
By default check_credentials and estimate_query_cost refuse to open a session unless the warehouse's state, read through the Warehouses API, is RUNNING (they also refuse when the state cannot be read); set COST_GUARD_DATABRICKS_ALLOW_WAREHOUSE_START=true (exactly that value) to let them start a stopped warehouse, billing compute. run_query_bounded is not gated. See Known limitations.
COST_GUARD_MAX_IN_FLIGHT_QUERIES (default 8) caps how many run_query_bounded calls may be in flight at once — counting calls the host has already cancelled, until their worker thread exits (at most the 120 s watchdog). A call over the cap fails immediately with a tool error naming this variable, before any warehouse connection is opened. Must be a positive integer (the server refuses to start otherwise); raise it only if your host legitimately runs more concurrent billable queries.
By default estimate_query_cost and run_query_bounded accept only read statements: the first keyword after comments and any opening parentheses must be SELECT, WITH, VALUES, SHOW, DESCRIBE, DESC or EXPLAIN, and a WITH is admitted only when the statement after its CTE list resolves to SELECT or VALUES (Spark SQL allows WITH ... INSERT). Anything else is refused before any dry run, EXPLAIN or execution, because warehouse rows re-enter the model's context and can steer the next call (DECISIONS.md #13). The gate is defence in depth, not the authorisation boundary: that is the deployed credential's grants, so deploy a read-only principal — BigQuery: data-viewer plus job-user roles; Snowflake: a role with USAGE/SELECT only, never an admin role; Databricks: SELECT/USE privileges on the warehouse's catalogs. Operators who intend this server to run writes under its credential can set COST_GUARD_ALLOW_WRITE_STATEMENTS=1 (exactly that value, read per call; anything else keeps the gate on). With COST_GUARD_ALLOW_MULTI_STATEMENT_SQL=1 every statement in the text must be a read, so BigQuery scripts (DECLARE/SET/BEGIN) need both opt-outs.
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
只显示了开头部分;其余内容请在仓库中阅读