Home / MCP / Snowflake MCP Server
Provides access to Snowflake databases through MCP to run queries and manage connections securely.
Configuration
View docs{
"mcpServers": {
"snowflake": {
"command": "python",
"args": [
"server.py"
],
"env": {
"SNOWFLAKE_USER": "your_username",
"SNOWFLAKE_ACCOUNT": "YourAccount.Region",
"SNOWFLAKE_DATABASE": "your_database",
"SNOWFLAKE_WAREHOUSE": "your_warehouse",
"SNOWFLAKE_ROLE": "your_role",
"SNOWFLAKE_PASSWORD": "your_password",
"SNOWFLAKE_PRIVATE_KEY_FILE": "/path/to/rsa_key.p8",
"SNOWFLAKE_PRIVATE_KEY_PASSPHRASE": "your_passphrase"
}
}
}
}You can use the Snowflake MCP Server to access Snowflake databases from any MCP-compatible client. It implements the Model Context Protocol, allowing you to run SQL queries, manage connections automatically, handle results and errors, and authenticate with Snowflake using either passwords or key pairs.
Start your MCP client and point it to the Snowflake MCP server configuration. The server exposes a tool to run SQL queries against your Snowflake databases and returns structured results that your client can consume. You can rely on automatic connection management, which handles initial connections, timeouts, reconnections, and cleanup when you stop using the service. Use either password-based authentication or key pair authentication as configured in Snowflake.
Prerequisites: you need Python installed on your machine. You also need a MCP client configured to communicate with the server via standard input/output. Install the server dependencies and set up your environment as follows.
# 1. Ensure Python is installed
python --version
# 2. Clone the project repository (replace with your actual clone path)
# git clone https://github.com/davidamom/snowflake-mcp.git
# 3. Navigate to the server directory and install dependencies
cd snowflake-mcp
pip install -r requirements.txtConfigure how the server connects to Snowflake by creating a configuration file at the project root. The configuration defines the Snowflake connection details, the authentication method, and how the server should be started by your MCP client.
Create a .env file in the project root and populate it with your Snowflake connection information and authentication method.
Two authentication methods are supported. You can use password authentication or key pair authentication. If both are configured, key pair authentication is preferred.
You can run the server inside a Docker container for consistent deployment. Build the image and start the container using the commands shown.
The server handles the MCP communication via stdio. Your MCP client starts the server as part of its workflow, so manual startup is typically only needed for development or testing.
If you encounter connection timeouts or authentication errors, verify your .env configuration, ensure the Snowflake account/region is correct, and confirm that the required Snowflake role has the necessary permissions for the queries you intend to run.
The server manages connection lifecycles automatically, creating connections lazily on first use, validating parameters, reconnecting on timeouts, and cleaning up resources when stopped.
Executes a SQL query on Snowflake and returns the results in a structured format.
Executes a SQL query and exports the results to a CSV file, returning the number of rows and the file path.