프로토타입 · 미리 보기: 공식 레지스트리의 모든 서버를 담고 있으며 30분마다 동기화해요. 리뷰와 계정 기능은 다음 단계에서 열려요.
PopNx MCPAI를 쓰는 사람을 위한 MCP 서버 · 쉬운 말로 설명해요

Cost Guard MCP

제작자: mcpsmiths버전 0.6.0i★ –i내 컴퓨터에서 실행
레지스트리 이름io.github.mcpsmiths/cost-guard-mcp

설치

개요

제작자가 쓴 설명(영어 원문)

Pre-flight query cost and result-size guardrails for AI agents on BigQuery, Snowflake, Databricks

PopNx MCP의 세 기둥

이 세 가지는 절대 하나의 점수로 합치지 않아요. 의견, 측정, 인기는 서로 다른 것이니까요.

할 수 있는 일

이 서버는 아직 쉬운 말로 된 요약을 쓰지 못했어요. 아래는 레지스트리에서 읽어 온 사실이에요.

  • 연결 방식: 내 컴퓨터에서 실행
  • 전송 방식: stdio
  • 카테고리: 데이터베이스 및 데이터셋
  • 입력해야 할 값: GOOGLE_APPLICATION_CREDENTIALS, SNOWFLAKE_PRIVATE_KEY_PATH, SNOWFLAKE_PRIVATE_KEY_PASSPHRASE, SNOWFLAKE_PASSWORD, DATABRICKS_TOKEN, DATABRICKS_CLIENT_SECRET

설치

쓰고 있는 AI 앱을 고른 다음 설정을 복사하세요.

설치하기 전에

  • 기본 점검: 1개 중 1개 통과
  • 내 컴퓨터에서 내 사용자 계정의 권한(파일, 네트워크, 앱)으로 실행돼요.
  • 직접 입력할 값: 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

비밀로 표시된 값은 내 계정의 열쇠예요. 절대 다른 사람과 공유하거나 채팅에 붙여 넣지 마세요.

필요한 것

  • PyPIPython의 uv 설치(uvx 명령어용)

어떤 앱을 쓰세요?

위에서 앱을 고르세요. 기억해 두었다가 다음부터는 버튼에 “…에 설치”라고 표시해요.

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에서 열기

또는 설정을 직접 복사하기

프로젝트의 .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"
      }
    }
  }
}

브라우저가 앱을 열지 물어본 다음, 앱이 설정을 보여 주고 확인을 요청해요. 키 값은 비워 두니 직접 입력하세요.

VS Code에서 열기

또는 설정을 직접 복사하기

프로젝트의 .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는 인터넷에 있는 서버에만 연결할 수 있어요. 다른 앱을 고르세요.

선택한 앱은 이 기기의 쿠키에만 저장돼요. 계정은 필요 없어요.

직접 입력할 값

  • GOOGLE_APPLICATION_CREDENTIALS 비밀 env
    BigQuery: path to a service-account key file (Application Default Credentials). Required to use the bigquery engine.
  • SNOWFLAKE_ACCOUNT env
    Snowflake: account identifier. Required to use the snowflake engine.
  • SNOWFLAKE_USER env
    Snowflake: username. Required to use the snowflake engine.
  • SNOWFLAKE_ROLE env
    Snowflake: role to assume. Required to use the snowflake engine; has no default and must never be ACCOUNTADMIN (ACCOUNTADMIN, SECURITYADMIN and ORGADMIN are rejected before any Snowflake connection i…
  • SNOWFLAKE_SECONDARY_ROLES env
    Snowflake: secondary roles activated at login. NONE (default) means only SNOWFLAKE_ROLE is active in the session; ALL is the explicit opt-out that activates every role granted to SNOWFLAKE_USER.
  • SNOWFLAKE_PRIVATE_KEY_PATH 비밀 env
    Snowflake: path to an RSA private key file for key-pair auth (preferred over SNOWFLAKE_PASSWORD). Either this or SNOWFLAKE_PASSWORD is required to use the snowflake engine.
  • SNOWFLAKE_PRIVATE_KEY_PASSPHRASE 비밀 env
    Snowflake: passphrase for an encrypted SNOWFLAKE_PRIVATE_KEY_PATH key file, if the key is encrypted.
  • SNOWFLAKE_PASSWORD 비밀 env
    Snowflake: password (discouraged; prefer SNOWFLAKE_PRIVATE_KEY_PATH). Either this or SNOWFLAKE_PRIVATE_KEY_PATH is required to use the snowflake engine.
  • SNOWFLAKE_EDITION env
    Snowflake: account edition that sets the USD/credit price of estimates - standard (default), enterprise, business_critical or vps. The per-call edition argument can only raise it.
  • DATABRICKS_SERVER_HOSTNAME env
    Databricks: SQL warehouse server hostname (e.g. my-workspace.cloud.databricks.com, no scheme, no trailing slash). Required to use the databricks engine.
  • DATABRICKS_HTTP_PATH env
    Databricks: SQL warehouse HTTP path (from the warehouse's Connection Details tab, e.g. /sql/1.0/warehouses/ ). Required to use the databricks engine.
  • DATABRICKS_TOKEN 비밀 env
    Databricks: personal access token (simplest auth option). Either this or DATABRICKS_CLIENT_ID + DATABRICKS_CLIENT_SECRET is required to use the databricks engine.
  • DATABRICKS_CLIENT_ID env
    Databricks: OAuth machine-to-machine service-principal client ID (preferred for automated use). Requires DATABRICKS_CLIENT_SECRET as well.
  • DATABRICKS_CLIENT_SECRET 비밀 env
    Databricks: OAuth machine-to-machine service-principal client secret. Requires DATABRICKS_CLIENT_ID as well.
  • COST_GUARD_ALLOW_MULTI_STATEMENT_SQL env
    Set to 1 to let estimate_query_cost/run_query_bounded accept text containing more than one SQL statement. Off by default: the cost cap is only known to cover the single statement the dry run/EXPLAIN…
  • COST_GUARD_ALLOW_WRITE_STATEMENTS env
    Set to 1 (exactly that value) to let estimate_query_cost/run_query_bounded accept statements that are not reads. Off by default: only text whose first keyword (after comments and opening parentheses)…
  • COST_GUARD_MAX_IN_FLIGHT_QUERIES env
    Maximum number of run_query_bounded calls allowed in flight at once (positive integer, default 8). A cancelled call keeps its slot until its warehouse query completes or the 120 s watchdog fires; a c…
  • COST_GUARD_DATABRICKS_ALLOW_WAREHOUSE_START env
    Set to true (exactly that value) to let the read-only Databricks tools (check_credentials, estimate_query_cost) open a session on a SQL warehouse that is not RUNNING, which starts the warehouse and b…
  • COST_GUARD_SNOWFLAKE_ALLOW_WAREHOUSE_RESUME env
    Set to true (exactly that value) to let the read-only Snowflake tools run SELECT CURRENT_REGION(), the INFORMATION_SCHEMA.QUERY_HISTORY read and check_credentials' session-context SELECT on a warehou…

이 설정은 제작자의 레지스트리 정보로 만들었어요. README와 다르면 README를 따르세요.

할 수 있는 일

내 컴퓨터에서 실행돼요. 설치하면 AI 앱에 도구 목록이 나타나요.

기본 점검i

누구나 볼 수 있는 정보를 점검했고, 코드는 읽지 않았어요. 해당하지 않는 항목은 개수에서 뺐어요. · 2026년 11월 7일 점검

  • ✓ 통과

    제작자와 저장소 일치

    레지스트리 이름이 GitHub 계정 mcpsmiths 기준으로 확인되었고, 이 계정이 저장소를 소유하고 있어요

  • … 아직 점검 안 함

    계속 관리되고 있음

    아직 GitHub에서 이 저장소를 읽어 오지 않았어요

  • … 아직 점검 안 함

    라이선스 있음

    아직 GitHub에서 이 저장소를 읽어 오지 않았어요

  • – 해당 없음

    엔드포인트 응답

    내 컴퓨터에서 실행되는 서버라 인터넷 엔드포인트가 없어요

  • – 해당 없음

    OAuth로 로그인

    내 컴퓨터에서 실행되며, 대신 로컬 설정을 사용해요

  • … 아직 점검 안 함

    도구 설명에 숨겨진 지시 없음

    내 컴퓨터에서 실행돼요. 도구 목록은 인터넷 엔드포인트가 있는 서버에서만 읽을 수 있어요

데이터베이스 및 데이터셋 카테고리의 다른 서버와 비교i

  • 이 카테고리의 다른 서버 955개 중 0%보다 스타가 많아요
  • 이 카테고리의 다른 서버 955개 중 73%보다 최근에 레지스트리에 공개됐어요
  • 기본 점검 결과가 이 카테고리의 다른 서버 955개 중 100%와 같거나 더 좋아요

레지스트리에서 이 카테고리의 활성 서버 전체와 비교했어요. 스타는 게시자가 저장소를 소유한 경우에만 세요.

자주 묻는 질문

Cost Guard MCP, 안전한가요?

해당하는 기본 점검 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일 전 레지스트리에 올라왔어요.

어떤 앱에서 쓸 수 있나요?

Claude Desktop, Claude Code, Cursor, VS Code처럼 MCP를 지원하는 앱에서 쓸 수 있어요. 내 컴퓨터에 Python (uv)도 있어야 해요.

대신 쓸 수 있는 건 뭐가 있나요?

같은 카테고리에는: Supabase, MongoDB MCP Server, Elasticsearch MCP Server

대안

같은 카테고리에서 다른 제작자가 만든 서버예요. 스타 순으로 정렬했어요.

카드 보는 법:★ GitHub 스타i세 기둥: 리뷰 · 점검 · 사용 정도i업데이트 = 최신 버전을 레지스트리에 공개한 날i

Supabase

제작자: supabase

MCP server for interacting with the Supabase platform

컴퓨터 또는 클라우드★ 2,993Apache-2.0어제 업데이트
설치

MongoDB MCP Server

제작자: mongodb-js

MongoDB Model Context Protocol Server

내 컴퓨터에서 실행★ 1,157Apache-2.03일 전 업데이트
설치

Elasticsearch MCP Server

제작자: cr7258

MCP server for interacting with Elasticsearch

내 컴퓨터에서 실행★ 315Apache-2.014개월 전 업데이트
설치

제작자의 README

README 열기

제작자의 저장소에서 쓰인 그대로 가져왔어요. PopNx MCP가 검토하거나 보증한 내용이 아니에요. HTML, 이미지, 스크립트는 제거했어요. 링크를 누르면 이 사이트를 벗어나요.

cost-guard-mcp

Pre-flight query cost & result-size guardrails for AI agents, across BigQuery, Snowflake, and Databricks — 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 EXPLAIN COST) — 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. max_rows defaults to 1000 and the serialised result is capped at 8 MiB; executed on every result says whether the query ran.
  • Zero infrastructure — a single local stdio process. No database, no gateway, no Docker Compose.

Tools

  • 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.

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). 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.
  • Every session also carries a Snowflake-side statement deadline (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).
  • Snowflake sessions are also pinned to one statement per call: 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.
Databricks

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.

Concurrency (optional)

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.

Read-only statements (optional opt-out)

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.

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

앞부분만 보여 드려요. 나머지는 저장소에서 읽어 보세요

PopNx에게 묻기