MCP Server for Snowflake

by dynamike

14 stars
347 downloads
Not rated
GitHub

About

MCP Server for connecting to Snowflake with read-only questions

Details

Author
dynamike
GitHub stars
14
Downloads
347
Categories
Database

- Read-only enforcement: SELECT, SHOW, DESCRIBE, EXPLAIN, WITH only
- Private key or external browser authentication
- Automatic connection pooling with configurable refresh interval
- Input validation and automatic LIMIT clauses to prevent large results
- Stdio transport for easy Claude Desktop integration

Install Python 3.12+ and the uv package manager. Clone the repository, install with uv pip install -e ., configure a .env file with Snowflake credentials, then run as a stdio-based MCP server with uv run snowflake-mcp. Connect to it from Claude Desktop via Settings → MCP Servers.

MCP Server for Snowflake

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.

Features

- 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

Available Tools

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

Installation

Prerequisites

- Python 3.12 or higher
- A Snowflake account with either:
- A configured service account (username + private key), or
- A regular user account for browser-based authentication
- uv package manager (recommended)

Steps

1. Clone this repository:

   git clone https://github.com/yourusername/snowflake-mcp-server.git
cd snowflake-mcp-server

2. Install the package:

   uv pip install -e .

3. Create a .env file with your Snowflake credentials:

Choose one of the provided example files based on your preferred authentication method:

For private key authentication:

   cp .env.private_key.example .env

Then edit the .env file to set your Snowflake account details and path to your private key.

For external browser authentication:

   cp .env.browser.example .env

Then edit the .env file to set your Snowflake account details.

Usage

Running with uv

After installing the package, you can run the server directly with:

```
uv run snowflake-mcp

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.