MCP Server for Snowflake
@dynamike
MCP Server for connecting to Snowflake with read-only questions
概览
What is MCP Server for Snowflake?
MCP Server for Snowflake is a Model Context Protocol server that enables Claude to perform read-only queries against Snowflake databases. It uses either service account private key or external browser authentication and supports multiple SQL statement types (SELECT, SHOW, DESCRIBE, EXPLAIN, WITH) with automatic result formatting.
How to use MCP Server for Snowflake?
Install the package with uv pip install -e . after cloning, configure a .env file with Snowflake credentials and chosen authentication type, then run uv run snowflake-mcp or uv run snowflake-mcp-stdio. For Claude Desktop, add a custom MCP server pointing to the uv command with the appropriate arguments.
Key features of MCP Server for Snowflake
- Read-only operations with security checks to prevent data modification
- Flexible authentication (private key or external browser)
- Connection pooling with automatic background refresh
- Support for querying multiple views and databases in a single session
- MCP-compatible handlers for querying Snowflake data
- Stdio-based MCP server for easy integration with Claude Desktop
Use cases of MCP Server for Snowflake
- List all accessible databases in a Snowflake account
- Describe the structure and SQL definition of specific views
- Query sample data from a view with an optional row limit
- Execute custom read-only SQL queries and get results as markdown tables
- Compare data from views in different databases within one session
FAQ from MCP Server for Snowflake
What authentication methods are supported?
Two methods: private key authentication (service account with private key file) and external browser authentication (opens a browser window for interactive login).
Is MCP Server for Snowflake safe for production use?
Yes. The server enforces read-only operations, automatically adds LIMIT clauses to prevent large result sets, validates inputs to prevent SQL injection, and requires explicit authentication — the .env file should never be committed to version control.
How do I configure the connection pool refresh interval?
Set the environment variable SNOWFLAKE_CONN_REFRESH_HOURS to the desired number of hours. The default is 8 hours.
What SQL statements are allowed?
Only SELECT, SHOW, DESCRIBE, EXPLAIN, and WITH statements are permitted; all data modification queries are rejected.
What Python version does MCP Server for Snowflake require?
Python 3.12 or higher.