All posts

Configuring MCP servers access to Snowflake with just-in-time access

How can you give an MCP server the ability to query Snowflake only when a legitimate request arrives, without handing out permanent credentials? Just-in-time access solves this problem by issuing a short‑lived token that authorizes a single query, then expires. Most organizations solve this by embedding a Snowflake user name and password in the server’s configuration, or by distributing a shared service account across many pipelines. The credentials sit on disk, in environment variables, or in

Free White Paper

Just-in-Time Access + Mean Time to Detect (MTTD): The Complete Guide

Architecture patterns, implementation strategies, and security best practices. Delivered to your inbox.

Free. No spam. Unsubscribe anytime.

How can you give an MCP server the ability to query Snowflake only when a legitimate request arrives, without handing out permanent credentials?

Just-in-time access solves this problem by issuing a short‑lived token that authorizes a single query, then expires.

Most organizations solve this by embedding a Snowflake user name and password in the server’s configuration, or by distributing a shared service account across many pipelines. The credentials sit on disk, in environment variables, or in secret stores that developers can read. Anyone who can reach the server can also reach Snowflake, and every query runs with the same privileged identity. There is no record of who asked for what data, no way to block a dangerous command, and no protection for sensitive columns that should never leave the warehouse.

What teams really need is just-in-time access: a model where the MCP server receives a short‑lived token that authorizes a single query, and the request is evaluated against policy before it touches Snowflake. The request still travels directly to Snowflake, however, so without an enforcement point you still lack audit logs, inline masking, and the ability to require human approval for risky operations.

Why just-in-time access matters for Snowflake

Snowflake stores large volumes of regulated data. When an AI‑driven MCP server can run arbitrary SELECT statements with a static credential, the blast radius of a compromised server is the entire data warehouse. Just-in-time access reduces that risk by limiting the lifespan of the privilege and by tying each request to a verified identity. It also creates a natural checkpoint where policies can be enforced: mask credit‑card numbers, block DROP statements, or route queries that touch PHI to a reviewer.

Introducing hoop.dev as the enforcement boundary

hoop.dev acts as a Layer 7 gateway that sits between the MCP server and Snowflake. The gateway is the only place where enforcement can happen. It verifies the OIDC token presented by the server, reads the user’s group membership, and then decides whether the request may proceed.

Once the request is authorized, hoop.dev forwards it to Snowflake using a credential that the gateway alone knows. The server never sees the Snowflake password or role. Because the gateway sits in the data path, it can apply several enforcement outcomes:

  • Record each session so auditors can replay the exact query and response.
  • Mask sensitive fields in real time, ensuring that credit‑card numbers or SSNs never leave the gateway.
  • Require just-in-time approval for queries that match high‑risk patterns.
  • Block dangerous commands such as DROP DATABASE before they reach Snowflake.

All of these outcomes exist only because hoop.dev is positioned in the path; the setup of identities and roles alone does not provide them.

Continue reading? Get the full guide.

Just-in-Time Access + Mean Time to Detect (MTTD): Architecture Patterns & Best Practices

Free. No spam. Unsubscribe anytime.

How the flow works for an MCP server

1. The organization configures an OIDC provider (Okta, Azure AD, etc.) and registers the MCP server as a client. The server obtains a short‑lived token when it needs to run a query.

2. The server initiates a Snowflake connection through hoop.dev, presenting the token.

3. hoop.dev validates the token, checks the user’s group membership, and applies any just-in-time policy that requires approval.

4. If approved, hoop.dev opens a session to Snowflake using its own service credential. The request passes through the gateway, where inline masking removes any regulated fields from the result set.

5. The gateway streams the filtered response back to the MCP server. Simultaneously it logs the full request, the decision path, and the masked response for later replay.

This architecture ensures that the MCP server never holds permanent Snowflake credentials, that every query is tied to a verified identity, and that policy enforcement happens where it can be trusted.

Getting started

To try this pattern, follow the getting‑started guide for deploying the gateway and configuring an OIDC client. The learn section contains detailed explanations of just-in-time approvals, masking policies, and session replay.

When you are ready to explore the source code or contribute, visit the repository on GitHub: hoop.dev on GitHub.

FAQ

Does this approach require changes to existing Snowflake queries?

No. The MCP server continues to issue standard SQL statements. hoop.dev intercepts the traffic, applies masking and policy, and forwards the request unchanged to Snowflake.

What happens if a query is denied by the gateway?

The server receives an error response that includes the reason for denial. No data is sent to Snowflake, and the event is recorded for audit.

Can I use this model with other data warehouses?

Yes. hoop.dev supports multiple database connectors. The same just-in-time access pattern applies to each supported target.

Open source

Save the open-source gateway for agent data access

Hoop is MIT-licensed infrastructure for controlling how AI agents reach production data. Star hoophq/hoop so you can inspect it, deploy it, or share it when your team starts governing agent access.

Star and save the repo →More posts