tabaghak/dlh-snowflake-mcp-server
If you are the rightful owner of dlh-snowflake-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
DLH Snowflake MCP Server is a Model Context Protocol server designed to facilitate interaction with Snowflake databases using secure eternalbrowser authentication.
DLH Snowflake MCP Server
A Model Context Protocol (MCP) server that provides tools for interacting with Snowflake databases using eternalbrowser authentication.
Features
- Test Connection: Verify connection to Snowflake and get current user/role information
- Execute Queries: Run SQL queries against your Snowflake database
- Schema Exploration: List databases, schemas, tables, and columns
- Table Metadata: Get detailed information about specific tables
- Secure Authentication: Uses Snowflake's eternalbrowser authentication for secure login
Tools Provided
- test_connection: Test the connection to Snowflake and display connection info
- execute_query: Execute arbitrary SQL queries with optional parameters
- get_schemas: List available databases and schemas
- get_tables: List tables in a specific database/schema
- get_columns: Get column information for a specific table
- describe_table: Get detailed metadata for a specific table
Installation
- Clone this repository
- Install dependencies:
npm install - Copy the environment configuration:
cp .env.example .env - Edit
.envwith your Snowflake connection details - Build the project:
npm run build
Configuration
Set the following environment variables (or add them to your .env file):
SNOWFLAKE_ACCOUNT: Your Snowflake account identifier (required)SNOWFLAKE_USERNAME: Your Snowflake username (required)SNOWFLAKE_DATABASE: Default database to connect to (optional)SNOWFLAKE_SCHEMA: Default schema to use (optional)SNOWFLAKE_WAREHOUSE: Default warehouse to use (optional)SNOWFLAKE_ROLE: Default role to assume (optional)
Authentication
This server uses Snowflake's EXTERNALBROWSER authentication method, which will open a web browser for you to authenticate with your Snowflake credentials. Make sure you have access to a web browser on the machine where this server is running.
Usage
Setting Up Environment Variables
Before running the server, you'll need to configure your Snowflake connection details. You can either:
-
Use environment variables (recommended for development):
# Copy the example environment file cp .env.example .env # Edit .env with your details # SNOWFLAKE_ACCOUNT=your_account.region # SNOWFLAKE_USERNAME=your_username # etc. -
Set environment variables directly:
set SNOWFLAKE_ACCOUNT=your_account.region set SNOWFLAKE_USERNAME=your_username # etc.
Running the Server
For development:
npm run dev
For production:
npm run build
npm start
Using with Claude Desktop
To use this server with Claude Desktop, add the following configuration to your claude_desktop_config.json:
Windows: %APPDATA%\Claude\claude_desktop_config.json
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"snowflake": {
"command": "node",
"args": ["D:\\absolute\\path\\to\\dlh-snowflake-mcp-server\\build\\index.js"],
"env": {
"SNOWFLAKE_ACCOUNT": "your_account.region",
"SNOWFLAKE_USERNAME": "your_username",
"SNOWFLAKE_DATABASE": "your_database",
"SNOWFLAKE_SCHEMA": "your_schema",
"SNOWFLAKE_WAREHOUSE": "your_warehouse"
}
}
}
}
Important: Use the absolute path to your build/index.js file.
Example Queries
Once connected, you can use the server to:
- Test your connection: "Test my Snowflake connection"
- Run queries: "Execute this SQL query: SELECT * FROM my_table LIMIT 10"
- Explore schema: "Show me all the databases and schemas"
- Get table info: "What tables are in the PUBLIC schema?"
- Describe tables: "Describe the structure of the CUSTOMERS table"
Development
Building
npm run build
Cleaning
npm run clean
Debugging in VS Code
You can debug this MCP server using VS Code:
- Build the project:
npm run build - The server is configured in
.vscode/mcp.json - Use the VS Code MCP extension to connect and test
Security Notes
- This server uses eternalbrowser authentication for secure access to Snowflake
- Never commit your
.envfile or expose your Snowflake credentials - The server logs to stderr to avoid interfering with MCP communication
- All SQL queries are executed with your authenticated user's permissions
Troubleshooting
- Authentication Issues: Make sure you can access a web browser and that your Snowflake account supports eternalbrowser authentication
- Connection Timeouts: Check your network connection and firewall settings
- Permission Errors: Ensure your Snowflake user has the necessary permissions for the operations you're trying to perform
- Environment Variables: Double-check that all required environment variables are set correctly
- Build Issues: Make sure TypeScript compiles successfully with
npm run build
License
ISC