
MCP server implementation for Snowflake integration
MCP server implementation for Snowflake integration
A Model Context Protocol (MCP) server that provides access to Snowflake databases for any MCP-compatible client.
This server implements the Model Context Protocol to allow any MCP client to:
MCP is a standard protocol that allows applications to communicate with AI models and external services. It enables AI models to access tools and data sources beyond their training data, expanding their capabilities through a standardized communication interface. Key features include:
The Snowflake-MCP server consists of several key components:
The system works through the following communication flow:
.env fileThis architecture allows for seamless integration between AI applications and Snowflake databases while maintaining security and efficient connection management.
git clone https://github.com/davidamom/snowflake-mcp.gitpip install -r requirements.txtBelow is an example configuration for Claude Desktop, but this server works with any MCP-compatible client. Each client may have its own configuration method:
{
"mcpServers": {
"snowflake": {
"command": "C:\\Users\\YourUsername\\path\\to\\python.exe",
"args": ["C:\\path\\to\\snowflake-mcp\\server.py"]
}
}
}Configuration parameters:
command: Full path to your Python interpreter. Please modify this according to your Python installation location.args: Full path to the server script. Please modify this according to where you cloned the repository.Example paths for different operating systems:
Windows:
{
"mcpServers": {
"snowflake": {
"command": "C:\\Users\\YourUsername\\anaconda3\\python.exe",
"args": ["C:\\Path\\To\\snowflake-mcp\\server.py"]
}
}
}MacOS/Linux:
{
"mcpServers": {
"snowflake": {
"command": "/usr/bin/python3",
"args": ["/path/to/snowflake-mcp/server.py"]
}
}
}Create a .env file in the project root directory and add the following configuration:
# Snowflake Configuration - Basic Info
SNOWFLAKE_USER=your_username # Your Snowflake username
SNOWFLAKE_ACCOUNT=YourAccount.Region # Example: MyOrg.US-WEST-2
SNOWFLAKE_DATABASE=your_database # Your database
SNOWFLAKE_WAREHOUSE=your_warehouse # Your warehouse
SNOWFLAKE_ROLE=your_role # Your role
# Authentication - Choose one methodThis MCP server supports two authentication methods:
Password Authentication
SNOWFLAKE_PASSWORD=your_password # Your Snowflake passwordKey Pair Authentication
SNOWFLAKE_PRIVATE_KEY_FILE=/path/to/rsa_key.p8 # Path to private key file
SNOWFLAKE_PRIVATE_KEY_PASSPHRASE=your_passphrase # Optional: passphrase if key is encryptedFor key pair authentication, you must first set up key pair authentication with Snowflake:
For instructions on setting up key pair authentication, refer to Snowflake documentation on key pair authentication.
If both authentication methods are configured, the server will prioritize key pair authentication.
The server provides automatic connection management features:
Automatic connection initialization
Connection maintenance
Connection cleanup
The server will start automatically when configured with your MCP client. No manual startup is required in normal operation. Once the server is running, your MCP client will be able to execute Snowflake queries.
For development testing, you can start the server manually using:
python server.pyNote: Manual server startup is not needed for normal use. The MCP client will typically manage server startup and shutdown based on the configuration.
You can also run the server using Docker. This method is recommended for production environments and ensures consistent execution across different platforms.
docker build -t snowflake-mcp .{
"mcpServers": {
"snowflake-docker": {
"command": "docker",
"args": [
"run",
"-i",
"snowflake-mcp"
],
"env": {
"SNOWFLAKE_USER": "your_username",
"SNOWFLAKE_ACCOUNT": "your_account",
"SNOWFLAKE_DATABASE": "your_database",
"SNOWFLAKE_WAREHOUSE": "your_warehouse",
"SNOWFLAKE_PASSWORD": "your_password",
"SNOWFLAKE_ROLE": "your_role"
}
}
}
}Note: The Docker implementation uses stdio for communication, so no ports need to be exposed.
If using key pair authentication with Docker, you'll need to mount your private key file:
docker run -i -v /path/to/your/key.p8:/app/rsa_key.p8:ro snowflake-mcpAnd update your configuration accordingly:
{
"mcpServers": {
"Snowflake-Docker": {
"command": "docker",
"args": [
"run",
"-i",
"-v",
"/path/to/your/key.p8:/app/rsa_key.p8:ro",
//optional
"-v",
"/path/to/export/dir/:/export/"
"snowflake-mcp"
],
"env": {
"SNOWFLAKE_USER": "your_username",
"SNOWFLAKE_ACCOUNT": "your_account",
"SNOWFLAKE_DATABASE": "your_database",
"SNOWFLAKE_WAREHOUSE": "your_warehouse",
"SNOWFLAKE_ROLE": "your_role",
"SNOWFLAKE_PRIVATE_KEY_FILE": "path_for_your_private_key",
"SNOWFLAKE_PRIVATE_KEY_PASSPHRASE": "your_password_for_private_key"
}
}
}
}The implementation consists of several key classes and modules:
The connection lifecycle is carefully managed to ensure reliability:
The server exposes the following tool to MCP clients:
execute_query - Executes a SQL query on Snowflake and returns the results
export_to_csv - Executes a SQL query on Snowflake and returns the results
This implementation follows best practices for both MCP protocol implementation and Snowflake database interaction.
This project is licensed under the MIT License. See the LICENSE file for details.
Copyright (c) 2025 David Amom
Pick your client and paste the snippet. Each one is the same server, written the way that client expects it.
claude mcp add snowflake -- C:\Users\YourUsername\path\to\python.exe C:\path\to\snowflake-mcp\server.py{
"mcpServers": {
"snowflake": {
"args": [
"C:\\path\\to\\snowflake-mcp\\server.py"
],
"command": "C:\\Users\\YourUsername\\path\\to\\python.exe"
}
}
}code --add-mcp '{"name":"snowflake","args":["C:\\path\\to\\snowflake-mcp\\server.py"],"command":"C:\\Users\\YourUsername\\path\\to\\python.exe"}'[mcp_servers.snowflake]
command = "C:\\Users\\YourUsername\\path\\to\\python.exe"
args = ["C:\\path\\to\\snowflake-mcp\\server.py"]Runs locally on your device. Your client starts the server itself, so nothing has to be hosted.
Paste this prompt into your agent. It reads this page and does the setup for you.
Read https://aiagentslisting.com/mcp/snowflake-mcp-service to learn what the "Snowflake MCP Service" MCP server does and how to install it. Add it to my coding agent's MCP configuration as documented on that page, then confirm the server connects and list the tools it exposes.Agents can also browse this directory over MCP at https://aiagentslisting.com/api/mcp
docker run -i -v /path/to/your/key.p8:/app/rsa_key.p8:ro snowflake-mcpThis server runs locally, so we can't read its tool list over the web yet.
Maintain this server? Claiming proves you own the listing and earns the last 4 points.
Claim this listingPaste this line near the top of your repository's README. The badge always renders the current score.
[](https://aiagentslisting.com/mcp/snowflake-mcp-service)Nothing comparable is listed yet.
No tagged releases on record.
Connect to the AI Agents Listing MCP server at https://aiagentslisting.com/api/mcp using the HTTP transport and complete the sign-in when it asks. Then call the submit_review tool for the listing "snowflake-mcp-service" with a rating from 1 to 5 and a short note on what worked and what did not.No reviews yet
Be the first to share your experience with this tool.
One email a week. New agents, MCP servers and skills, and what is actually getting traction.