IM

isaacwasserman/mcp-snowflake-server

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

184 stars 84 forks 质量 68 趋势 0GPL-3.0

isaacwasserman/mcp-snowflake-server 是从 https://github.com/isaacwasserman/mcp-snowflake-server. 导入的 MCP 服务器候选

概览

isaacwasserman/mcp-snowflake-server 是从 https://github.com/isaacwasserman/mcp-snowflake-server. 导入的 MCP 服务器候选

概述(AI 翻译)


概述

一个模型上下文协议(MCP)服务器实现,提供与 Snowflake 的数据库交互。该服务器支持通过工具运行 SQL 查询,并将数据洞察和模式上下文作为资源开放。


组成部分

资源

  • memo://insights 一份持续更新的备忘录,汇总了发现的数据见解。 通过append_insight工具添加新见解时,自动更新。

  • context://table/{table_name} (如果启用预取)每个表的模式摘要,包括列和注释,作为单独资源公开。


工具

服务器会提供以下工具:

查询工具

  • read_query 执行SELECT查询以读取数据库中的数据。 输入:

  • query(字符串):用于执行的 SELECT SQL 查询 返回: 以对象数组形式查询结果

  • write_query(仅在--allow-write时启用) 执行 INSERT、UPDATE 或 DELETE 查询。 输入:

  • query(字符串):SQL 修改查询 返回: 受影响行数或确认

  • create_table(仅在--allow-write时启用) 在数据库中创建新的表。

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

Snowflake MCP Server


Overview

A Model Context Protocol (MCP) server implementation that provides database interaction with Snowflake. This server enables running SQL queries via tools and exposes data insights and schema context as resources.


Components

Resources

  • memo://insights
    A continuously updated memo aggregating discovered data insights.
    Updated automatically when new insights are appended via the append_insight tool.

  • context://table/{table_name}
    (If prefetch enabled) Per-table schema summaries, including columns and comments, exposed as individual resources.


Tools

The server exposes the following tools:

Query Tools

  • read_query
    Execute SELECT queries to read data from the database.
    Input:

    • query (string): The SELECT SQL query to execute
      Returns: Query results as array of objects
  • write_query (enabled only with --allow-write)
    Execute INSERT, UPDATE, or DELETE queries.
    Input:

    • query (string): The SQL modification query
      Returns: Number of affected rows or confirmation
  • create_table (enabled only with --allow-write)
    Create new tables in the database.
    Input:

    • query (string): CREATE TABLE SQL statement
      Returns: Confirmation of table creation

Schema Tools

  • list_databases
    List all databases in the Snowflake instance.
    Returns: Array of database names

  • list_schemas
    List all schemas within a specific database.
    Input:

    • database (string): Name of the database
      Returns: Array of schema names
  • list_tables
    List all tables within a specific database and schema.
    Input:

    • database (string): Name of the database
    • schema (string): Name of the schema
      Returns: Array of table metadata
  • describe_table
    View column information for a specific table.
    Input:

    • table_name (string): Fully qualified table name (database.schema.table)
      Returns: Array of column definitions with names, types, nullability, defaults, and comments

Analysis Tools

  • append_insight
    Add new data insights to the memo resource.
    Input:
    • insight (string): Data insight discovered from analysis
      Returns: Confirmation of insight addition
      Effect: Triggers update of memo://insights resource

Usage with Claude Desktop

Installing via Smithery

To install Snowflake Server for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install mcp_snowflake_server --client claude

Installing via UVX

Traditional Configuration (Individual Parameters)

"mcpServers": {
在 GitHub 查看完整 README

安装

uvx --python=3.12 // Optional: specify Python version <=3.12 "mcp_snowflake_server --account your_account --warehouse your_warehouse --user your_user --password your_password --role your_role --database your_database --schema your_schema" // Optionally: "--private_key_path your_private_key_absolute_path" // Optionally: "--allow_write" // Optionally: "--log_dir /absolute/path/to/logs" // Optionally: "--log_level DEBUG"/"INFO"/"WARNING"/"ERROR"/"CRITICAL" // Optionally: "--exclude_tools {tool_name} ["{other_tool_name}
新手?先看 mcpskill.org 教程 →

配置

"mcpServers": { "snowflake_pip": { "command": "uvx", "args": [ "--python=3.12", // Optional: specify Python version <=3.12 "mcp_snowflake_server", "--account", "your_account", "--warehouse", "your_warehouse", "--user", "your_user", "--password", "your_password", "--role", "your_role", "--database", "your_database", "--schema", "your_schema" // Optionally: "--private_key_path", "your_private_key_absolute_path" // Optionally: "--allow_write" // Optionally: "--log_dir", "/absolute/path/to/logs" // Optionally: "--log_level", "DEBUG"/"INFO"/"WARNING"/"ERROR"/"CRITICAL" // Optionally: "--exclude_tools", "{tool_name}", ["{other_tool_name}"] ] } }