dynamike_mcp_server_snowflake

dynamike_mcp_server_snowflake

by dynamike
An MCP server enabling Claude to securely perform read-only queries on Snowflake databases.

Snowflake Query Integration for Claude

Overview

The Snowflake Query Integration for Claude is a Model Context Protocol (MCP) server designed to facilitate secure, read-only operations against Snowflake databases. This tool enables Claude to query Snowflake data without modifying any information, ensuring data integrity and security.

Features

  • Secure Connection: Uses service account authentication with a private key for secure access to Snowflake.
  • MCP Compatibility: Provides MCP-compatible handlers for querying Snowflake data.
  • Read-Only Operations: Enforces read-only operations with security checks to prevent data modification.
  • Python 3.12+ Support: Fully compatible with Python 3.12 and above.
  • Stdio-Based MCP Server: Easy integration with Claude Desktop via stdio communication.

Available Tools

The server offers the following tools for querying Snowflake:
- list_databases: Lists all accessible Snowflake databases.
- list_views: Lists all views in a specified database and schema.
- describe_view: Provides detailed information about a specific view, including columns and SQL definition.
- query_view: Queries data from a view with an optional row limit.
- execute_query: Executes custom read-only SQL queries (SELECT only) with results formatted as markdown tables.

Installation

Prerequisites

  • Python 3.12 or higher.
  • A Snowflake account with a configured service account (username + private key).
  • uv package manager (recommended).

Steps

  1. Clone the repository:
    bash git clone https://github.com/yourusername/mcp-server-snowflake.git cd mcp-server-snowflake
  2. Install the package:
    bash uv pip install -e .
  3. Create a .env file based on .env.example with your Snowflake credentials:
    env SNOWFLAKE_ACCOUNT=youraccount.region SNOWFLAKE_USER=your_service_account_username SNOWFLAKE_PRIVATE_KEY_PATH=/absolute/path/to/your/rsa_key.p8 SNOWFLAKE_WAREHOUSE=your_warehouse SNOWFLAKE_DATABASE=your_database SNOWFLAKE_SCHEMA=your_schema SNOWFLAKE_ROLE=your_role

Usage

Running with uv

After installation, start the server with:

uv run snowflake-mcp

Claude Desktop Integration

  1. In Claude Desktop, go to Settings → MCP Servers.
  2. Add a new server with the full path to your uv executable:
    yaml "snowflake-mcp-server": { "command": "uv", "args": [ "--directory", "/<path-to-code>/mcp-server-snowflake", "run", "snowflake-mcp" ] }
  3. Find your uv path by running which uv in your terminal.
  4. Save the server configuration.

Example Queries

When using with Claude, 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."

Security Considerations

  • Read-Only Enforcement: Only SELECT statements are allowed.
  • Automatic LIMIT Clauses: Prevents large result sets.
  • Service Account Authentication: Ensures secure connections.
  • Input Validation: Prevents SQL injection.

⚠️ Important: Keep your .env file secure and never commit it to version control. The .gitignore file is configured to exclude it.

Development

Static Type Checking

mypy mcp_server_snowflake/

Linting

ruff check .

Formatting

ruff format .

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Technical Details

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.

About

MCP Server for connecting to Snowflake.

Topics

Resources

License

MIT license

Features & Capabilities

Categories
mcp_server model_context_protocol python snowflake claude api_integration read_only sql

Implementation Details

Stats

0 Views
2 GitHub Stars

Repository Info

dynamike Organization

Similar MCP Servers

continuedev_continue by continuedev
25049
21423
9300