> ## 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.

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

> [!NOTE]
>
> For an agent that runs with no user signed in (a schedule, a webhook, your own service), see [Autonomous agent to Snowflake as a service user](https://docs.runlayer.com/cookbook-agent-accounts.md#snowflake-service-user).

[Snowflake MCP Server Setup](https://www.youtube.com/embed/0Pm35OoaB7Y)

## 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

**1. Create Security Integration**

Run the following SQL in your Snowflake console. Replace `<your-tenant>` with your Runlayer subdomain:

![Snowflake console with SQL commands](https://mintcdn.com/anysource/6y8VzDSWjckfUDpB/images/snowflake-setup/snowflake-sql-commands.png?fit=max\&auto=format\&n=6y8VzDSWjckfUDpB\&q=85\&s=106e8a7754b1d0460ba6f0405e7bcad7)

```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.

**2. 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.

![Snowflake OAuth credentials output](https://mintcdn.com/anysource/6y8VzDSWjckfUDpB/images/snowflake-setup/snowflake-oauth-credentials.png?fit=max\&auto=format\&n=6y8VzDSWjckfUDpB\&q=85\&s=b46b6605405b914b8f5c356d305dca2b)

**3. Add Server in Runlayer**

1. In Runlayer, go to **Connectors**, find **Snowflake**, and click **Add connector**

![Runlayer connectors page showing Snowflake MCP server](https://mintcdn.com/anysource/Ej18r8lFyFGBNupo/images/snowflake-setup/catalog-snowflake.png?fit=max\&auto=format\&n=Ej18r8lFyFGBNupo\&q=85\&s=d89f23c8b4ba93d88aad1ff0ef057a97)

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**

![Snowflake server configuration form](https://mintcdn.com/anysource/6y8VzDSWjckfUDpB/images/snowflake-setup/server-configuration-form.png?fit=max\&auto=format\&n=6y8VzDSWjckfUDpB\&q=85\&s=8c167a405fc5e9ff371a378e91547c2c)

**4. Authorize**

1. Click **Connect** on the server page

![Snowflake server with Missing auth status](https://mintcdn.com/anysource/Ej18r8lFyFGBNupo/images/snowflake-setup/server-missing-auth.png?fit=max\&auto=format\&n=Ej18r8lFyFGBNupo\&q=85\&s=0d66f27e056cbac9f9748bdd1ca7d549)

2. Log in with your Snowflake credentials

![Snowflake OAuth login page](https://mintcdn.com/anysource/6y8VzDSWjckfUDpB/images/snowflake-setup/snowflake-oauth-login.png?fit=max\&auto=format\&n=6y8VzDSWjckfUDpB\&q=85\&s=78bed6978a110a2d528f1c295330f655)

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.

**5. 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.

![Cursor showing Snowflake connection test results](https://mintcdn.com/anysource/6y8VzDSWjckfUDpB/images/snowflake-setup/cursor-test-connection.png?fit=max\&auto=format\&n=6y8VzDSWjckfUDpB\&q=85\&s=a22dc93c49462b26de12c2c44a47787c)

## 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] Invalid account identifier
>
> Check your Snowflake URL for the correct format. For regional accounts, include the region (e.g., `abc12345.us-east-1`).

> [accordion] 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] Warehouse not found
>
> Ensure the role you authorized has `USAGE` privilege on the warehouse: `GRANT USAGE ON WAREHOUSE <name> TO ROLE <role>;`

> [accordion] Blocked role error
>
> Remove the role from `BLOCKED_ROLES_LIST` or choose a different role during authorization.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.