
Snowflake MCP Server

Overview
基本能力
产品定位
Snowflake MCP Server 是一个数据库交互服务,专注于与 Snowflake 数据库的交互,提供 SQL 查询执行和数据洞察分析功能。
核心功能
- 查询工具:
read_query
:执行 SELECT 查询,返回查询结果。write_query
:执行 INSERT、UPDATE 或 DELETE 查询(需--allow-write
标志)。-
create_table
:创建新表(需--allow-write
标志)。 -
模式工具:
list_tables
:列出数据库中的所有表。-
describe-table
:查看特定表的列信息。 -
分析工具:
append_insight
:将数据洞察添加到memo://insights
资源中,并触发资源更新。
适用场景
- 需要与 Snowflake 数据库进行交互的场景。
- 需要执行 SQL 查询并获取结果的场景。
- 需要动态更新数据洞察备忘录的场景。
工具列表
read_query
:执行 SELECT 查询。write_query
:执行 INSERT、UPDATE 或 DELETE 查询。create_table
:创建新表。list_tables
:列出数据库中的所有表。describe-table
:查看特定表的列信息。append_insight
:添加数据洞察到备忘录资源。
常见问题解答
- 如何启用写操作?:使用
--allow-write
标志启用write_query
和create_table
工具。 - 如何查看日志?:通过
--log_dir
和--log_level
参数配置日志目录和级别。 - 如何排除特定工具?:使用
--exclude_tools
参数排除不需要的工具。
使用教程
使用依赖
- 确保已安装 Python 和 pip。
- 确保已安装 Snowflake 数据库连接所需的依赖。
安装教程
-
通过 Smithery 安装:
bash npx -y @smithery/cli install mcp_snowflake_server --client claude
-
通过 UVX 安装:
python # 在 claude_desktop_config.json 中添加以下配置 "mcpServers": { "snowflake_pip": { "command": "uvx", "args": [ "mcp_snowflake_server", "--account", "the_account", "--warehouse", "the_warehouse", "--user", "the_user", "--password", "their_password", "--role", "the_role", "--database", "the_database", "--schema", "the_schema" ] } }
-
本地安装:
python # 在 claude_desktop_config.json 中添加以下配置 "mcpServers": { "snowflake_local": { "command": "uv", "args": [ "--directory", "/absolute/path/to/mcp_snowflake_server", "run", "mcp_snowflake_server", "--account", "the_account", "--warehouse", "the_warehouse", "--user", "the_user", "--password", "their_password", "--role", "the_role", "--database", "the_database", "--schema", "the_schema" ] } }
调试方式
- 检查日志文件(如果配置了
--log_dir
)。 - 使用
--log_level
参数调整日志级别以获取更多调试信息。 - 确保所有连接参数(如账户、仓库、用户、密码等)正确无误。