Snowflake MCP server

Run SQL queries and other interactions against Snowflake databases
Back to servers
Provider
Isaac Wasserman
Release date
Dec 13, 2024
Language
Python
Package
Stats
90 stars

The Snowflake MCP Server provides database interaction with Snowflake through Model Context Protocol (MCP). It allows you to run SQL queries via tools and exposes data insights and schema context as resources, making it easier to interact with Snowflake databases programmatically.

Installation Options

Installing via Smithery

To install Snowflake Server for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install mcp_snowflake_server --client claude

Installing via UVX

Add the following to your Claude Desktop configuration file:

"mcpServers": {
  "snowflake_pip": {
    "command": "uvx",
    "args": [
      "--python=3.12",
      "mcp_snowflake_server",
      "--account", "your_account",
      "--warehouse", "your_warehouse",
      "--user", "your_user",
      "--password", "your_password",
      "--role", "your_role",
      "--database", "your_database",
      "--schema", "your_schema"
    ]
  }
}

Manual Installation

  1. Install Claude AI Desktop App
  2. Install uv:
curl -LsSf https://astral.sh/uv/install.sh | sh
  1. Create a .env file with your Snowflake credentials:
SNOWFLAKE_USER="xxx@your_email.com"
SNOWFLAKE_ACCOUNT="xxx"
SNOWFLAKE_ROLE="xxx"
SNOWFLAKE_DATABASE="xxx"
SNOWFLAKE_SCHEMA="xxx"
SNOWFLAKE_WAREHOUSE="xxx"
SNOWFLAKE_PASSWORD="xxx"
# Alternatively, use external browser authentication:
# SNOWFLAKE_AUTHENTICATOR="externalbrowser"
  1. Test locally:
uv --directory /absolute/path/to/mcp_snowflake_server run mcp_snowflake_server
  1. Add the server to your claude_desktop_config.json:
"mcpServers": {
  "snowflake_local": {
    "command": "/absolute/path/to/uv",
    "args": [
      "--python=3.12",
      "--directory", "/absolute/path/to/mcp_snowflake_server",
      "run", "mcp_snowflake_server"
    ]
  }
}

Available Resources

Insights Memo

  • memo://insights - A continuously updated memo of discovered data insights

Table Context

  • context://table/{table_name} - Per-table schema summaries including columns and comments (if prefetch enabled)

Available Tools

Query Tools

read_query

Execute SELECT queries to read data from the database.

Input: query (string) - The SELECT SQL query to execute
Returns: Query results as array of objects

write_query

Execute INSERT, UPDATE, or DELETE queries (enabled only with --allow-write).

Input: query (string) - The SQL modification query
Returns: Number of affected rows or confirmation

create_table

Create new tables in the database (enabled only with --allow-write).

Input: query (string) - CREATE TABLE SQL statement
Returns: Confirmation of table creation

Schema Tools

list_databases

List all databases in the Snowflake instance.

Returns: Array of database names

list_schemas

List all schemas within a specific database.

Input: database (string) - Name of the database
Returns: Array of schema names

list_tables

List all tables within a specific database and schema.

Input: 
- database (string) - Name of the database
- schema (string) - Name of the schema
Returns: Array of table metadata

describe_table

View column information for a specific table.

Input: table_name (string) - Fully qualified table name (database.schema.table)
Returns: Array of column definitions with names, types, nullability, defaults, and comments

Analysis Tools

append_insight

Add new data insights to the memo resource.

Input: insight (string) - Data insight discovered from analysis
Returns: Confirmation of insight addition
Effect: Triggers update of memo://insights resource

Configuration Options

Write Operations

By default, write operations are disabled. Enable them explicitly with the --allow-write flag.

Additional Options

--log_dir /path/to/logs - Specify log directory
--log_level DEBUG/INFO/WARNING/ERROR/CRITICAL - Set logging level
--exclude_tools tool_name [other_tool_name] - Exclude specific tools

You can also filter out specific databases, schemas, or tables via exclusion patterns in a runtime configuration file.

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later