A Model Context Protocol (MCP) server for performing read-only operations against Snowflake databases. This tool enables Claude to securely query Snowflake data without modifying any information.
This repository is a fork from snowflake-mcp-server, from Michael Kania.
- Flexible authentication to Snowflake using either:
- Service account authentication with private key
- External browser authentication for interactive sessions
- Connection pooling with automatic background refresh to maintain persistent connections
- Support for querying multiple views and databases in a single session
- Support for multiple SQL statement types (SELECT, SHOW, DESCRIBE, EXPLAIN, WITH)
- MCP-compatible handlers for querying Snowflake data
- Read-only operations with security checks to prevent data modification
- Support for Python 3.12+
- Stdio-based MCP server for easy integration with Claude Desktop
- Corporate SSL Certificate Support: Automatically uses Windows certificate store for SSL connections, ensuring compatibility with corporate environments that use custom or self-signed certificates
-
Python 3.12 or higher
Install Python from python.org. During installation, check "Add Python to PATH".
Verify installation:
python --version -
Python in PATH
If Python is not recognized, add it to your PATH:
-
Microsoft Visual C++ Build Tools
Required for installing Python packages with native dependencies.
Download and install from Visual Studio Build Tools:
- Run the installer
- Select "Desktop development with C++"
- Click Install
Warning
If you have installed any of the prerequisites above (Python, Visual C++ Build Tools, or modified PATH), restart your computer before proceeding with the following installation steps.
Follow the next steps by executing the commands in your terminal. Preferably use cmd instead of powershell.
-
Clone this repository:
git clone https://github.com/pedrochans/snowflake-mcp-server.git
cd snowflake-mcp-server -
Install uv:
pip install uv
Verify installation:
uv --version -
Create a virtual environment and install the package:
Create a virtual environment with Python 3.12+:
uv venv
Activate the environment
# Windows: .venv\Scripts\activate # macOS/Linux: source .venv/bin/activate
Install the package in editable mode:
uv pip install -e .Verify the installation:
# You should see snowflake-mcp-server listed uv pip list[!NOTE] Si encuentras problemas de compatibilidad entre tu versión de Python y las librerías, pide ayuda a Copilot para encontrar versiones compatibles.
-
Configure your Snowflake credentials:
Choose one of the provided example files based on your preferred authentication method:
For external browser authentication:
# Linux: cp .env.browser.example .env # Windows: copy .env.browser.example .env
Then edit the
.envfile to set your Snowflake account details.For private key authentication:
# Linux: cp .env.private_key.example .env # Windows: copy .env.private_key.example .env
Then edit the
.envfile to set your Snowflake account details or path to your private key.Use simple quotes
', after editing the.envfile, it should look like this, with your credentials:If you are lost in this step, you can find your Snowflake account details in Snowsight > Profile > View Account Details:
- In VS Code, press Ctrl + Shift + P, then search for MCP: Open User Configuration
- In this JSON, add a new server with the full path to your uv executable:
"snowflake-mcp-server": { "command": "uv", "args": [ "--directory", "/<path-to-code>/snowflake-mcp-server", "run", "snowflake-mcp" ] }
This is an example of how the entire JSON file should look like if you have only this MCP installed:
{
"servers": {
"snowflake-mcp-server": {
"command": "uv",
"args": [
"--directory",
"/<path-to-code>/snowflake-mcp-server",
"run",
"snowflake-mcp"
]
}
},
"inputs": []
}Alternative option: explicitly specify the stdio transport:
"snowflake-mcp-server": {
"command": "uv",
"args": [
"--directory",
"/<path-to-code>/snowflake-mcp-server",
"run",
"snowflake-mcp-stdio"
]
}-
After that, click on Start or Restart
When using external browser authentication, a browser window will automatically open prompting you to log in to your Snowflake account.
-
If everything is OK, you will see the message: "Discovered 5 tools"
Now you can go to GitHub Copilot chat, ensure that the new Tool is available in Agent mode → Configure Tools, and start prompting!
Authenticate, and just ask Copilot to query some data in Snowflake!
The server provides the following tools for querying Snowflake:
- list_databases: List all accessible Snowflake databases
- list_views: List all views in a specified database and schema
- describe_view: Get detailed information about a specific view including columns and SQL definition
- query_view: Query data from a view with an optional row limit
- execute_query: Execute custom read-only SQL queries (SELECT, SHOW, DESCRIBE, EXPLAIN, WITH) with results formatted as markdown tables. Supports:
- SHOW commands for metadata (TABLES, PIPES, TASKS, STREAMS, GRANTS, PROCEDURES, FUNCTIONS, etc.)
- INFORMATION_SCHEMA queries for detailed object metadata
- SNOWFLAKE.ACCOUNT_USAGE queries for historical and audit data (requires permissions)
When using with VS Code, you can ask questions like:
- "Can you list all the databases in my Snowflake account?"
- "List all views in the MARKETING database"
- "Describe the structure of the CUSTOMER_ANALYTICS view in the SALES database"
- "Show me sample data from the REVENUE_BY_REGION view in the FINANCE database"
- "Run this SQL query: SELECT customer_id, SUM(order_total) as total_spend FROM SALES.ORDERS GROUP BY customer_id ORDER BY total_spend DESC LIMIT 10"
- "Query the MARKETING database to find the top 5 performing campaigns by conversion rate"
- "Compare data from views in different databases by querying SALES.CUSTOMER_METRICS and MARKETING.CAMPAIGN_RESULTS"
- "Show me all tables in the SALES schema"
- "Find all columns named 'customer_id' across all tables in the database"
- "Show me all stored procedures in the ETL schema"
- "List all pipes that load data into the RAW_DATA database"
- "Show the query history for the last hour"
- "What tasks are scheduled to run in this database?"
Connection pooling behavior can be configured through environment variables:
SNOWFLAKE_CONN_REFRESH_HOURS: Time interval in hours between connection refreshes (default: 8)
Example .env configuration:
# Set connection to refresh every 4 hours
SNOWFLAKE_CONN_REFRESH_HOURS=4
This server:
- Enforces read-only operations (only SELECT, SHOW, DESCRIBE, EXPLAIN, and WITH statements are allowed)
- Automatically adds LIMIT clauses to prevent large result sets
- Uses secure authentication methods for connections to Snowflake
- Validates inputs to prevent SQL injection
.env file secure and never commit it to version control. The .gitignore file is configured to exclude it.
Contributions are welcome! Please feel free to submit a Pull Request.
This project uses:
- Snowflake Connector Python for connecting to Snowflake
- MCP (Model Context Protocol) for interacting with Claude
- Pydantic for data validation
- python-dotenv for environment variable management
- pip-system-certs for corporate SSL certificate support on Windows







