> ## Documentation Index
> Fetch the complete documentation index at: https://docs.runlayer.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Snowflake

> MCP server for Snowflake integration

<Warning>
  **No longer maintained.** This Runlayer-built connector is deprecated and
  will not receive further updates. Use Snowflake's managed [Cortex Agents MCP server](https://docs.snowflake.com/en/user-guide/snowflake-cortex/cortex-agents-mcp) instead.
</Warning>

Connect your AI assistant to [Snowflake](https://www.snowflake.com) for data warehouse queries and schema exploration. Uses **Snowflake OAuth** for authentication.

<iframe width="560" height="315" src="https://www.youtube.com/embed/0Pm35OoaB7Y" title="Snowflake MCP Server Setup" frameBorder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowFullScreen style={{ width: '100%', borderRadius: '0.5rem' }} />

## Available Tools

| Tool             | Description                                         |
| ---------------- | --------------------------------------------------- |
| `read_query`     | Execute read-only SQL queries against the warehouse |
| `list_databases` | List all accessible databases                       |
| `list_schemas`   | List schemas in a database                          |
| `list_tables`    | List tables in a schema                             |
| `describe_table` | Get column details for a table                      |

## Setup

<Steps>
  <Step title="Create Security Integration">
    Run the following SQL in your Snowflake console. Replace `<your-tenant>` with your Runlayer subdomain:

    <img className="block" src="https://mintcdn.com/anysource/6y8VzDSWjckfUDpB/images/snowflake-setup/snowflake-sql-commands.png?fit=max&auto=format&n=6y8VzDSWjckfUDpB&q=85&s=106e8a7754b1d0460ba6f0405e7bcad7" alt="Snowflake console with SQL commands" width="2528" height="1692" data-path="images/snowflake-setup/snowflake-sql-commands.png" />

    ```sql theme={null}
    CREATE SECURITY INTEGRATION RUNLAYER_SNOWFLAKE_MCP_OAUTH
      TYPE = OAUTH
      ENABLED = TRUE
      OAUTH_CLIENT = CUSTOM
      OAUTH_CLIENT_TYPE = 'CONFIDENTIAL'
      OAUTH_REDIRECT_URI = 'https://<your-tenant>.runlayer.com/oauth/callback'
      OAUTH_ISSUE_REFRESH_TOKENS = TRUE
      OAUTH_REFRESH_TOKEN_VALIDITY = 86400
      OAUTH_ALLOW_NON_TLS_REDIRECT_URI = FALSE;

    -- Keep default blocked roles for security
    ALTER SECURITY INTEGRATION RUNLAYER_SNOWFLAKE_MCP_OAUTH
      SET BLOCKED_ROLES_LIST = ('ACCOUNTADMIN', 'SECURITYADMIN', 'ORGADMIN');
    ```

    <Warning>
      **Security Note**: Never set `BLOCKED_ROLES_LIST` to empty. Always block at minimum `ACCOUNTADMIN`, `SECURITYADMIN`, and `ORGADMIN` to prevent OAuth tokens from having administrative access.
    </Warning>
  </Step>

  <Step title="Get OAuth Credentials">
    Run this SQL to get your credentials:

    ```sql theme={null}
    SELECT SYSTEM$SHOW_OAUTH_CLIENT_SECRETS('RUNLAYER_SNOWFLAKE_MCP_OAUTH');
    ```

    Copy the `OAUTH_CLIENT_ID` and `OAUTH_CLIENT_SECRET` from the result.

    <img className="block" src="https://mintcdn.com/anysource/6y8VzDSWjckfUDpB/images/snowflake-setup/snowflake-oauth-credentials.png?fit=max&auto=format&n=6y8VzDSWjckfUDpB&q=85&s=b46b6605405b914b8f5c356d305dca2b" alt="Snowflake OAuth credentials output" width="2528" height="1692" data-path="images/snowflake-setup/snowflake-oauth-credentials.png" />
  </Step>

  <Step title="Add Server in Runlayer">
    1. In Runlayer, go to **My connectors**, find **Snowflake**, and click **Add connector**

    <img className="block" src="https://mintcdn.com/anysource/6y8VzDSWjckfUDpB/images/snowflake-setup/catalog-snowflake.png?fit=max&auto=format&n=6y8VzDSWjckfUDpB&q=85&s=2f22acb9d992909b4fb1e5c7d1640878" alt="Runlayer connectors page showing Snowflake MCP server" width="2528" height="1692" data-path="images/snowflake-setup/catalog-snowflake.png" />

    2. Enter:
       * **SNOWFLAKE\_ACCOUNT**: Your account identifier (e.g., `SNFKACCT-EL36949`)
       * **SNOWFLAKE\_HOST**: Your Snowflake host (e.g., `snfkacct-el36949.snowflakecomputing.com`)
       * **SNOWFLAKE\_OAUTH\_CLIENT\_ID**: Client ID from Step 2
       * **SNOWFLAKE\_OAUTH\_CLIENT\_SECRET**: Client Secret from Step 2
       * **SNOWFLAKE\_WAREHOUSE**: Default warehouse (e.g., `COMPUTE_WH`)
    3. Click **Deploy Server**

    <img className="block" src="https://mintcdn.com/anysource/6y8VzDSWjckfUDpB/images/snowflake-setup/server-configuration-form.png?fit=max&auto=format&n=6y8VzDSWjckfUDpB&q=85&s=8c167a405fc5e9ff371a378e91547c2c" alt="Snowflake server configuration form" width="2528" height="1692" data-path="images/snowflake-setup/server-configuration-form.png" />
  </Step>

  <Step title="Authorize">
    1. Click **Connect** on the server page

    <img className="block" src="https://mintcdn.com/anysource/6y8VzDSWjckfUDpB/images/snowflake-setup/server-missing-auth.png?fit=max&auto=format&n=6y8VzDSWjckfUDpB&q=85&s=a84edba64b8cda2d988304222c40d642" alt="Snowflake server with Missing auth status" width="2528" height="1692" data-path="images/snowflake-setup/server-missing-auth.png" />

    2. Log in with your Snowflake credentials

    <img className="block" src="https://mintcdn.com/anysource/6y8VzDSWjckfUDpB/images/snowflake-setup/snowflake-oauth-login.png?fit=max&auto=format&n=6y8VzDSWjckfUDpB&q=85&s=78bed6978a110a2d528f1c295330f655" alt="Snowflake OAuth login page" width="1296" height="1640" data-path="images/snowflake-setup/snowflake-oauth-login.png" />

    3. Review permissions and click **Allow**

    <Note>
      Each user will need to complete this authorization process with their own Snowflake credentials. This ensures that queries run with each user's individual permissions.
    </Note>
  </Step>

  <Step title="Test the Connection">
    In your MCP client, try asking:

    > "Show me who am I using the Snowflake MCP"

    The agent will run a query and return your connected user details.

    <img className="block" src="https://mintcdn.com/anysource/6y8VzDSWjckfUDpB/images/snowflake-setup/cursor-test-connection.png?fit=max&auto=format&n=6y8VzDSWjckfUDpB&q=85&s=a22dc93c49462b26de12c2c44a47787c" alt="Cursor showing Snowflake connection test results" width="2526" height="1684" data-path="images/snowflake-setup/cursor-test-connection.png" />
  </Step>
</Steps>

## Configuration Reference

**Required:**

| Variable                        | Description                                                         |
| ------------------------------- | ------------------------------------------------------------------- |
| `SNOWFLAKE_ACCOUNT`             | Account identifier (e.g., `SNFKACCT-EL3694` or `myorg-account_xyz`) |
| `SNOWFLAKE_HOST`                | Snowflake host (e.g., `myorg-account_xyz.snowflakecomputing.com`)   |
| `SNOWFLAKE_OAUTH_CLIENT_ID`     | OAuth client ID from security integration                           |
| `SNOWFLAKE_OAUTH_CLIENT_SECRET` | OAuth client secret from security integration                       |
| `SNOWFLAKE_WAREHOUSE`           | Default warehouse for queries                                       |

**Optional:**

| Variable         | Description                                          |
| ---------------- | ---------------------------------------------------- |
| `SNOWFLAKE_ROLE` | Default role for OAuth scopes (defaults to `PUBLIC`) |

### Account vs Host

* **SNOWFLAKE\_ACCOUNT**: Account identifier, required for OAuth URL construction (e.g., `SNFKACCT-EL3694`)
* **SNOWFLAKE\_HOST**: Snowflake hostname — use default (`{account}.snowflakecomputing.com`) or custom for proxy/private endpoints

## Updating Configuration

After initial deployment, you can update configuration options via CLI:

```bash theme={null}
# Pull existing configuration
uvx runlayer deploy pull --deployment-id <deployment-id>

# Edit runlayer.yaml locally

# Deploy updated configuration
uvx runlayer deploy
```

## Troubleshooting

<Accordion title="Invalid account identifier">
  Check your Snowflake URL for the correct format. For regional accounts, include the region (e.g., `abc12345.us-east-1`).
</Accordion>

<Accordion title="Redirect URI mismatch">
  Verify the `OAUTH_REDIRECT_URI` in your security integration matches exactly: `https://<your-tenant>.runlayer.com/oauth/callback` (no trailing slash).
</Accordion>

<Accordion title="Warehouse not found">
  Ensure the role you authorized has `USAGE` privilege on the warehouse: `GRANT USAGE ON WAREHOUSE <name> TO ROLE <role>;`
</Accordion>

<Accordion title="Blocked role error">
  Remove the role from `BLOCKED_ROLES_LIST` or choose a different role during authorization.
</Accordion>
