Sitemap
Prabhakaran Rajagopalan

Prabhakaran Rajagopalan

Integrating LLM-Powered AI Tools (Claude AI, Claude Code, Claude Desktop, Cursor, and ChatGPT) with Snowflake Using the MCP Server: A Complete Guide

3 min readJan 14, 2026

--

Introduction:

Integrating Claude/Cursor AI with Snowflake using the Model Context Protocol (MCP) empowers enterprises to enable secure, natural language–driven data interactions. While Large Language Models (LLMs) are reshaping how organizations explore, analyze, and act on data, connecting them to enterprise platforms has often been complex, brittle, and difficult to secure. MCP addresses these challenges by introducing a standardized, secure, and scalable interface for AI-to-data connectivity.

In this guide, you’ll learn how to deploy a production-ready Snowflake MCP Server, connect Claude AI to enterprise data using natural language queries, and ensure robust security, governance, and performance across the entire workflow.

Snowflake currently supports the following tool types:

  • CORTEX_SEARCH_SERVICE_QUERY: Cortex Search Service tool
  • CORTEX_ANALYST_MESSAGE: Cortex Analyst tool
  • SYSTEM_EXECUTE_SQL: SQL execution
  • CORTEX_AGENT_RUN: Cortex Agent tool
  • GENERIC: tool for UDFs and stored procedures

Step-by-Step Implementation:

Database and Warehouse Setup:

-- Create primary database for MCP operations
CREATE DATABASE IF NOT EXISTS TEST_MCP_DB;

-- Create schema for MCP server definitions
CREATE SCHEMA IF NOT EXISTS TEST_MCP_DB.DATA;

-- Create dedicated warehouse for MCP query execution
CREATE WAREHOUSE IF NOT EXISTS TEST_MCP_WH
WAREHOUSE_SIZE = SMALL
AUTO_SUSPEND = 60
AUTO_RESUME = TRUE;

-- Set context
USE TEST_MCP_DB.DATA;

OAuth Security Integration

-- Create OAuth security integration
CREATE SECURITY INTEGRATION CLAUDE_OAUTH_INTEGRATION
TYPE = OAUTH
ENABLED = TRUE
OAUTH_CLIENT = CUSTOM
OAUTH_CLIENT_TYPE = 'CONFIDENTIAL'
OAUTH_REDIRECT_URI = 'https://claude.ai/api/mcp/auth_callback'
OAUTH_ISSUE_REFRESH_TOKENS = TRUE
OAUTH_REFRESH_TOKEN_VALIDITY = 7776000 -- 90 days
OAUTH_ENFORCE_PKCE = FALSE;

Retrieve your credentials (store these securely):

SELECT SYSTEM$SHOW_OAUTH_CLIENT_SECRETS('CLAUDE_OAUTH_INTEGRATION');

This returns:
OAUTH_CLIENT_ID: Your client identifier
OAUTH_CLIENT_SECRET: Your client secret (show only once!)
Security best practice: Never hardcode these values. Use secure secret management systems in production environments.

Role-Based Access Control

-- Create specialized role for AI analyst operations
CREATE ROLE IF NOT EXISTS SF_AI_ANALYST_FR;

-- Grant database and schema permissions
GRANT USAGE ON DATABASE TEST_MCP_DB TO ROLE SF_AI_ANALYST_FR;
GRANT USAGE ON SCHEMA TEST_MCP_DB.DATA TO ROLE SF_AI_ANALYST_FR;

-- Grant object creation permissions
GRANT CREATE TABLE, CREATE VIEW, CREATE FUNCTION, CREATE PROCEDURE
ON SCHEMA TEST_MCP_DB.DATA TO ROLE SF_AI_ANALYST_FR;

-- Grant data access permissions
GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES
IN SCHEMA TEST_MCP_DB.DATA TO ROLE SF_AI_ANALYST_FR;

-- Grant permissions on future tables
GRANT SELECT, INSERT, UPDATE, DELETE ON FUTURE TABLES
IN SCHEMA TEST_MCP_DB.DATA TO ROLE SF_AI_ANALYST_FR;

-- Assign role to user
GRANT ROLE SF_AI_ANALYST_FR TO USER "your_username";

MCP Server Configuration:

Get Prabhakaran Rajagopalan’s stories in your inbox

Join Medium for free to get updates from this writer.

The MCP Server definition specifies which tools Claude can access. Snowflake supports four primary tool categories:

CREATE OR REPLACE MCP SERVER TEST_MCP_SERVER FROM SPECIFICATION
$$
tools:
# Semantic Views for Natural Language Queries
- title: "Data Mart"
name: "data-mart-semantic-view"
type: "CORTEX_ANALYST_MESSAGE"
identifier: "TEST_MCP_DB.DATA.CT_SEMANTIC_VIEW"
description: "Semantic view for contract data analysis"

- title: "Revenue Analytics"
name: "revenue-semantic-view"
type: "CORTEX_ANALYST_MESSAGE"
identifier: "TEST_MCP_DB.DATA.REVENUE_SEMANTIC_VIEW"
description: "Semantic view for revenue analysis and forecasting"

# Search Services
- title: "Product Search"
name: "product-search-service"
type: "CORTEX_SEARCH_SERVICE_QUERY"
identifier: "TEST_MCP_DB.PRODUCTS.PRODUCT_SEARCH_SERVICE"
description: "Full-text search across all products"

# SQL Execution
- title: "SQL Execution Tool"
name: "sql_exec_tool"
type: "SYSTEM_EXECUTE_SQL"
description: "Execute custom SQL queries with governed permissions"

# Intelligent Agents
- title: "Sales Intelligence Agent"
name: "sales_marketing_agent"
type: "CORTEX_AGENT_RUN"
identifier: "SNOWFLAKE_INTELLIGENCE.AGENTS.SALES_AGENT"
description: "AI agent providing sales insights and recommendations"
$$;
GRANT USAGE ON MCP SERVER TEST_MCP_SERVER TO ROLE SF_AI_ANALYST_FR;
GRANT USAGE ON MCP SERVER TEST_MCP_SERVER TO ROLE SF_AI_ANALYST_FR;

Connecting Claude AI and Snowflake MCP server:

Prerequisites

  • Claude Admin access
  • OAuth Client ID and Secret
  • MCP Server URL from Snowflake

Getting Your MCP Server URL

#Your URL follows this pattern:
https://<account>.<region>.snowflakecomputing.com/api/v2/databases/<DB>/schemas/<SCHEMA>/mcp-servers/<SERVER_NAME>

#Example:
https://xy12345.west-us-2.azure.snowflakecomputing.com/api/v2/databases/TEST_MCP_DB/schemas/DATA/mcp-servers/TEST_MCP_SERVER
Getting Your MCP Server URL
Your URL follows this pattern:
https://<account>.<region>.snowflakecomputing.com/api/v2/databases/<DB>/schemas/<SCHEMA>/mcp-servers/<SERVER_NAME>
Example:
https://xy12345.west-us-2.azure.snowflakecomputing.com/api/v2/databases/TEST_MCP_DB/schemas/DATA/mcp-servers/TEST_MCP_SERVER
Connection Steps
Navigate to Claude Settings


Open Claude Desktop or Web UI
Go to: Settings → Connectors → Browse Connectors
Add Snowflake Connector


Click Snowflake → Add to your Team
Enter your MCP Server URL
Paste OAuth Client ID and Secret
Click Configure
Authorize Tools


Review available tools
Grant access to desired semantic views and services
Save configuration

Connection Steps

  1. Log in to Claude Desktop or Web UI
  2. Navigate to Account Settings → Connectors → Browse Connectors → Snowflake→ Add to your Team →
  3. Execute SELECT SYSTEM$SHOW_OAUTH_CLIENT_SECRETS(‘CLAUDE_OAUTH_INTEGRATION’); to get the client and Secret :
  4. Enter OAuth Client ID and Secret
  5. Click Configure and authorize access
  6. Select the tools to grant Claude access

Security best practice: Never hardcode these values. Use secure secret management systems in production environments.

--

--