Back to Guides

How to Connect Snowflake to MCP for AI Agents

Connect Snowflake data warehouse to AI agents via MCP. Query data through Snowflake's SQL API using the AnythingMCP REST connector.

Snowflake Data Access for AI Agents

Snowflake is the leading cloud data warehouse. While AnythingMCP's database connector supports PostgreSQL, MySQL, MariaDB, MSSQL, Oracle, SQLite, and MongoDB natively, you can connect to Snowflake through its SQL API using AnythingMCP's REST connector.

Step-by-Step Guide

Step 1: Deploy AnythingMCP

git clone https://github.com/HelpCode-ai/anythingmcp.git
cd anythingmcp && docker compose up -d

Step 2: Create a REST Connector

Open the AnythingMCP dashboard at http://localhost:3000 and create a new REST connector. Set the base URL to your Snowflake SQL API endpoint (e.g., https://your-account.snowflakecomputing.com/api/v2).

Step 3: Configure Authentication

In the connector settings, configure OAuth 2.0 or Key Pair authentication with your Snowflake credentials.

Step 4: Configure SQL API Endpoints

Set up endpoints for the Snowflake SQL API statements endpoint. This allows AI agents to submit SQL queries and retrieve results through the REST connector.

Step 5: Test and Connect

{
  "mcpServers": {
    "snowflake": {
      "url": "http://localhost:4000/mcp"
    }
  }
}

AI Agent Use Cases

  • "What were total sales by region last quarter?"
  • "Show the top 10 customers by lifetime value"
  • "How does this month's revenue compare to the same period last year?"
  • "List all products with declining sales trend"

Best Practices

  1. Use a dedicated Snowflake role with minimal warehouse and data access
  2. Set query timeouts to prevent runaway warehouse costs
  3. Use warehouse auto-suspend to minimize compute costs
  4. Read-only access — Grant only SELECT privileges to the service account

Next Steps