Skip to content
Datablare
Guides

How to Connect Claude to Snowflake, Safely

Connect Claude to Snowflake over MCP with a key-pair service user, a read-only role and its own warehouse, plus a record of every query it runs.

Published 6 min read
On this page
  1. How Claude talks to Snowflake
  2. Step 1: Create a role that can only read
  3. Step 2: Give it a warehouse and a credit ceiling
  4. Step 3: Create a service user that signs in with a key pair
  5. Step 4: Decide what the MCP server must refuse
  6. Step 5: Add it to Claude
  7. The Datablare route
  8. Limits worth knowing
  9. Get started

To connect Claude to Snowflake safely, give Claude an MCP server that signs in to Snowflake as a dedicated service user, with a role that can only SELECT the tables it needs and a small warehouse of its own. Then add that server to Claude as a custom connector. Snowflake has no read-only session, so the server must also refuse anything that is not a single read, and roll back every session. This guide covers the Snowflake side (role, warehouse, credit limit, key pair), what the MCP server has to do, and the Claude side, with a do-it-yourself route and the Datablare route.

How Claude talks to Snowflake

Claude does not open database connections. It calls tools through MCP (Model Context Protocol), the open standard for connecting AI tools to outside systems. A Snowflake MCP server offers a tool such as “run this query”. Claude writes SQL, the server runs it in Snowflake with its own credentials, and the rows come back into the conversation.

So the real question is what the MCP server lets Claude do. Everything below draws that line: which role, which warehouse, which tables, and what happens when Claude writes something other than a read.

Step 1: Create a role that can only read

Start in Snowflake with a role that has USAGE on one database and its schemas, and SELECT on its tables and views. Nothing else.

CREATE ROLE DATABLARE_READER;

GRANT USAGE ON DATABASE ANALYTICS TO ROLE DATABLARE_READER;
GRANT USAGE ON ALL SCHEMAS IN DATABASE ANALYTICS TO ROLE DATABLARE_READER;
GRANT SELECT ON ALL TABLES IN DATABASE ANALYTICS TO ROLE DATABLARE_READER;
GRANT SELECT ON ALL VIEWS IN DATABASE ANALYTICS TO ROLE DATABLARE_READER;
GRANT SELECT ON FUTURE TABLES IN DATABASE ANALYTICS TO ROLE DATABLARE_READER;

Replace ANALYTICS with your database. To narrow it further, grant single schemas or tables instead of the whole database. Never connect Claude as ACCOUNTADMIN, SYSADMIN, SECURITYADMIN or a person’s own default role: whatever the role can do, a misread instruction can do too.

To keep a column such as an email address or a salary out entirely, attach a masking policy to it, or create a view without it and grant the view instead of the table. Snowflake enforces both on every query the role runs, whichever tool sent it.

Step 2: Give it a warehouse and a credit ceiling

Every Snowflake query runs on a warehouse, and a running warehouse uses credits. An agent that loops over large scans can spend more than you expect. Give Claude its own extra-small warehouse that suspends itself after a minute without work, stops any statement after 60 seconds, and sits under a resource monitor:

CREATE WAREHOUSE DATABLARE_WH
  WAREHOUSE_SIZE = XSMALL
  AUTO_SUSPEND = 60
  AUTO_RESUME = TRUE
  STATEMENT_TIMEOUT_IN_SECONDS = 60;

CREATE RESOURCE MONITOR DATABLARE_MONITOR
  WITH CREDIT_QUOTA = 20 FREQUENCY = MONTHLY START_TIMESTAMP = IMMEDIATELY
  TRIGGERS ON 80 PERCENT DO NOTIFY
           ON 100 PERCENT DO SUSPEND;

ALTER WAREHOUSE DATABLARE_WH SET RESOURCE_MONITOR = DATABLARE_MONITOR;
GRANT USAGE ON WAREHOUSE DATABLARE_WH TO ROLE DATABLARE_READER;

The 20-credit monthly quota is an example: set it to what you are willing to spend. A warehouse of its own also keeps Claude’s questions from queueing behind your pipelines and dashboards, and makes its cost easy to see on its own line.

Step 3: Create a service user that signs in with a key pair

Create the user with TYPE = SERVICE. A service user cannot sign in with a password at all, only with a key pair, and Snowflake marks it as a machine login rather than a person.

Generate the key pair with OpenSSL:

openssl genrsa 2048 | openssl pkcs8 -topk8 -inform PEM -out rsa_key.p8 -nocrypt
openssl rsa -in rsa_key.p8 -pubout -out rsa_key.pub

rsa_key.p8 is the private key: keep it secret. Paste the contents of rsa_key.pub, without the BEGIN and END lines, into the user:

CREATE USER DATABLARE TYPE = SERVICE
  DEFAULT_ROLE = DATABLARE_READER
  DEFAULT_WAREHOUSE = DATABLARE_WH
  RSA_PUBLIC_KEY = 'MIIBIjANBgkqh...';
GRANT ROLE DATABLARE_READER TO USER DATABLARE;

If your account limits sign-in by IP address with a network policy, allow the address your MCP server connects from.

Step 4: Decide what the MCP server must refuse

This is where Snowflake differs from PostgreSQL or MySQL. Snowflake has no read-only session, so the role from step 1 is the only thing inside Snowflake that stops a write. A good Snowflake MCP server adds more:

  • Accept only a single read. One SELECT, WITH or VALUES statement. Refuse DDL and DML, several statements in one call, and SYSTEM$ functions: some of them cancel queries or change account state from inside an ordinary SELECT.
  • Roll back every session. Run with autocommit off and roll back before the connection closes, so a change that slipped through cannot survive. Snowflake commits before any DDL statement, so DDL has to be refused before it runs; rolling back afterwards is too late.
  • Show only the tables you chose. And refuse hidden columns even when Claude names them directly.
  • Record who asked. Snowflake’s query history shows the service user, not which colleague’s question caused the query. Keep your own record of the person, the question and the SQL.

Step 5: Add it to Claude

Claude adds remote MCP servers as custom connectors. In the Claude app or on claude.ai, open Settings → Connectors, choose Add custom connector, paste the server’s URL and click Add, then Connect. Custom connectors need one of Claude’s paid plans. On Claude Team or Enterprise, an owner can add the connector once for the whole organization.

You can also run an open-source Snowflake MCP server on your own computer and point Claude Desktop at it. That works for one person, but the private key then sits in a config file on a laptop, and nobody else can see what was asked.

The Datablare route

Datablare is a remote MCP server that does steps 4 and 5 for you, and gives you the SQL for steps 1 to 3 with your database name filled in. Once the role, warehouse and user exist in Snowflake:

  1. Add Snowflake as a data source. In Settings → Project → Data connection, add a data source and pick Snowflake. Enter the account identifier (in Snowsight under Admin → Accounts, the part before .snowflakecomputing.com, usually orgname-accountname), the username DATABLARE, the warehouse and the database. Schema and role are optional. If you use a network policy, allow the IP address shown on the setup screen.
  2. Sign in with the key pair. Choose Key pair (recommended) and paste the private key from rsa_key.p8. It is stored encrypted, like a password, and never shown again.
  3. Test and choose tables. The connection test shows the Snowflake version, database and warehouse, and warns you if the role is ACCOUNTADMIN, SYSADMIN, SECURITYADMIN or ORGADMIN. Then pick the tables Claude may query, and hide any columns it should not see.
  4. Connect Claude. Open Connect your AI agent, pick Claude and copy the link. In Claude, add it under Settings → Connectors → Add custom connector, click Connect, sign in to Datablare and choose Allow. There is no password or key to paste into Claude.
  5. Ask a question. Try “Using Datablare, what was revenue by month for the last year?”, then open Audit in Datablare to see the question and the SQL that answered it.

What Datablare does on Snowflake

  • Guard first. Only a single read is accepted. DDL, DML, SYSTEM$ functions and account functions such as CURRENT_ACCOUNT are refused before anything reaches Snowflake.
  • Rolled-back sessions. Autocommit is off, and every session is rolled back before it closes.
  • Your role and your warehouse. Queries run as the role and on the warehouse you entered, so your resource monitor stays the credit ceiling.
  • Each person signs in. Everyone who connects Claude signs in with their own Datablare account, sees only what they have been given, and is named in Audit next to their question and SQL.
  • Easy to find in Snowflake. Every session carries the query tag datablare and the application name Datablare, so you can filter query history for them.
  • Results never stored. Rows pass through to Claude and are not kept by Datablare.

More on the Snowflake page and the Claude page.

Limits worth knowing

  • One database per data source. A Snowflake source points at one database. To use two, add two sources to the same project: Claude still uses one link and can answer questions that span both.
  • Claude sees the rows it asks for. Results go to Claude under Anthropic’s terms. Keep columns you do not want any AI provider to see out of reach with a masking policy, a view, or a hidden column in Datablare.
  • Names are upper case. Unquoted Snowflake names are stored in upper case, so tables appear as SCHEMA.TABLE. Descriptions your team writes in Datablare’s Modeling page help Claude pick the right table.
  • Big scans take time. With a 60-second statement timeout, a question that has to scan billions of rows will be stopped. Point Claude at aggregated tables or views where you have them.

Get started

Create a free account, connect your Snowflake database (or try the one-click e-commerce sample first), and add Claude in a few minutes. Plans are on the pricing page.

Frequently asked questions

Can Claude connect directly to Snowflake?

Not by itself. Claude reaches databases through MCP servers, which it calls as tools. You use an MCP server that holds the Snowflake connection, then add it to Claude as a custom connector (remote, over HTTPS) or run it locally for the Claude desktop app.

Should Claude sign in to Snowflake with a password or a key pair?

A key pair. Create the login as a TYPE = SERVICE user, which cannot use a password at all, and give the MCP server the private key. Keep the key out of config files on laptops: a remote MCP server stores it once, encrypted.

Do Claude's queries use Snowflake credits?

Yes. They run on the warehouse the MCP server connects with. Give Claude its own extra-small warehouse with auto-suspend, a statement timeout and a resource monitor, so its usage has a ceiling you set and shows on its own line.

Can Claude change or delete data in Snowflake?

Not through Datablare. Its SQL guard accepts only a single read and refuses DDL, DML and SYSTEM$ functions, and every session runs with autocommit off and is rolled back before it closes. A role with only USAGE and SELECT is a third layer you hold yourself.

How do I find Claude's queries in Snowflake?

Datablare sets the query tag datablare on every session, so you can filter for them, for example with QUERY_TAG = 'datablare' in SNOWFLAKE.ACCOUNT_USAGE.QUERY_HISTORY. Datablare's own Audit adds who asked and the question behind each query.

Keep reading

Give your team answers, not database logins.

Start free with the e-commerce sample or your own database. Connect Claude in about two minutes.

30 minutes with the founder. Or WhatsApp / [email protected]