Enhanced Snowflake MCP Server with comprehensive configuration system and full MCP protocol compliance. A production-ready MCP server that provides seamless Snowflake integration with advanced features including configurable logging, resource subscriptions, and comprehensive error handling. Designed to work seamlessly behind corporate proxies. The server exposes comprehensive MCP tools to interact
Add this skill
npx mdskills install YannBrrd/simple-snowflake-mcpProduction-ready Snowflake MCP server with comprehensive toolset, YAML configuration, and Docker support
1# Simple Snowflake MCP server2[](https://archestra.ai/mcp-catalog/yannbrrd__simple_snowflake_mcp)34**Enhanced Snowflake MCP Server with comprehensive configuration system and full MCP protocol compliance.**56A production-ready MCP server that provides seamless Snowflake integration with advanced features including configurable logging, resource subscriptions, and comprehensive error handling. Designed to work seamlessly behind corporate proxies.78### Tools910The server exposes comprehensive MCP tools to interact with Snowflake:1112**Core Database Operations:**13- **execute-snowflake-sql**: Executes a SQL query on Snowflake and returns the result (list of dictionaries)14- **execute-query**: Executes a SQL query in read-only mode (SELECT, SHOW, DESCRIBE, EXPLAIN, WITH) or not (if `read_only` is false), result in markdown format15- **query-view**: Queries a view with an optional row limit (markdown result)1617**Discovery and Metadata:**18- **list-snowflake-warehouses**: Lists available Data Warehouses (DWH) on Snowflake19- **list-databases**: Lists all accessible Snowflake databases20- **list-schemas**: Lists all schemas in a specified database21- **list-tables**: Lists all tables in a database and schema22- **list-views**: Lists all views in a database and schema23- **describe-table**: Gives details of a table (columns, types, constraints)24- **describe-view**: Gives details of a view (columns, SQL)2526**Advanced Operations:**27- **get-table-sample**: Gets sample data from a table28- **explain-query**: Explains the execution plan of a SQL query29- **show-query-history**: Shows recent query history30- **get-warehouse-status**: Gets current warehouse status and usage31- **validate-sql**: Validates SQL syntax without execution3233## 🆕 Configuration System (v0.2.0)3435The server now includes a comprehensive YAML-based configuration system that allows you to customize all aspects of the server behavior.3637### Configuration File Structure3839Create a `config.yaml` file in your project root:4041```yaml42# Logging Configuration43logging:44 level: INFO # DEBUG, INFO, WARNING, ERROR, CRITICAL45 format: "%(asctime)s - %(name)s - %(levelname)s - %(message)s"46 file_logging: false # Set to true to enable file logging47 log_file: "mcp_server.log" # Log file path (when file_logging is true)4849# Server Configuration50server:51 name: "simple_snowflake_mcp"52 version: "0.2.0"53 description: "Enhanced Snowflake MCP Server with full protocol compliance"54 connection_timeout: 3055 read_only: true # Set to false to allow write operations5657# Snowflake Configuration58snowflake:59 read_only: true60 default_query_limit: 100061 max_query_limit: 500006263# MCP Protocol Settings64mcp:65 experimental_features:66 resource_subscriptions: true # Enable resource change notifications67 completion_support: false # Set to true when MCP version supports it6869 notifications:70 resources_changed: true71 tools_changed: true7273 limits:74 max_prompt_length: 1000075 max_resource_size: 1048576 # 1MB76```7778### Using Custom Configuration7980You can specify a custom configuration file using the `CONFIG_FILE` environment variable:8182**Windows:**83```cmd84set CONFIG_FILE=config_debug.yaml85python -m simple_snowflake_mcp86```8788**Linux/macOS:**89```bash90CONFIG_FILE=config_production.yaml python -m simple_snowflake_mcp91```9293### Configuration Override Priority9495Configuration values are resolved in this order (highest to lowest priority):961. Environment variables (e.g., `LOG_LEVEL`, `MCP_READ_ONLY`)972. Custom configuration file (via `CONFIG_FILE`)983. Default `config.yaml` file994. Built-in defaults100101## 🚀 Installation Rapide102103### Méthode 1 : Installation avec `uvx` (Recommandé)104105```bash106# Installation et exécution directe107uvx simple-snowflake-mcp108```109110### Méthode 2 : Installation depuis le code source111112```bash113# Cloner le repo114git clone https://github.com/YannBrrd/simple_snowflake_mcp115cd simple_snowflake_mcp116117# Installer avec uv (crée automatiquement un venv)118uv sync119120# Exécuter121uv run simple-snowflake-mcp122```123124### Méthode 3 : Développement125126```bash127# Installer avec les dépendances de développement128uv sync --all-extras129130# Lancer les tests131uv run pytest132133# Linter avec ruff134uv run ruff check .135uv run ruff format .136```137138### Configuration Claude Desktop139140On MacOS: `~/Library/Application\ Support/Claude/claude_desktop_config.json`141142On Windows: `%APPDATA%/Claude/claude_desktop_config.json`143144<details>145 <summary>Development/Unpublished Servers Configuration</summary>146147148 ```json149 "mcpServers": {150 "simple_snowflake_mcp": {151 "command": "uv",152 "args": [153 "--directory",154 ".",155 "run",156 "simple_snowflake_mcp"157 ]158 }159 }160 ```161</details>162163<details>164 <summary>Published Servers Configuration</summary>165166 ```json167 "mcpServers": {168 "simple_snowflake_mcp": {169 "command": "uvx",170 "args": [171 "simple_snowflake_mcp"172 ]173 }174 }175 ```176</details>177178## Docker Setup179180### Prerequisites181182- Docker and Docker Compose installed on your system183- Your Snowflake credentials184185### Quick Start with Docker1861871. **Clone the repository**188 ```bash189 git clone <your-repo>190 cd simple_snowflake_mcp191 ```1921932. **Set up environment variables**194 ```bash195 cp .env.example .env196 # Edit .env with your Snowflake credentials197 ```1981993. **Build and run with Docker Compose**200 ```bash201 # Build the Docker image202 docker-compose build203204 # Start the service205 docker-compose up -d206207 # View logs208 docker-compose logs -f209 ```210211### Docker Commands212213Using Docker Compose directly:214```bash215# Build the image216docker-compose build217218# Start in production mode219docker-compose up -d220221# Start in development mode (with volume mounts for live code changes)222docker-compose --profile dev up simple-snowflake-mcp-dev -d223224# View logs225docker-compose logs -f226227# Stop the service228docker-compose down229230# Clean up (remove containers, images, and volumes)231docker-compose down --rmi all --volumes --remove-orphans232```233234Using the provided Makefile (Windows users can use `make` with WSL or install make for Windows):235```bash236# See all available commands237make help238239# Build and start240make build241make up242243# Development mode244make dev-up245246# View logs247make logs248249# Clean up250make clean251```252253### Docker Configuration254255The Docker setup includes:256257- **Dockerfile**: Multi-stage build with Python 3.11 slim base image258- **docker-compose.yml**: Service definition with environment variable support259- **.dockerignore**: Optimized build context260- **Makefile**: Convenient commands for Docker operations261262#### Environment Variables263264All Snowflake configuration can be set via environment variables:265266**Required:**267- `SNOWFLAKE_USER`: Your Snowflake username268- `SNOWFLAKE_PASSWORD`: Your Snowflake password269- `SNOWFLAKE_ACCOUNT`: Your Snowflake account identifier270271**Optional:**272- `SNOWFLAKE_WAREHOUSE`: Warehouse name273- `SNOWFLAKE_DATABASE`: Default database274- `SNOWFLAKE_SCHEMA`: Default schema275- `MCP_READ_ONLY`: Set to "TRUE" for read-only mode (default: TRUE)276277**Configuration System (v0.2.0):**278- `CONFIG_FILE`: Path to custom configuration file (default: config.yaml)279- `LOG_LEVEL`: Override logging level (DEBUG, INFO, WARNING, ERROR, CRITICAL)280281#### Development Mode282283For development, use the development profile which mounts your source code:284285```bash286docker-compose --profile dev up simple-snowflake-mcp-dev -d287```288289This allows you to make changes to the code without rebuilding the Docker image.290291## Développement292293### Installation des dépendances294295```bash296# Synchroniser toutes les dépendances (prod + dev)297uv sync --all-extras298299# Mettre à jour les dépendances300uv lock --upgrade301302# Ajouter une nouvelle dépendance303uv add <package-name>304305# Ajouter une dépendance de dev306uv add --dev <package-name>307```308309### Build et Publication310311```bash312# Build313uv build314315# Publier sur PyPI316uv publish --token $UV_PUBLISH_TOKEN317```318319### Debugging avec MCP Inspector320321Since MCP servers run over stdio, debugging can be challenging. For the best debugging322experience, we strongly recommend using the [MCP Inspector](https://github.com/modelcontextprotocol/inspector).323324You can launch the MCP Inspector via [`npm`](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) with this command:325326```bash327npx @modelcontextprotocol/inspector uv run simple-snowflake-mcp328```329330Upon launching, the Inspector will display a URL that you can access in your browser to begin debugging.331332## New Feature: Snowflake SQL Execution333334The server exposes an MCP tool `execute-snowflake-sql` to execute a SQL query on Snowflake and return the result.335336### Usage337338Call the MCP tool `execute-snowflake-sql` with a `sql` argument containing the SQL query to execute. The result will be returned as a list of dictionaries (one per row).339340Example:341```json342{343 "name": "execute-snowflake-sql",344 "arguments": { "sql": "SELECT CURRENT_TIMESTAMP;" }345}346```347348The result will be returned in the MCP response.349350## Installation et configuration dans VS Code3513521. **Cloner le projet et installer les dépendances**353 ```sh354 git clone https://github.com/YannBrrd/simple_snowflake_mcp355 cd simple_snowflake_mcp356357 # Installer avec uv (crée automatiquement un venv)358 uv sync --all-extras359 ```3603612. **Configurer l'accès Snowflake**362 - Copier `.env.example` vers `.env` et remplir vos credentials :363 ```env364 SNOWFLAKE_USER=...365 SNOWFLAKE_PASSWORD=...366 SNOWFLAKE_ACCOUNT=...367 # SNOWFLAKE_WAREHOUSE Optionnel: Nom du warehouse Snowflake368 # SNOWFLAKE_DATABASE Optionnel: Nom de la base par défaut369 # SNOWFLAKE_SCHEMA Optionnel: Nom du schéma par défaut370 # MCP_READ_ONLY=true|false Optionnel: true/false pour forcer le mode lecture seule371 ```3723733. **Configurer le serveur (v0.2.0)**374 - Le serveur créera automatiquement un fichier `config.yaml` par défaut au premier lancement375 - Personnalisez le logging, les limites et les fonctionnalités MCP en éditant `config.yaml`376 - Utilisez `CONFIG_FILE=custom_config.yaml` pour spécifier un fichier de configuration différent3773784. **Configurer VS Code pour le debugging MCP**379 - Le fichier `.vscode/mcp.json` est déjà présent :380 ```json381 {382 "servers": {383 "simple-snowflake-mcp": {384 "type": "stdio",385 "command": "uv",386 "args": ["run", "simple-snowflake-mcp"]387 }388 }389 }390 ```391 - Ouvrir la palette de commandes (Ctrl+Shift+P), taper `MCP: Start Server` et sélectionner `simple-snowflake-mcp`.3923935. **Utilisation**394 - Les outils MCP exposés vous permettent d'interroger Snowflake (list-databases, list-views, describe-view, query-view, execute-query, etc.).395 - Pour plus d'exemples, voir la documentation du protocole MCP : https://github.com/modelcontextprotocol/create-python-server396397## Enhanced MCP Features (v0.2.0)398399### Advanced MCP Protocol Support400401This server now implements comprehensive MCP protocol features:402403**🔔 Resource Subscriptions**404- Real-time notifications when Snowflake resources change405- Automatic updates for database schema changes406- Tool availability notifications407408**📋 Enhanced Resource Management**409- Dynamic resource discovery and listing410- Detailed resource metadata and descriptions411- Support for resource templates and prompts412413**⚡ Performance & Reliability**414- Configurable query limits and timeouts415- Comprehensive error handling with detailed error codes416- Connection pooling and retry mechanisms417418**🔧 Development Features**419- Multiple output formats (JSON, Markdown, CSV)420- SQL syntax validation without execution421- Query execution plan analysis422- Comprehensive logging with configurable levels423424### MCP Capabilities Advertised425426The server advertises these MCP capabilities:427- ✅ **Tools**: Full tool execution with comprehensive schemas428- ✅ **Resources**: Dynamic resource discovery and subscriptions429- ✅ **Prompts**: Enhanced prompts with resource integration430- ✅ **Notifications**: Real-time change notifications431- 🚧 **Completion**: Ready for future MCP versions (configurable)432433## Supported MCP Functions434435The server exposes comprehensive MCP tools to interact with Snowflake:436437**Core Database Operations:**438- **execute-snowflake-sql**: Executes a SQL query and returns structured results439- **execute-query**: Advanced query execution with multiple output formats440- **query-view**: Optimized view querying with result limiting441- **validate-sql**: SQL syntax validation without execution442443**Discovery and Metadata:**444- **list-snowflake-warehouses**: Lists available Data Warehouses with status445- **list-databases**: Lists all accessible databases with metadata446- **list-schemas**: Lists all schemas in a specified database447- **list-tables**: Lists all tables with column information448- **list-views**: Lists all views with definitions449- **describe-table**: Detailed table schema and constraints450- **describe-view**: View definition and column details451452**Advanced Analytics:**453- **get-table-sample**: Sample data extraction with configurable limits454- **explain-query**: Query execution plan analysis455- **show-query-history**: Recent query history with performance metrics456- **get-warehouse-status**: Real-time warehouse status and usage457- **get-account-usage**: Account-level usage statistics458459For detailed usage examples and parameter schemas, see the MCP protocol documentation.460461## 🚀 Getting Started Examples462463### Basic Usage464```python465# Execute a simple query466{467 "name": "execute-query",468 "arguments": {469 "query": "SELECT CURRENT_TIMESTAMP;",470 "format": "markdown"471 }472}473474# List all databases475{476 "name": "list-databases",477 "arguments": {}478}479```480481### Advanced Configuration482```yaml483# config_production.yaml484logging:485 level: WARNING486 file_logging: true487 log_file: "/var/log/mcp_server.log"488489server:490 read_only: false # Allow write operations491492snowflake:493 default_query_limit: 5000494 max_query_limit: 100000495496mcp:497 experimental_features:498 resource_subscriptions: true499```500501### Debugging and Troubleshooting502503**Enable Debug Logging:**504```bash505# Method 1: Environment variable506export LOG_LEVEL=DEBUG507python -m simple_snowflake_mcp508509# Method 2: Custom config file510export CONFIG_FILE=config_debug.yaml511python -m simple_snowflake_mcp512```513514**Common Issues:**515- **Connection errors**: Check your Snowflake credentials and network connectivity516- **Permission errors**: Ensure your user has appropriate Snowflake privileges517- **Query limits**: Adjust `default_query_limit` in config.yaml for large result sets518- **MCP compatibility**: Update to latest MCP client version for full feature support519
Full transparency — inspect the skill content before installing.