Snowflake MCP Server

io.github.nsphung由 GitHub 帳號 nsphung 發布v0.14.4更新於 Oct 27, 2026

A Snowflake MCP server — SQL queries, schema exploration, and data insights for AI assistants

已驗證STDIO僅桌面資料庫資料與分析

概覽

AI 產生的概覽

將 AI 助理連接到 Snowflake,讓它能執行 SQL 查詢、瀏覽結構描述並記錄資料洞察。

可以做什麼
  • 執行唯讀的 SELECT 查詢
  • 列出資料庫、結構描述與資料表,並檢視資料表的欄位資訊
  • 開啟寫入模式後可執行 INSERT、UPDATE、DELETE 與 CREATE TABLE 語句
  • 把資料洞察附加到可持續更新的備忘資源
  • 在預取模式下將資料表結構預先載入為資源
適用情境
適合需要依據 Snowflake 資料倉儲回答問題、檢視資料表結構,或針對實際資料表草擬 SQL 的情境。面向已有 Snowflake 憑證、希望預設以唯讀方式探索資料的分析師與開發者。
執行需求
透過 uvx(Python 3.13)或 Docker 映像以 stdio 在本機執行。需要 Snowflake 帳戶識別碼、使用者名稱、倉庫、資料庫與結構描述,以及一種驗證方式的憑證:密碼、金鑰組檔案、外部瀏覽器、OAuth 用戶端憑證或 bearer token。也可讀取含具名設定的 TOML 連線檔案。需要能連線至 Snowflake 的網路。
安裝前請注意
憑證透過環境變數或 TOML 檔案提供,包括 SNOWFLAKE_PASSWORD、SNOWFLAKE_PRIVATE_KEY_FILE_PWD、SNOWFLAKE_OAUTH_CLIENT_SECRET 與 SNOWFLAKE_TOKEN,請勿將該檔案提交到版本控制。寫入工具預設關閉,但開啟後即可修改或刪除資料。查詢與結果會傳送到 Snowflake,助理也能看到查詢結果,應避免暴露敏感資料表。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Snowflake MCP Server,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README


Snowflake MCP Server NSP

A Model Context Protocol (MCP) server / MCP server that connects AI assistants to Snowflake — enabling SQL queries, schema exploration, and data insights directly from your LLM client.

Highlights:

  • Multiple authentication methods: password, key-pair, external browser, OAuth 2.0 (client credentials & bearer token), TOML connection files
  • TOML multi-connection config — manage production, staging, and development environments in one file
  • Write-safety guard — write operations are disabled by default and must be explicitly enabled
  • Exclusion patterns — filter out databases, schemas, or tables from discovery
  • --exclude-json-results flag — reduces LLM context window usage
  • Selective tool exclusion via --exclude_tools
  • Prefetch mode — pre-load table schema as MCP resources
  • Docker support with hardened image (DHI, nonroot user, no shell in runtime)

Table of Contents


Quick Start

The fastest way to try it — using uvx with a TOML connection file:

bash
# 1. Create a connections filecat > ~/snowflake_connections.toml << 'EOF'[myconn]account = "your_account"user = "your_user"password = "your_password"warehouse = "COMPUTE_WH"database = "MY_DB"schema = "PUBLIC"role = "MYROLE"EOF
# 2. Run the serveruvx --python=3.13 --from mcp-snowflake-server-nsp mcp_snowflake_server \  --connections-file ~/snowflake_connections.toml \  --connection-name myconn

Claude Code

Add to your MCP client config (e.g. claude_desktop_config.json) using snowflake_connections.toml:

jsonc
"mcpServers": {  "snowflake": {    "command": "uvx",    "args": [      "--python=3.13",      "--from", "mcp-snowflake-server-nsp",      "mcp_snowflake_server",      "--connections-file", "/absolute/path/to/snowflake_connections.toml",      "--connection-name", "myconn"    ]  }}

Visual Studio Code (VSCode)

uvx — [Install in VS Code] [Install in VS Code Insiders]

Docker — [Install in VS Code (Docker)] [Install in VS Code Insiders (Docker)]

Or add manually to your MCP client config (e.g. .vscode/mcp.json) using .env file (see Authentication):

jsonc
"snowflake": {      // Snowflake MCP server      "type": "stdio",      "command": "uvx",      "args": [        "--from", "mcp-snowflake-server-nsp",        "--python=3.13",        "mcp_snowflake_server"      ],      "envFile": "${workspaceFolder}/.env"    }

OpenCode

Add to your MCP client config (e.g. opencode.jsonc) with .env file (see Authentication):

jsonc
"snowflake": {  "type": "local",  "command": [    "uvx",    "--from",    "mcp-snowflake-server-nsp",    "--python=3.13",    "mcp_snowflake_server",  ],  "enabled": true,  "timeout": 300000,}

Components

Resources

URIDescription
memo://insightsA continuously updated memo aggregating data insights appended via append_insight.
context://table/{table_name}(Prefetch mode only) Per-table schema summaries including columns and comments.

Tools

Query Tools
ToolDescriptionRequires
read_queryExecute SELECT queries. Input: query (string).—
write_queryExecute INSERT, UPDATE, or DELETE queries. Input: query (string).--allow_write
create_tableExecute CREATE TABLE statements. Input: query (string).--allow_write
Schema Tools
ToolDescriptionInput
list_databasesList all databases in the Snowflake instance.—
list_schemasList all schemas within a database.database (string)
list_tablesList all tables within a database and schema.database, schema (strings)
describe_tableDescribe columns of a table (name, type, nullability, default, comment).table_name as database.schema.table
Analysis Tools
ToolDescriptionInput
append_insightAdd a data insight to the memo://insights resource.insight (string)

Authentication

Password

Set credentials via environment variables or CLI flags (see Configuration Reference):

bash
SNOWFLAKE_USER="[email protected]"SNOWFLAKE_ACCOUNT="myaccount"SNOWFLAKE_AUTHENTICATOR="snowflake"SNOWFLAKE_PASSWORD="secret"SNOWFLAKE_WAREHOUSE="COMPUTE_WH"SNOWFLAKE_DATABASE="MY_DB"SNOWFLAKE_SCHEMA="PUBLIC"SNOWFLAKE_ROLE="MYROLE"

Key-Pair

Both RSA (RS256) and ECDSA (ES256, ES384, ES512) private keys are supported (requires snowflake-connector-python ≥ 4.5.0 for ECDSA).

bash
SNOWFLAKE_USER="[email protected]"SNOWFLAKE_ACCOUNT="myaccount"SNOWFLAKE_AUTHENTICATOR="snowflake_jwt"SNOWFLAKE_PRIVATE_KEY_FILE="/absolute/path/to/key.p8"SNOWFLAKE_PRIVATE_KEY_FILE_PWD="passphrase"  # Optional — only if key is encryptedSNOWFLAKE_WAREHOUSE="COMPUTE_WH"SNOWFLAKE_DATABASE="MY_DB"SNOWFLAKE_SCHEMA="PUBLIC"SNOWFLAKE_ROLE="MYROLE"

Or via CLI: --private_key_file /path/to/key.p8 --private_key_file_pwd passphrase

External Browser

bash
SNOWFLAKE_AUTHENTICATOR="externalbrowser"

Or in a TOML connection entry: authenticator = "externalbrowser"

OAuth 2.0 Client Credentials

Use the OAuth 2.0 client credentials flow to authenticate with a client ID and secret (no user interaction required):

bash
SNOWFLAKE_AUTHENTICATOR="oauth_client_credentials"SNOWFLAKE_ACCOUNT="myaccount"SNOWFLAKE_OAUTH_CLIENT_ID="your_client_id"SNOWFLAKE_OAUTH_CLIENT_SECRET="your_client_secret"SNOWFLAKE_OAUTH_TOKEN_REQUEST_URL="https://your-idp.example.com/oauth/token"SNOWFLAKE_OAUTH_SCOPE="session:role:MY_ROLE"  # OptionalSNOWFLAKE_WAREHOUSE="COMPUTE_WH"SNOWFLAKE_DATABASE="MY_DB"SNOWFLAKE_SCHEMA="PUBLIC"SNOWFLAKE_ROLE="MYROLE"

OAuth Bearer Token

Use a pre-fetched OAuth bearer token:

bash
SNOWFLAKE_AUTHENTICATOR="oauth"SNOWFLAKE_ACCOUNT="myaccount"SNOWFLAKE_TOKEN="eyJhbGciOiJSUzI1NiJ9..."SNOWFLAKE_WAREHOUSE="COMPUTE_WH"SNOWFLAKE_DATABASE="MY_DB"SNOWFLAKE_SCHEMA="PUBLIC"SNOWFLAKE_ROLE="MYROLE"

TOML Connection File (Recommended)

Manage multiple environments in a single file. See example_connections.toml for a full template.

toml
[production]account = "your_account"user = "your_user"password = "your_password"authenticator = "snowflake"warehouse = "COMPUTE_WH"database = "PROD_DB"schema = "PUBLIC"role = "ACCOUNTADMIN"
[development]account = "your_account"user = "dev_user"authenticator = "externalbrowser"warehouse = "DEV_WH"database = "DEV_DB"schema = "PUBLIC"role = "DEVELOPER"
[reporting]account = "your_account"user = "reporting_user"authenticator = "snowflake_jwt"private_key_file = "/path/to/private_key.pem"private_key_file_pwd = "passphrase"  # Optionalwarehouse = "REPORTING_WH"database = "REPORTING_DB"schema = "REPORTS"role = "REPORTING_ROLE"
[analytics_oauth]account = "your_account"authenticator = "oauth_client_credentials"oauth_client_id = "your_client_id"oauth_client_secret = "your_client_secret"oauth_token_request_url = "https://your-idp.example.com/oauth/token"oauth_scope = "session:role:ANALYTICS_ROLE"  # Optionalwarehouse = "ANALYTICS_WH"database = "ANALYTICS_DB"schema = "PUBLIC"role = "ANALYTICS_ROLE"

Pass the file with --connections-file and select a profile with --connection-name. Both flags are required together.


Installation

The package is published on PyPI as mcp-snowflake-server-nsp.

Contributing or running from source? See CONTRIBUTING.md for local development setup, test commands, formatting, and building the Docker image from source.


Via UVX

TOML configuration (recommended)
jsonc
"mcpServers": {  "snowflake_production": {    "command": "uvx",    "args": [      "--python=3.13",      "--from", "mcp-snowflake-server-nsp",      "mcp_snowflake_server",      "--connections-file", "/path/to/snowflake_connections.toml",      "--connection-name", "production"      // Optional flags — see Configuration Reference    ]  },  "snowflake_staging": {    "command": "uvx",    "args": [      "--python=3.13",      "--from", "mcp-snowflake-server-nsp",      "mcp_snowflake_server",      "--connections-file", "/path/to/snowflake_connections.toml",      "--connection-name", "staging"    ]  }}
Individual parameters
jsonc
"mcpServers": {  "snowflake": {    "command": "uvx",    "args": [      "--python=3.13",      "--from", "mcp-snowflake-server-nsp",      "mcp_snowflake_server",      "--account", "your_account",      "--warehouse", "your_warehouse",      "--user", "your_user",      "--password", "your_password",      "--role", "your_role",      "--database", "your_database",      "--schema", "your_schema"      // Optional: "--private_key_file", "/absolute/path/key.p8"      // Optional: "--private_key_file_pwd", "passphrase"      // Optional flags — see Configuration Reference    ]  }}

Via Docker Hub

The image is published on Docker Hub — no build step required:

bash
docker pull nsphung/mcp-snowflake-server-nsp

Note: -i (--interactive) is required to keep stdin open for the MCP stdio transport. Do not use -d (detach).

Claude Desktop — claude_desktop_config.json

With .env file (see Authentication):

jsonc
"mcpServers": {  "snowflake": {    "command": "docker",    "args": [      "run", "--rm", "-i",      "--env-file", "/absolute/path/to/.env",      "nsphung/mcp-snowflake-server-nsp"    ]  }}

With TOML connections file:

jsonc
"mcpServers": {  "snowflake": {    "command": "docker",    "args": [      "run", "--rm", "-i",      "-v", "/path/to/snowflake_connections.toml:/app/snowflake_connections.toml:ro",      "nsphung/mcp-snowflake-server-nsp",      "--connections-file", "/app/snowflake_connections.toml",      "--connection-name", "production"    ]  }}
VS Code — .vscode/mcp.json

With .env file:

jsonc
"snowflake": {  "type": "stdio",  "command": "docker",  "args": [    "run", "--rm", "-i",    "nsphung/mcp-snowflake-server-nsp"  ],  "envFile": "${workspaceFolder}/.env"}

With TOML connections file:

jsonc
"snowflake": {  "type": "stdio",  "command": "docker",  "args": [    "run", "--rm", "-i",    "-v", "/path/to/snowflake_connections.toml:/app/snowflake_connections.toml:ro",    "nsphung/mcp-snowflake-server-nsp",    "--connections-file", "/app/snowflake_connections.toml",    "--connection-name", "production"  ]}
OpenCode — opencode.jsonc
jsonc
"snowflake": {  "type": "local",  "command": [    "docker", "run", "--rm", "-i",    "--env-file", "/absolute/path/to/.env",    "nsphung/mcp-snowflake-server-nsp"  ],  "enabled": true,  "timeout": 300000}

Configuration Reference

All connection parameters can also be set as environment variables (SNOWFLAKE_<PARAM_UPPER>).

FlagEnv varDefaultDescription
--accountSNOWFLAKE_ACCOUNT—Snowflake account identifier
--userSNOWFLAKE_USER—Snowflake username
--passwordSNOWFLAKE_PASSWORD—Password (not required for key-pair / SSO)
--warehouseSNOWFLAKE_WAREHOUSE—Virtual warehouse to use
--databaseSNOWFLAKE_DATABASE(required)Default database
--schemaSNOWFLAKE_SCHEMA(required)Default schema
--roleSNOWFLAKE_ROLE—Role to assume
--private_key_fileSNOWFLAKE_PRIVATE_KEY_FILE—Absolute path to RSA or ECDSA (ES256/384/512) private key file (.p8 / .pem)
--private_key_file_pwdSNOWFLAKE_PRIVATE_KEY_FILE_PWD—Passphrase for encrypted private key
--connections-file——Path to TOML connections file
--connection-name——Connection profile name in TOML file (required with --connections-file)
--allow_write—falseEnable write_query and create_table tools
--prefetch / --no-prefetch—falsePre-load table schema as context://table/* resources (disables list_tables / describe_table)
--exclude_tools—[]Space-separated list of tool names to disable
--exclude-json-results—falseOmit embedded JSON resources from responses (reduces context window usage)
--log_dir——Directory for log file output
--log_level—INFOLog verbosity: DEBUG, INFO, WARNING, ERROR, CRITICAL

Exclusion Patterns

Edit runtime_config.json to exclude databases, schemas, or tables from all discovery tools. Patterns are matched case-insensitively as substrings.

json
{  "exclude_patterns": {    "databases": ["temp"],    "schemas": ["temp", "information_schema"],    "tables": ["temp"]  }}

The server loads this file automatically at startup from the working directory.


License

This project is licensed under the MIT License. See the LICENSE file for the full text.


Fork and Attribution

This repository is a fork of isaacwasserman/mcp-snowflake-server.

[MseeP.ai Security Assessment Badge]

  • Upstream authors and contributors retain copyright for their contributions.
  • Fork-specific changes are maintained by nsphung.
  • A summary of notable modifications is tracked in NOTICE.

來源:README.md,提交 d2971d3

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

2
  1. v0.14.4最新Sep 24, 2026
  2. v0.14.3Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分