snowflake-analytics-mcp-server
snowflake-analytics-mcp-server
A Model Context Protocol server for Snowflake. It connects to Snowflake via the official snowflake-sdk driver (pure Node — no client binary needed) and exposes table-discovery, SQL query, and Cortex AI tools over stdio. Runnable directly with npx.
Install
npm install -g snowflake-analytics-mcp-server
# or run directly (no install):
npx -y snowflake-analytics-mcp-serverConfiguration
All credentials come from environment variables.
Variable | Required | Default | Description |
| ✅ | — | Account identifier, e.g. |
| ✅ | — | Login name |
| ✅ (password auth) | — | Password (required unless using key-pair/OAuth) |
| — | — | Virtual warehouse to use |
| recommended | — | Default database (used by |
| recommended | — | Default schema |
| — | — | Role to assume |
| — |
|
|
| key-pair | — | PEM private key contents |
| key-pair | — | Path to a PEM private key file (alternative to above) |
| — | — | Passphrase, if the key is encrypted |
| OAuth | — | OAuth access token (with |
| — |
| Blocks writes/DDL in |
| — |
| Hard cap on returned rows |
| — |
| Client-side query timeout |
| — |
| Register the Cortex AI tools. Set |
| — |
| Default model for Cortex AI_COMPLETE / text-to-SQL |
Account identifier tip
Use hyphens, not underscores, in the account identifier if a client has trouble connecting (e.g. orgname-account-name).
Claude Desktop config
Add to claude_desktop_config.json:
{
"mcpServers": {
"snowflake": {
"command": "npx",
"args": ["-y", "snowflake-analytics-mcp-server"],
"env": {
"SNOWFLAKE_ACCOUNT": "xy12345.eu-central-1",
"SNOWFLAKE_USERNAME": "ANALYTICS_USER",
"SNOWFLAKE_PASSWORD": "••••••••",
"SNOWFLAKE_WAREHOUSE": "COMPUTE_WH",
"SNOWFLAKE_DATABASE": "ANALYTICS_DB",
"SNOWFLAKE_SCHEMA": "PUBLIC",
"SNOWFLAKE_ROLE": "ANALYST"
}
}
}
}Key-pair auth example
"env": {
"SNOWFLAKE_ACCOUNT": "xy12345.eu-central-1",
"SNOWFLAKE_USERNAME": "ANALYTICS_USER",
"SNOWFLAKE_AUTHENTICATOR": "SNOWFLAKE_JWT",
"SNOWFLAKE_PRIVATE_KEY_PATH": "/path/to/rsa_key.p8",
"SNOWFLAKE_PRIVATE_KEY_PASSPHRASE": "••••••••",
"SNOWFLAKE_DATABASE": "ANALYTICS_DB",
"SNOWFLAKE_SCHEMA": "PUBLIC"
}Tools
SQL & discovery
Tool | Args | Description |
|
| Returns |
| — | Returns version, account, user, role, warehouse, database, schema |
| — | Databases visible to the current role |
|
| Schemas in a database |
| — | Warehouses with size/state |
|
| Columns, types, nullability, defaults |
|
| Preview rows from a table |
|
| Run SQL. Read-only unless |
Cortex AI
These are additive generative-AI tools (token-billed, higher latency than the SQL tools). Each is invoked as a SELECT, so they work with SNOWFLAKE_READ_ONLY=true. Disable them with SNOWFLAKE_CORTEX_ENABLED=false.
Tool | Args | Description |
|
| Natural-language question → generated read-only SQL → answer. Best for analytics like "what is total revenue" |
|
| Free-form LLM completion via AI_COMPLETE |
|
| Sentiment of a text via AI_SENTIMENT |
|
| Concise summary of a text |
|
| Classify text into your categories via AI_CLASSIFY |
|
| Translate text (source auto-detected when omitted) |
cortex_ask generates SQL and always restricts it to read-only statements, regardless of SNOWFLAKE_READ_ONLY.
Cortex prerequisites: the account must be in a region that supports Cortex, and the connecting role needs the SNOWFLAKE.CORTEX_USER database role plus the USE AI FUNCTIONS privilege. If a Cortex call fails on region or privileges, the tool returns a hint explaining what to grant.
Database resolution
list_tables, describe_table, get_table_sample, list_schemas, and cortex_ask accept an optional database. If the value passed isn't an accessible database, the tool falls back to SNOWFLAKE_DATABASE instead of erroring — so a stray or wrong database name from an upstream caller doesn't cause a failed lookup.
License
MIT