企业级数据AI连接中枢
简介
Snowflake官方MCP连接指南,帮助用户快速配置Snowflake托管MCP服务器与Clawdbot等客户端的集成,实现安全的数据查询与AI能力调用。
原始描述
Connect to the Snowflake Managed MCP server with Clawdbot or other MCP clients. Use when wiring Snowflake MCP endpoints, validating connectivity, or configuring Cortex AI services.
通过你的 Agent 添加
安装目录:snowflake-mcp/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。
点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。
或者手动安装
包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可;
目录名不用换,也不要把包直接解压到 skills 根目录。
技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。
中文使用说明 来自收录源
核心用法
snowflake-mcp是一个纯文档型Skill,专注于指导用户完成Snowflake Managed MCP服务器的配置与连接。核心流程包括:创建Programmatic Access Token (PAT)获取身份凭证、在Snowflake中创建MCP服务器定义、通过curl测试连接、配置Clawdbot的mcp.json文件,最终验证工具可用性。Skill提供了从基础SQL执行到完整功能(Cortex Search向量检索、Cortex Analyst语义分析、Cortex Agent智能体、自定义存储过程)的多种配置模板,用户可根据业务场景灵活选择。
显著优点
企业级安全治理:完全继承Snowflake原生RBAC权限体系,数据访问策略与现有账户一致,无需额外安全架构。零基础设施负担:无需部署本地服务器,直接调用Snowflake托管端点,降低运维复杂度。AI能力即插即用:原生集成Cortex AI服务栈,支持RAG检索增强生成、自然语言数据分析、智能体编排等前沿能力。标准化协议兼容:基于MCP(Model Context Protocol)开放标准,可对接任意兼容客户端,避免供应商锁定。灵活扩展机制:通过GENERIC类型支持自定义存储过程和函数,满足个性化业务需求。
潜在缺点与局限性
账户权限门槛高:创建MCP服务器需要ACCOUNTADMIN角色,普通开发者需协调管理员资源。PAT令牌管理复杂:令牌不评估次级角色,权限变更需重新创建令牌,且存在过期风险。网络配置敏感:账户标识符格式要求严格(连字符vs下划线),SSL错误频发。功能依赖云服务:完全依赖Snowflake云可用性,离线环境或网络受限场景无法使用。调试工具有限:错误信息主要依赖HTTP状态码,复杂问题需结合Snowflake日志分析。
适合的目标群体
数据工程师与分析师:需要快速将Snowflake数据接入AI工作流,构建自然语言查询界面。企业AI架构师:寻求在现有Snowflake投资基础上扩展生成式AI能力,避免数据迁移风险。MCP生态开发者:希望将Snowflake作为数据源集成到Claude、Clawdbot等MCP客户端应用中。Snowflake平台管理员:负责为组织内部用户开通和配置MCP访问权限。
使用风险
配置错误导致的数据暴露:若RBAC配置不当,可能通过SQL执行工具越权访问敏感数据。凭证泄露风险:PAT令牌若硬编码或误提交至版本控制,可导致账户被恶意利用。性能与成本不可控:复杂Cortex查询可能消耗大量计算资源,缺乏本地缓存机制。供应商锁定加深:深度集成Snowflake生态后,迁移至其他数据平台成本显著增加。AI输出可靠性:Cortex Analyst和Agent的自然语言理解存在幻觉风险,关键决策需人工复核。
技能正文
name: snowflake-mcp
description: Connect to the Snowflake Managed MCP server with Clawdbot or other MCP clients. Use when wiring Snowflake MCP endpoints, validating connectivity, or configuring Cortex AI services.
Snowflake MCP Connection
Use this skill to integrate the Snowflake Managed MCP server with Clawdbot. It covers endpoint creation, authentication, and tool validation so Snowflake data can be accessed through MCP.
Quick Start
Prerequisites
- Snowflake account with ACCOUNTADMIN role
- Programmatic Access Token (PAT) from Snowflake
- Clawdbot or any MCP-compatible client
Step 1: Create Programmatic Access Token (PAT)
- In Snowsight, go to your user menu → My Profile
- Select Programmatic Access Tokens
- Click Create Token for your role
- Copy and save the token securely
Step 2: Create MCP Server in Snowflake
Run this SQL in a Snowsight worksheet to create your MCP server:
CREATE OR REPLACE MCP SERVER my_mcp_server FROM SPECIFICATION
$$
tools:
- name: "SQL Execution Tool"
type: "SYSTEM_EXECUTE_SQL"
description: "Execute SQL queries against the Snowflake database."
title: "SQL Execution Tool"
$$;
Step 3: Test the Connection
Verify with curl (replace placeholders):
curl -X POST "https://YOUR-ORG-YOUR-ACCOUNT.snowflakecomputing.com/api/v2/databases/YOUR_DB/schemas/YOUR_SCHEMA/mcp-servers/my_mcp_server" \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header "Authorization: Bearer YOUR-PAT-TOKEN" \
--data '{
"jsonrpc": "2.0",
"id": 12345,
"method": "tools/list",
"params": {}
}'
Step 4: Configure Clawdbot
Create mcp.json at your project root (this is the MCP configuration Clawdbot can load for a session):
{
"mcpServers": {
"Snowflake MCP Server": {
"url": "https://YOUR-ORG-YOUR-ACCOUNT.snowflakecomputing.com/api/v2/databases/YOUR_DB/schemas/YOUR_SCHEMA/mcp-servers/my_mcp_server",
"headers": {
"Authorization": "Bearer YOUR-PAT-TOKEN"
}
}
}
}
Start a new Clawdbot session and load mcp.json so the MCP connection is active. The Snowflake tools should appear in your session.
Step 5: Verify in Clawdbot
- Start a new Clawdbot session
- Load
mcp.json for the session
- Ask a question that triggers Snowflake tools (for example, a SQL query)
MCP Server Examples
Basic SQL Execution Only
CREATE OR REPLACE MCP SERVER sql_mcp_server FROM SPECIFICATION
$$
tools:
- name: "SQL Execution Tool"
type: "SYSTEM_EXECUTE_SQL"
description: "Execute SQL queries against Snowflake."
title: "SQL Execution"
$$;
With Cortex Search (RAG)
mcp.json for the sessionBasic SQL Execution Only
CREATE OR REPLACE MCP SERVER sql_mcp_server FROM SPECIFICATION
$$
tools:
- name: "SQL Execution Tool"
type: "SYSTEM_EXECUTE_SQL"
description: "Execute SQL queries against Snowflake."
title: "SQL Execution"
$$;
First create a Cortex Search service in Snowsight (AI & ML → Cortex Search), then:
CREATE OR REPLACE MCP SERVER search_mcp_server FROM SPECIFICATION
$$
tools:
- name: "Document Search"
identifier: "MY_DB.MY_SCHEMA.MY_SEARCH_SERVICE"
type: "CORTEX_SEARCH_SERVICE_QUERY"
description: "Search and retrieve information from documents using vector search."
title: "Document Search"
- name: "SQL Execution Tool"
type: "SYSTEM_EXECUTE_SQL"
description: "Execute SQL queries."
title: "SQL Execution"
$$;
With Cortex Analyst (Semantic Views)
First upload a semantic YAML or create a Semantic View, then:
CREATE OR REPLACE MCP SERVER analyst_mcp_server FROM SPECIFICATION
$$
tools:
- name: "Sales Analytics"
identifier: "MY_DB.MY_SCHEMA.SALES_SEMANTIC_VIEW"
type: "CORTEX_ANALYST_MESSAGE"
description: "Query sales metrics and KPIs using natural language."
title: "Sales Analytics"
- name: "SQL Execution Tool"
type: "SYSTEM_EXECUTE_SQL"
description: "Execute SQL queries."
title: "SQL Execution"
$$;
With Cortex Agent
CREATE OR REPLACE MCP SERVER agent_mcp_server FROM SPECIFICATION
$$
tools:
- name: "Documentation Agent"
identifier: "MY_DB.MY_SCHEMA.MY_AGENT"
type: "CORTEX_AGENT_RUN"
description: "An agent that answers questions using documentation."
title: "Documentation Agent"
$$;
Full Featured Server
CREATE OR REPLACE MCP SERVER full_mcp_server FROM SPECIFICATION
$$
tools:
- name: "Analytics Semantic View"
identifier: "ANALYTICS_DB.DATA.FINANCIAL_ANALYTICS"
type: "CORTEX_ANALYST_MESSAGE"
description: "Query financial metrics, customer data, and business KPIs."
title: "Financial Analytics"
- name: "Support Tickets Search"
identifier: "SUPPORT_DB.DATA.TICKETS_SEARCH"
type: "CORTEX_SEARCH_SERVICE_QUERY"
description: "Search support tickets and customer interactions."
title: "Support Search"
- name: "SQL Execution Tool"
type: "SYSTEM_EXECUTE_SQL"
description: "Execute SQL queries against Snowflake."
title: "SQL Execution"
- name: "Send_Email"
identifier: "MY_DB.DATA.SEND_EMAIL"
type: "GENERIC"
description: "Send emails to verified addresses."
title: "Send Email"
config:
type: "procedure"
warehouse: "COMPUTE_WH"
input_schema:
type: "object"
properties:
body:
description: "Email body in HTML format."
type: "string"
recipient_email:
description: "Recipient email address."
type: "string"
subject:
description: "Email subject line."
type: "string"
$$;
Tool Types Reference
Type
Purpose
SYSTEM_EXECUTE_SQL
Execute arbitrary SQL queries
CORTEX_SEARCH_SERVICE_QUERY
RAG over unstructured data
CORTEX_ANALYST_MESSAGE
Natural language queries on semantic models
CORTEX_AGENT_RUN
Invoke Cortex Agents
GENERIC
Custom tools (procedures/functions)
Benefits
- Governed by Design: Same RBAC policies apply as your data
- No Infrastructure: No local server deployment needed
- Reduced Integration: Connect any MCP-compatible client
- Extensible: Add custom tools via procedures/functions
Troubleshooting
Connection Issues
- SSL Error: Use hyphens instead of underscores in account name
- 401 Unauthorized: Verify PAT token is valid and not expired
- 404 Not Found: Check database, schema, and MCP server names
Testing Tools
CREATE OR REPLACE MCP SERVER agent_mcp_server FROM SPECIFICATION
$$
tools:
- name: "Documentation Agent"
identifier: "MY_DB.MY_SCHEMA.MY_AGENT"
type: "CORTEX_AGENT_RUN"
description: "An agent that answers questions using documentation."
title: "Documentation Agent"
$$;
CREATE OR REPLACE MCP SERVER full_mcp_server FROM SPECIFICATION
$$
tools:
- name: "Analytics Semantic View"
identifier: "ANALYTICS_DB.DATA.FINANCIAL_ANALYTICS"
type: "CORTEX_ANALYST_MESSAGE"
description: "Query financial metrics, customer data, and business KPIs."
title: "Financial Analytics"
- name: "Support Tickets Search"
identifier: "SUPPORT_DB.DATA.TICKETS_SEARCH"
type: "CORTEX_SEARCH_SERVICE_QUERY"
description: "Search support tickets and customer interactions."
title: "Support Search"
- name: "SQL Execution Tool"
type: "SYSTEM_EXECUTE_SQL"
description: "Execute SQL queries against Snowflake."
title: "SQL Execution"
- name: "Send_Email"
identifier: "MY_DB.DATA.SEND_EMAIL"
type: "GENERIC"
description: "Send emails to verified addresses."
title: "Send Email"
config:
type: "procedure"
warehouse: "COMPUTE_WH"
input_schema:
type: "object"
properties:
body:
description: "Email body in HTML format."
type: "string"
recipient_email:
description: "Recipient email address."
type: "string"
subject:
description: "Email subject line."
type: "string"
$$;
Tool Types Reference
Type
Purpose
SYSTEM_EXECUTE_SQL
Execute arbitrary SQL queries
CORTEX_SEARCH_SERVICE_QUERY
RAG over unstructured data
CORTEX_ANALYST_MESSAGE
Natural language queries on semantic models
CORTEX_AGENT_RUN
Invoke Cortex Agents
GENERIC
Custom tools (procedures/functions)
Benefits
- Governed by Design: Same RBAC policies apply as your data
- No Infrastructure: No local server deployment needed
- Reduced Integration: Connect any MCP-compatible client
- Extensible: Add custom tools via procedures/functions
Troubleshooting
Connection Issues
- SSL Error: Use hyphens instead of underscores in account name
- 401 Unauthorized: Verify PAT token is valid and not expired
- 404 Not Found: Check database, schema, and MCP server names
Testing Tools
| Type | Purpose |
|---|---|
SYSTEM_EXECUTE_SQL |
Execute arbitrary SQL queries |
CORTEX_SEARCH_SERVICE_QUERY |
RAG over unstructured data |
CORTEX_ANALYST_MESSAGE |
Natural language queries on semantic models |
CORTEX_AGENT_RUN |
Invoke Cortex Agents |
GENERIC |
Custom tools (procedures/functions) |
- Governed by Design: Same RBAC policies apply as your data
- No Infrastructure: No local server deployment needed
- Reduced Integration: Connect any MCP-compatible client
- Extensible: Add custom tools via procedures/functions
Troubleshooting
Connection Issues
- SSL Error: Use hyphens instead of underscores in account name
- 401 Unauthorized: Verify PAT token is valid and not expired
- 404 Not Found: Check database, schema, and MCP server names
Testing Tools
List available tools:
curl -X POST "https://YOUR-ACCOUNT.snowflakecomputing.com/api/v2/databases/DB/schemas/SCHEMA/mcp-servers/SERVER" \
-H "Authorization: Bearer PAT" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}'
PAT Token Notes
- PATs don't evaluate secondary roles
- Select a single role with all required permissions when creating
- Create new PAT to change role
Alternative: Local MCP Server
For local deployment using the snowflake-labs-mcp package, see mcp-client-setup.md.
Resources
正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。