snowflake-mcp-server
by aPeterHeise
Overview
Provides a semantic layer for Snowflake, translating natural language questions into SQL using an LLM and a defined glossary.
Installation
python src/server.pyEnvironment Variables
- OPENAI_API_KEY
- SNOWFLAKE_USER
- SNOWFLAKE_PASSWORD
- SNOWFLAKE_ACCOUNT
- SNOWFLAKE_ROLE
- SNOWFLAKE_WAREHOUSE
- SNOWFLAKE_DATABASE
- SNOWFLAKE_SCHEMA
Security Notes
The server directly executes SQL queries generated by an LLM based on user input and a glossary. This poses a significant risk if the LLM is prompted to generate malicious SQL (e.g., DROP TABLE, DELETE FROM, data exfiltration queries, or complex injections). There is no explicit validation or sanitization of the generated SQL before execution by the `run_sql` function. While environment variables are used for credentials, the execution of arbitrary LLM-generated SQL without stringent safeguards is a critical vulnerability. The `SNOWFLAKE_ROLE` might offer some protection but is not a complete solution against all malicious SQL types.
Similar Servers
DBchat
Transforms a database into an intelligent conversational partner, enabling natural language queries, instant answers, and data visualizations via MCP clients.
nlp2sql
Converting natural language queries to optimized SQL for enterprise databases using multiple AI providers.
database-ontology-mcp
Analyzes relational database schemas, generates semantic ontologies (RDF/OWL, R2RML), and provides tools for Text-to-SQL convenience, secure query execution, and data visualization.
sfguide-getting-started-with-snowflake-mcp-server
Enables organizations to leverage AI agents for secure, natural language querying and activation of vast financial services data within Snowflake to derive insights and actions.