snowflake-analytics-mcp-server
Connect to Snowflake and explore, query, and (if enabled) run AI text analytics on your data.
Test connectivity and return version, account, user, role, warehouse, database, and schema.
Discover databases, schemas, warehouses, and tables/views.
Describe table columns, types, nullability, and defaults.
Fetch sample rows from a table with a configurable limit.
Execute SQL queries; read-only by default, with writes/DDL only if SNOWFLAKE_READ_ONLY=false.
Per README, when Cortex AI is enabled: natural-language-to-SQL answers, LLM completions, sentiment analysis, summarization, classification, and translation.
Provides tools for querying and exploring a Snowflake data warehouse, including listing databases, schemas, tables, and warehouses, describing table schemas, sampling data, and executing SQL queries (read-only by default).
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@snowflake-analytics-mcp-server list the tables in the ANALYTICS_DB.PUBLIC schema"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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-serverRelated MCP server: IcebergMCP
Quick start (key-pair auth — recommended)
Snowflake is phasing out password-only sign-ins. Password connections fail with
Multi-factor authentication is required for this account once MFA is enforced on the user,
and an MCP server running over stdio cannot answer an MFA prompt. Key-pair auth with a
dedicated service user avoids MFA entirely and is the recommended setup.
1. Generate a key pair (uses Node — no OpenSSL needed):
node -e "const {generateKeyPairSync:g}=require('crypto'),f=require('fs');const k=g('rsa',{modulusLength:2048,publicKeyEncoding:{type:'spki',format:'pem'},privateKeyEncoding:{type:'pkcs8',format:'pem'}});f.writeFileSync('rsa_key.p8',k.privateKey);f.writeFileSync('rsa_key.pub',k.publicKey)"This writes rsa_key.p8 (private key — keep secret) and rsa_key.pub (public key — safe to share).
2. Create a service user in Snowflake (as ACCOUNTADMIN, in a Snowsight worksheet). Paste the
public key's base64 body only — without the BEGIN/END lines:
USE ROLE ACCOUNTADMIN;
CREATE USER ANALYTICS_MCP
TYPE = SERVICE
RSA_PUBLIC_KEY = 'MIIBIjANBgkqh...'
DEFAULT_ROLE = SYSADMIN
DEFAULT_WAREHOUSE = COMPUTE_WH;
GRANT ROLE SYSADMIN TO USER ANALYTICS_MCP;To add a key to an existing user instead: ALTER USER <name> SET RSA_PUBLIC_KEY = 'MIIBIjANBgkqh...';
3. Verify the key (optional but recommended). The fingerprint in Snowflake must match your local key:
DESC USER ANALYTICS_MCP; -- see the RSA_PUBLIC_KEY_FP rownode -e "const c=require('crypto'),f=require('fs');console.log('SHA256:'+c.createHash('sha256').update(c.createPublicKey(f.readFileSync('rsa_key.pub')).export({type:'spki',format:'der'})).digest('base64'))"4. Configure the server with SNOWFLAKE_USERNAME=ANALYTICS_MCP and the private key (see
Configuration). Do not set a password.
5. Test: call test_connection — it should return connected: true with your user and role.
Configuration
All credentials come from environment variables.
Variable | Required | Default | Description |
| ✅ | — | Account identifier in |
| ✅ | — | Login name |
| key-pair | — | PEM private key contents. Multi-line, single-line, or |
| key-pair | — | Path to a PEM private key file (alternative to the above; convenient for local use) |
| — | — | Passphrase, if the private key is encrypted |
| password auth only | — | Not needed with key-pair auth. Fails for MFA-enforced users |
| — | auto |
|
| OAuth | — | OAuth access token (with |
| recommended | — | Virtual warehouse to use (queries fail without an active warehouse) |
| recommended | — | Default database (used by |
| recommended | — | Default schema |
| — | user default | Role to assume |
| — |
| 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 |
| — |
| Partner Connection String Identifier registered on SPN; sent as the Snowflake |
Account identifier tip
Find your identifier by running this in Snowsight:
SELECT CURRENT_ORGANIZATION_NAME() || '-' || CURRENT_ACCOUNT_NAME();Use hyphens, not underscores, if a client has trouble connecting (e.g. orgname-account-name).
Claude Desktop config
Add to claude_desktop_config.json.
Key-pair auth (recommended)
{
"mcpServers": {
"snowflake": {
"command": "npx",
"args": ["-y", "snowflake-analytics-mcp-server"],
"env": {
"SNOWFLAKE_ACCOUNT": "ORGNAME-ACCOUNTNAME",
"SNOWFLAKE_USERNAME": "ANALYTICS_MCP",
"SNOWFLAKE_PRIVATE_KEY_PATH": "/path/to/rsa_key.p8",
"SNOWFLAKE_ROLE": "SYSADMIN",
"SNOWFLAKE_WAREHOUSE": "COMPUTE_WH",
"SNOWFLAKE_DATABASE": "ANALYTICS_DB",
"SNOWFLAKE_SCHEMA": "PUBLIC"
}
}
}
}For hosted environments where the key file isn't on disk, pass the key contents instead:
"SNOWFLAKE_PRIVATE_KEY": "-----BEGIN PRIVATE KEY-----\nMIIE...\n-----END PRIVATE KEY-----"If the key is encrypted, also set SNOWFLAKE_PRIVATE_KEY_PASSPHRASE.
Password auth
Only works for users without enforced MFA. Prefer key-pair auth.
"env": {
"SNOWFLAKE_ACCOUNT": "ORGNAME-ACCOUNTNAME",
"SNOWFLAKE_USERNAME": "ANALYTICS_USER",
"SNOWFLAKE_PASSWORD": "••••••••",
"SNOWFLAKE_WAREHOUSE": "COMPUTE_WH",
"SNOWFLAKE_DATABASE": "ANALYTICS_DB",
"SNOWFLAKE_SCHEMA": "PUBLIC",
"SNOWFLAKE_ROLE": "ANALYST"
}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.
Troubleshooting
Error | Cause and fix |
| The server is using password auth for an MFA-enforced user. Switch to key-pair auth (see Quick start). Make sure |
| The private key doesn't match the public key on the user, or |
|
|
| Set |
| The role lacks access. Check |
Can't connect / invalid account | Use the |
Security
Never commit or share the private key (
rsa_key.p8). Add key files to.gitignore.Use a dedicated
TYPE = SERVICEuser with only the privileges it needs, rather than a personal login.Keep
SNOWFLAKE_READ_ONLY=true(the default) unless writes are required.To rotate a key, set
RSA_PUBLIC_KEY_2with the new key, switch the server over, then unset the old one.
License
MIT
Available Tools
8 toolsdescribe_tableDescribe tableA
Return column names, data types, nullability and defaults for a table (or view).
Inputs: table (required), schema, database.
execute_queryExecute queryA
Run a SQL query and return rows as JSON. Read-only by default (SELECT/SHOW/DESCRIBE/WITH). Set SNOWFLAKE_READ_ONLY=false to allow writes/DDL.
Inputs: query (required).
get_table_sampleGet table sampleA
Fetch a sample of rows from a table. Use this to preview data for a selected table.
Inputs: table (required), limit, schema, database.
list_databasesList databasesA
List all databases the current role can access.
Inputs: no named parameters.
list_schemasList schemasA
List schemas in a database. Defaults to SNOWFLAKE_DATABASE when database is omitted.
Inputs: database.
list_tablesList tablesA
List available Snowflake tables (and views) for analytics table discovery. Returns a flat array of { table_name } objects. Scoped to the connection's database/schema unless overridden.
Inputs: schema, database, include_views.
list_warehousesList warehousesA
List virtual warehouses the current role can see, with size and state.
Inputs: no named parameters.
test_connectionTest connectionA
Verify connectivity and return the current Snowflake version, account, user, role, warehouse, database and schema.
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
Each tool targets a distinct entity or action: databases, schemas, tables, warehouses, connection status, table metadata, sample data, and arbitrary SQL. No overlapping purposes, so agents can reliably select the correct tool.
All tool names follow a consistent verb_noun pattern with lowercase underscores (e.g., list_databases, describe_table, execute_query). Even test_connection and get_table_sample adhere to the pattern, making naming predictable and easy to reason about.
Eight tools provide a focused but complete set for an analytics use case, covering discovery, metadata, sampling, and querying. The count is well-scoped without unnecessary redundancy or missing essentials.
The tool surface covers the full analytics workflow: connection verification, listing entities (databases, schemas, tables/views, warehouses), schema exploration, data preview, and arbitrary read-only queries. No obvious gaps for the stated domain.
Maintenance
Related MCP Connectors
Text-to-SQL MCP server: read-only queries on PostgreSQL, MySQL and SQL Server with your real schema
Query your warehouse or a CSV with Claude/ChatGPT over MCP, governed by table-level ACL + audit.
Hosted SQL Server MCP server for Claude, ChatGPT and Cursor, with each action switched per account.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that provides access to Snowflake databases for any MCP-compatible client, allowing execution of SQL queries with automatic connection management.5MIT
- AlicenseCqualityDmaintenanceAn MCP server that enables natural language interaction with Apache Iceberg data lakehouses, allowing users to query table metadata, schemas, and properties through Claude, Cursor, or other MCP clients.541Apache 2.0
- AlicenseAqualityDmaintenanceA Model Context Protocol server that enables natural language interaction with Snowflake databases through AI guidance, supporting core database operations, warehouse management, and AI-powered data analysis features.133MIT
- AlicenseAqualityBmaintenanceA Snowflake MCP server — SQL queries, schema exploration, and data insights for AI assistants666 PyPI2MIT