Snowflake MCP Server

Snowflake MCP Server

site icon
2025.04.10 48
Python数据库服务数据交互数据库
Snowflake MCP Server 是一个基于 Model Context Protocol (MCP) 的服务实现,专注于与 Snowflake 数据库的交互。该服务允许用户执行 SQL 查询,并通过动态资源 `memo://insights` 提供数据洞察的备忘录功能。核心功能包括查询工具、模式工具和分析工具,适用于需要与 Snowflake 数据库进行交互的场景。
View on GitHub

Overview

基本能力

产品定位

Snowflake MCP Server 是一个数据库交互服务,专注于与 Snowflake 数据库的交互,提供 SQL 查询执行和数据洞察分析功能。

核心功能

  1. 查询工具
  2. read_query:执行 SELECT 查询,返回查询结果。
  3. write_query:执行 INSERT、UPDATE 或 DELETE 查询(需 --allow-write 标志)。
  4. create_table:创建新表(需 --allow-write 标志)。

  5. 模式工具

  6. list_tables:列出数据库中的所有表。
  7. describe-table:查看特定表的列信息。

  8. 分析工具

  9. append_insight:将数据洞察添加到 memo://insights 资源中,并触发资源更新。

适用场景

  1. 需要与 Snowflake 数据库进行交互的场景。
  2. 需要执行 SQL 查询并获取结果的场景。
  3. 需要动态更新数据洞察备忘录的场景。

工具列表

  1. read_query:执行 SELECT 查询。
  2. write_query:执行 INSERT、UPDATE 或 DELETE 查询。
  3. create_table:创建新表。
  4. list_tables:列出数据库中的所有表。
  5. describe-table:查看特定表的列信息。
  6. append_insight:添加数据洞察到备忘录资源。

常见问题解答

  1. 如何启用写操作?:使用 --allow-write 标志启用 write_querycreate_table 工具。
  2. 如何查看日志?:通过 --log_dir--log_level 参数配置日志目录和级别。
  3. 如何排除特定工具?:使用 --exclude_tools 参数排除不需要的工具。

使用教程

使用依赖

  1. 确保已安装 Python 和 pip。
  2. 确保已安装 Snowflake 数据库连接所需的依赖。

安装教程

  1. 通过 Smithery 安装bash npx -y @smithery/cli install mcp_snowflake_server --client claude

  2. 通过 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" ] } }

  3. 本地安装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" ] } }

调试方式

  1. 检查日志文件(如果配置了 --log_dir)。
  2. 使用 --log_level 参数调整日志级别以获取更多调试信息。
  3. 确保所有连接参数(如账户、仓库、用户、密码等)正确无误。

许可证

该项目遵循 GPL-3.0 开源许可条款,请参阅 GPL-3.0 了解完整条款。