Snowflake MCP Server

Snowflake MCP Server

Contribute to peterdonaghey/snowflake-mcp development by creating an account on GitHub.

数据库交互
AI集成系统
访问服务器

README

Snowflake MCP (Model Context Protocol) Server

A Model Context Protocol (MCP) server implementation that allows AI assistants like Claude to interact with Snowflake databases through natural language queries.

MIT License

Features

  • Execute SQL queries on Snowflake databases via natural language
  • Automatic database connection lifecycle management (connect, reconnect, close)
  • Integration with Claude, Cursor IDE, and other MCP-compatible clients
  • Convert natural language to SQL using semantic understanding
  • Handle query results and format them for easy reading
  • Secure database operations with proper authentication

Prerequisites

  • Python 3.8+
  • Snowflake account with appropriate access permissions
  • MCP-compatible client (Claude, Cursor IDE, etc.)

Installation

  1. Clone this repository:
git clone https://github.com/yourusername/snowflake-mcp.git
cd snowflake-mcp
  1. Install the required dependencies:
pip install -r requirements.txt
  1. Copy the sample environment file and add your Snowflake credentials:
cp .env.sample .env
# Edit .env with your Snowflake credentials

Configuration

Environment Variables

Create a .env file with your Snowflake credentials:

SNOWFLAKE_USER=your_username
SNOWFLAKE_PASSWORD=your_password
SNOWFLAKE_ACCOUNT=your_account_locator  # e.g., xy12345.us-east-2
SNOWFLAKE_DATABASE=your_database
SNOWFLAKE_WAREHOUSE=your_warehouse
SNOWFLAKE_SCHEMA=your_schema  # Optional, defaults to PUBLIC
SNOWFLAKE_ROLE=your_role  # Optional, defaults to user's default role

MCP Client Configuration

For Cursor IDE:

Cursor automatically discovers and integrates with MCP servers. Just make sure the server is running.

For Claude Desktop:

Add the following to your claude_desktop_config.json file:

{
  "mcpServers": {
    "snowflake": {
      "command": "/path/to/python",
      "args": ["/path/to/snowflake-mcp/src/server.py"]
    }
  }
}

Replace /path/to/python with the path to your Python interpreter, and /path/to/snowflake-mcp with the full path to where you cloned this repository.

Usage

The Snowflake MCP server implements the Model Context Protocol (MCP) specification, allowing AI systems like Claude to connect to Snowflake databases through natural language.

Using MCP CLI (Recommended)

The MCP Python SDK includes a command-line interface that makes it easy to run and manage MCP servers:

  1. Development Mode with Inspector UI:
mcp dev src/server.py

This starts the server and opens an inspector interface in your browser where you can test the tools.

  1. Install in Claude Desktop:
mcp install src/server.py

This installs the server in Claude Desktop, making it available for Claude to use.

  1. Standard Mode:
mcp run src/server.py

This runs the server in standard mode without the inspector interface.

Available Tools

The Snowflake MCP server provides the following tools:

  1. query_database - Execute SQL or natural language queries on Snowflake
  2. list_tables - List all tables in the database
  3. get_table_schema - Get the schema of a specific table

For more examples and detailed parameter information, check the examples/README.md file.

Running Manually

You can also run the server directly, which is useful for debugging:

python src/server.py

This starts the server in standalone mode using stdio transport.

Deployment

Hosting on Smithery

This server can be hosted on Smithery.ai for easy access by other users:

  1. Create an account on Smithery.ai
  2. Add your server to the Smithery registry
  3. Configure deployment using the Dockerfile in this repository
  4. Click "Deploy" on the Deployments tab on your server page

The Dockerfile is already configured to properly build and run the server with WebSocket transport support for Smithery hosting.

Security Considerations

When hosting your Snowflake MCP server publicly:

  • Consider using a read-only Snowflake account
  • Restrict access to specific schemas/tables
  • Use environment variables for secure credential management

Development

To contribute to this project:

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/new-feature
  3. Make your changes
  4. Run tests: pytest
  5. Commit your changes: git commit -m 'Add new feature'
  6. Push to the branch: git push origin feature/new-feature
  7. Submit a pull request

License

MIT License

Acknowledgements

推荐服务器

Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Neon MCP Server

Neon MCP Server

MCP server for interacting with Neon Management API and databases

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选
mcp-server-qdrant

mcp-server-qdrant

这个仓库展示了如何为向量搜索引擎 Qdrant 创建一个 MCP (Managed Control Plane) 服务器的示例。

官方
精选
AIO-MCP Server

AIO-MCP Server

🚀 All-in-one MCP server with AI search, RAG, and multi-service integrations (GitLab/Jira/Confluence/YouTube) for AI-enhanced development workflows. Folk from

精选
本地
Knowledge Graph Memory Server

Knowledge Graph Memory Server

为 Claude 实现持久性记忆,使用本地知识图谱,允许 AI 记住用户的信息,并可在自定义位置存储,跨对话保持记忆。

精选
本地
Hyperbrowser

Hyperbrowser

欢迎来到 Hyperbrowser,人工智能的互联网。Hyperbrowser 是下一代平台,旨在增强人工智能代理的能力,并实现轻松、可扩展的浏览器自动化。它专为人工智能开发者打造,消除了本地基础设施和性能瓶颈带来的麻烦,让您能够:

精选
本地
https://github.com/Streen9/react-mcp

https://github.com/Streen9/react-mcp

react-mcp 与 Claude Desktop 集成,能够根据用户提示创建和修改 React 应用程序。

精选
本地
MCP Atlassian

MCP Atlassian

适用于 Atlassian Cloud 产品(Confluence 和 Jira)的 Model Context Protocol (MCP) 服务器。此集成专为 Atlassian Cloud 实例设计,不支持 Atlassian Server 或 Data Center 部署。

精选
any-chat-completions-mcp

any-chat-completions-mcp

将 Claude 与任何 OpenAI SDK 兼容的聊天完成 API 集成 - OpenAI、Perplexity、Groq、xAI、PyroPrompts 等。

精选