# Snowflake MCP

> Snowflake MCP connects your AI client directly to your Snowflake data cloud. Chat with your IDE to run complex SQL queries, map nested schemas across databases and tables, or check compute costs without ever leaving your local codebase.

## Overview
- **Category:** industry-titans
- **Price:** Free
- **Tags:** sql-warehouse, data-cloud, query-execution, schema-mapping, data-warehousing, big-data

## Description

Stop jumping between your code editor and the browser just to look at a table definition. This MCP lets you chat with your agent about your data architecture and get live results. You can ask it to list all available databases, then drill down into schemas or tables—all within the flow of your work. Need to validate a complex join? Tell your bot to execute the SQL query right there, keeping everything native to your AI client. Vinkius hosts this connection, giving your agent deep access to Snowflake's entire data landscape so you can quickly build models and diagnose issues without writing boilerplate setup code.

## Tools

### list_databases
Retrieves a list of every database available within the Snowflake account.

### list_schemas
Shows all schemas contained inside one specific database.

### list_tables
Lists all tables that exist in a given schema.

### execute_sql
Runs a specified SQL query against the Snowflake data cloud, prioritizing read-only statements.

### list_warehouses
Shows all virtual computing warehouses associated with the account.

### list_stages
Lists both internal and external data stages used for data loading.

### get_query_status
Checks the status of a background or asynchronous query that is still running.

## Prompt Examples

**Prompt:** 
```
List all running virtual warehouses I can access in my Snowflake account.
```

**Response:** 
```
I've called `list_warehouses` for your targeted Snowflake footprint.

**Running Clusters Detected**:
1. `COMPUTE_WH` – Size: X-Small | State: SUSPENDED
2. `ANALYTICS_WH` – Size: Large | State: STARTED
3. `ETL_LOAD_WH` – Size: Medium | State: STARTED

Would you like me to run an analytical snippet under `ANALYTICS_WH` now?
```

**Prompt:** 
```
Write a query to grab the top 5 most engaged users from our schema and execute it.
```

**Response:** 
```
No problem! I constructed this query to target exactly that and executed it against the system:
`SELECT user_id, email, activity_score FROM prod_schema.users ORDER BY activity_score DESC LIMIT 5;`

**Snowflake Output Data**:
1. alice@example.com (Score: 980)
2. john84@test.io (Score: 964)
3. m_reyes@corp.com (Score: 941)
[...]

Do you want me to format this as a markdown table or save the dataset?
```

**Prompt:** 
```
Retrieve the schema mapping for the MASTER_DB. I need to know all nested tables before doing table joints.
```

**Response:** 
```
Using `list_schemas`, `MASTER_DB` contains main partitions:
1. `PUBLIC`
2. `ANALYTICS_GOLD`

Digging into `ANALYTICS_GOLD` using `list_tables`:
- `dim_customers` (Type: BASE TABLE)
- `dim_geography` (Type: BASE TABLE)
- `fct_sales_records` (Type: BASE TABLE)
- `vw_live_revenue` (Type: VIEW)

I am ready to help build your exact JOINS. For example, `fct_sales_records.customer_id` directly joins on `dim_customers.id`.
```

## Capabilities

### Audit Data Structures
List all databases, schemas, and tables in the account to map out complex data relationships.

### Run Live Queries
Execute SQL queries directly against your Snowflake instance, allowing for immediate read-only results.

### Track Compute Resources
List and monitor active virtual warehouses to understand current compute costs and usage patterns.

### Diagnose Data Workloads
Check the status of long-running or asynchronous data engineering queries.

## Use Cases

### Diagnosing a Broken ETL Pipeline
An engineer notices a job failed overnight. Instead of checking dashboards, they ask their agent to use `list_warehouses` first. This confirms the compute cluster is active, and then they use `get_query_status` to see exactly why the last run timed out.

### Building a New Data Model
An analytics team needs to join customer data with geo-data. They prompt their agent to first list all schemas and then use `list_tables` to confirm the exact naming conventions before writing any SQL.

### Quickly validating a JOIN
A developer suspects two tables are linking incorrectly. They ask the agent to execute an `execute_sql` query that joins the fields, and the resulting output immediately shows if the join key is missing or wrong.

### Understanding Data Ingestion Paths
A data architect needs to know where raw files are landing. They prompt the agent to `list_stages` to see all internal and external paths, immediately confirming the correct source location for their next script.

## Benefits

- Eliminate context switching. You keep your AI agent and Snowflake data visible in one place, letting you validate commands against the live engine.
- Audit compute costs instantly. Use `list_warehouses` to see exactly which clusters are running, helping control expensive operational overhead.
- Map complex structures easily. Chain tools like `list_databases`, followed by `list_schemas`, and then `list_tables` until you have a full picture of your data lineage.
- Stay current on long jobs. If an ETL pipeline is running for hours, use `get_query_status` to check its progress without guessing.
- Build accurate models. By letting the agent examine table definitions via `list_tables`, you ensure your generated SQL has correct column names and data types.

## How It Works

The bottom line is that your agent handles the complex connectivity details; you just talk to it about your data.

1. Subscribe to this MCP and provide your explicit Snowflake Account identifier (e.g., abc123.us-east-1).
2. Inject your authentication token or JWT key pair string into the connection.
3. Ask your AI client a question, like 'Show me all tables in the Sales schema,' and it runs the command for you.

## Frequently Asked Questions

**How does Snowflake MCP help me with data lineage?**
The MCP lets your agent use a series of listing tools (`list_databases`, `list_schemas`, etc.) to map the deep, hierarchical structure of all available data objects within your account.

**Can I check if my long-running query is still active using Snowflake MCP?**
Yes. You use the `get_query_status` tool to retrieve real-time updates on asynchronous queries, letting you know when they finish or fail.

**What should I do if my compute warehouse is running too high?**
You can run `list_warehouses` through the MCP to see all active clusters and their current status. This helps you manage costs by identifying idle or excessive resources.

**How do I get a full list of tables in Snowflake using this MCP?**
You first use `list_databases` to narrow down the scope, then use `list_schemas`, and finally call `list_tables` within that specific schema to get every table name.

**Does Snowflake MCP require me to know complex SQL syntax?**
No. You tell your agent what you want in plain English, and it constructs the necessary query using the `execute_sql` tool for you.