Mcp Snowflake Service

Mcp Snowflake Service

用于Snowflake集成的MCP server实现。

GitHub Stars License: MIT

一个为 Claude 提供 Snowflake 数据库访问能力的 MCP (模型上下文协议) 服务器。

核心功能

  • 在 Snowflake 数据库上执行 SQL 查询
  • 自动管理数据库连接生命周期
  • 处理查询结果和错误
  • 安全地执行数据库操作

快速安装

git clone https://github.com/datawiz168/mcp-snowflake-service.git
cd mcp-snowflake-service
pip install -r requirements.txt

配置步骤

1. 配置 Snowflake 连接

在项目根目录创建 .env 文件:

SNOWFLAKE_USER=your_username
SNOWFLAKE_PASSWORD=your_password
SNOWFLAKE_ACCOUNT=NRB18479.US-WEST-2
SNOWFLAKE_DATABASE=your_database
SNOWFLAKE_WAREHOUSE=your_warehouse

2. 配置 Claude Desktop 客户端

claude_desktop_config.json 中添加以下配置:

Windows 示例:

{
  "mcpServers": {
    "snowflake": {
      "command": "C:\\Users\\YourUsername\\anaconda3\\python.exe",
      "args": ["C:\\Path\\To\\mcp-snowflake\\server.py"]
    }
  }
}

MacOS/Linux 示例:

{
  "mcpServers": {
    "snowflake": {
      "command": "/usr/bin/python3",
      "args": ["/path/to/mcp-snowflake/server.py"]
    }
  }
}

使用说明

服务器会随 Claude Desktop 客户端自动启动,无需手动运行。连接会在首次查询时自动创建,并在连接断开时自动重连。

开发与贡献

  1. Fork 此仓库
  2. 创建功能分支 (git checkout -b feature/NewFeature)
  3. 提交更改 (git commit -m 'Add NewFeature')
  4. 推送分支 (git push origin feature/NewFeature)
  5. 创建 Pull Request

有关更多详细信息,请访问 GitHub 仓库