Skip to content

yuly3/mcp-snowflake

Repository files navigation

MCP Snowflake Server

A Model Context Protocol (MCP) server that connects to Snowflake databases and executes SQL queries.

Features

  • list_databases - Retrieve a list of accessible databases
  • list_schemas - Retrieve a list of schemas from a specified database
  • list_tables - Retrieve a list of tables and views from a specified database and schema (supports filtering by name or object type)
  • describe_table - Retrieve detailed structure information for a specified table
  • execute_query - Execute read-only SQL queries and return results
  • sample_table_data - Retrieve sample data from a specified table using Snowflake's SAMPLE ROW clause
  • analyze_table_statistics - Generate comprehensive statistical analysis for table columns using approximation functions
  • profile_semi_structured_columns - Profile VARIANT/ARRAY/OBJECT columns with sampled flatten-based analysis
  • search_columns - Search for columns across tables by name pattern and/or data type

Installation

Prerequisites

  • Python 3.13 or higher
  • uv (Python package manager)
  • Access to a Snowflake account

Setup

  1. Clone the repository:

    git clone <repository-url>
    cd mcp-snowflake
  2. Install using uv:

    uv tool install -e .

Configuration

Copy the configuration file sample and edit it:

cp .mcp_snowflake.toml.example .mcp_snowflake.toml
[snowflake]
account = "your-account.region"
user = "your-username"
password = "your-password"
warehouse = "your-warehouse"
role = "your-role"
authenticator = "SNOWFLAKE"

Environment variables (SNOWFLAKE__ACCOUNT, SNOWFLAKE__USER, etc.) are also supported.

For full configuration reference including tool toggles, timeout tuning, secondary roles, and browser-based SSO, see docs/settings.md.

Usage

Start the MCP server:

uvx mcp-snowflake --config {your-config-path}

Troubleshooting

Connection Errors

  • Verify that configuration file or environment variables are correctly set
  • Check that Snowflake account and username are correct
  • If authenticator=SNOWFLAKE, verify password is set correctly
  • Verify network connectivity

Permission Errors

  • Ensure the specified user has permission to access the database
  • Set the ROLE if necessary

Development

See docs/development.md.

License

MIT License

About

Model Context Protocol (MCP) server for Snowflake database connectivity and SQL query execution

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages