Snowflake MCP 配合 Cursor AI - 快速入门指南
此仓库展示了如何使用Snowflake的托管模型上下文协议(MCP)服务器与Cursor AI一起,与存储在Snowflake中的数据进行交互,其中包括一个IMDB电影数据集的示例。
🌟 概述
这个项目展示了:
- Snowflake MCP 集成Cursor AI与Snowflake数据之间的直接集成
- \*\*IMDB 数据集 Cortex Analyst\*\*:使用自然语言查询和分析电影数据
- 语义搜索利用Snowflake的Cortex搜索功能
📋 先决条件
在开始之前,请确保您已准备好:
- Snowflake 账户访问具有适当权限的Snowflake账户
- Cursor AI(可译为“光标人工智能”或根据具体语境简化为“Cursor智能”)已安装最新版本的Cursor AI集成开发环境(IDE)
- Snowflake 权限:
- CREATE DATABASE, CREATE SCHEMA, CREATE TABLE - 访问Snowflake Cortex服务 - MCP服务器部署权限
🚀 快速入门
步骤1:设置Snowflake环境
- 运行安装SQL:
-- Execute the provided setup.sql file in your Snowflake account
-- This will create the necessary database, schema, and tables- 加载示例数据:
-- Download the data file and upload the data into Genai_db.data.imdb_movies table using snowsight
-- Create Cortex search and Cortex Analyst 步骤2:部署MCP服务器
- 创建MCP服务器 到您的Snowflake账户:
- 配置身份验证:
- 从Cursor AI获取用于访问Snowflake MCP服务器的程序化访问令牌
步骤3:配置Cursor AI
- 创建MCP配置:
创建或更新您的 ~/.cursor/mcp.json 文件:
{
"mcpServers": {
"Snowflake-Data": {
"url": "https://YOUR_ACCOUNT.snowflakecomputing.com/api/v2/databases/genai_db/schemas/data/mcp-servers/rp_mcp_server",
"headers": {
"Authorization": "Bearer YOUR_JWT_TOKEN"
}
},
"Snowflake-IMDB": {
"url": "https://YOUR_ACCOUNT.snowflakecomputing.com/api/v2/databases/genai_db/schemas/data/mcp-servers/imdb_mcp_server",
"headers": {
"Authorization": "Bearer YOUR_JWT_TOKEN"
}
}
}
}- 替换占位符:
- YOUR_ACCOUNT您的Snowflake账户标识符(例如。, sfpscogs-rpegu_aiml) - YOUR_JWT_TOKEN您的身份验证令牌
- 重启Cursor AI 加载新的MCP配置
💡 使用示例
基本电影查询
向Cursor AI提出自然语言问题:
Tell me about the highest grossing horror movie of 2023What was the box office revenue for M3GAN?Find information about The Nun II from the IMDB dataset高级语义搜索
Find movies similar to "The Dark Knight" with high ratingsShow me action movies from the 1990s with budgets over $50 millionSearch for horror movies featuring artificial intelligence数据分析
Compare the box office performance of Marvel vs DC moviesWhat are the trends in horror movie revenues over the past decade?Analyze customer tenure data and show insights🔗 额外资源
- Snowflake MCP 文档
- Cursor AI MCP 集成
- Snowflake Cortex 服务
- 模型上下文协议规范
- Snowflake Cortex 搜索(或“Snowflake Cortex 搜索引擎”)
查询愉快! 🎬📊🚀
*使用Snowflake MCP和Cursor AI,用心打造*
