Leverages OpenAI's GPT models to transform natural language into SQL queries, provide analysis of query results, suggest query optimizations, explain queries in plain English, and generate insights about table data.
Enables querying and managing Snowflake databases through natural language, providing tools for executing SQL, listing databases/schemas/tables, retrieving table samples, managing warehouses, and generating AI-powered insights from Snowflake data.
DataPilot MCP Server
Navigate your data with AI guidance. A comprehensive Model Context Protocol (MCP) server for interacting with Snowflake using natural language and AI. Built with FastMCP 2.0 and OpenAI integration.
Features
🗄️ Core Database Operations
- execute_sql - Execute SQL queries with results
- list_databases - List all accessible databases
- list_schemas - List schemas in a database
- list_tables - List tables in a database/schema
- describe_table - Get detailed table column information
- get_table_sample - Retrieve sample data from tables
🏭 Warehouse Management
- list_warehouses - List all available warehouses
- get_warehouse_status - Get current warehouse, database, and schema status
🤖 AI-Powered Features
- natural_language_to_sql - Convert natural language questions to SQL queries
- analyze_query_results - AI-powered analysis of query results
- suggest_query_optimizations - Get optimization suggestions for SQL queries
- explain_query - Plain English explanations of SQL queries
- generate_table_insights - AI-generated insights about table data
📊 Resources (Data Access)
snowflake://databases
- Access database listsnowflake://schemas/{database}
- Access schema listsnowflake://tables/{database}/{schema}
- Access table listsnowflake://table/{database}/{schema}/{table}
- Access table details
📝 Prompts (Templates)
- sql_analysis_prompt - Templates for SQL analysis
- data_exploration_prompt - Templates for data exploration
- sql_optimization_prompt - Templates for query optimization
Installation
- Clone and setup the project:
- Install dependencies:
- Configure environment variables:
Configuration
Environment Variables
Create a .env
file with the following configuration:
Snowflake Account Setup
- Get your Snowflake account identifier - Multiple formats supported:
- Recommended:
ACCOUNT-LOCATOR.snowflakecomputing.com
(e.g.,SCGEENJ-UR66679.snowflakecomputing.com
) - Regional:
ACCOUNT-LOCATOR.region.cloud
(e.g.,xy12345.us-east-1.aws
) - Legacy:
organization-account_name
- Recommended:
- Ensure your user has appropriate permissions:
USAGE
on warehouses, databases, and schemasSELECT
on tables for queryingSHOW
privileges for listing objects
Usage
Running the Server
Method 1: Direct execution
Method 2: Using FastMCP CLI
Method 3: Development mode with auto-reload
Connecting to MCP Clients
Claude Desktop
Add to your Claude Desktop configuration:
Using FastMCP Client
Example Usage
1. Natural Language Query
2. Execute and Analyze
3. Table Insights
4. Query Optimization
Architecture
Project Structure
Development
Adding New Tools
- Define your tool function in
src/main.py
:
- Add appropriate error handling and logging
- Test with FastMCP dev mode:
fastmcp dev src/main.py
Adding New Resources
Troubleshooting
Common Issues
- Connection Errors
- Verify Snowflake credentials in
.env
- Check network connectivity
- Ensure user has required permissions
- Verify Snowflake credentials in
- OpenAI Errors
- Verify
OPENAI_API_KEY
is set correctly - Check API quota and billing
- Ensure model name is correct
- Verify
- Import Errors
- Activate virtual environment
- Install all requirements:
pip install -r requirements.txt
- Run from project root directory
Logging
Enable debug logging:
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
License
This project is licensed under the MIT License.
Support
For issues and questions:
- Check the troubleshooting section
- Review FastMCP documentation: https://gofastmcp.com/
- Open an issue in the repository
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
A Model Context Protocol server that enables natural language interaction with Snowflake databases through AI guidance, supporting core database operations, warehouse management, and AI-powered data analysis features.
Related MCP Servers
- -securityAlicense-qualityA Model Context Protocol server that enables Claude to execute SQL queries on Snowflake databases with automatic connection lifecycle management.Last updated -28PythonMIT License
- -securityAlicense-qualityA Model Context Protocol server that provides access to Snowflake databases for any MCP-compatible client, allowing execution of SQL queries with automatic connection management.Last updated -2PythonMIT License
- -securityFlicense-qualityA Model Context Protocol server that enables AI models to interact with MySQL databases through natural language, supporting SQL queries, table creation, and schema exploration.Last updated -2Python
- AsecurityFlicenseAqualityA Model Context Protocol server that enables AI clients to interact with BlazeSQL's Natural Language Query API, allowing natural language queries against SQL databases.Last updated -1JavaScript