Snowflake MCP Server
Allows deployment and orchestration of Snowflake data flows via Prefect Cloud, enabling scheduling, monitoring, and management of data operations through Prefect's platform.
Provides tools for executing queries, retrieving schemas, tables, customers, tickets, usage, and billing data from Snowflake, enabling AI agents to perform data operations on Snowflake databases.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Snowflake MCP ServerShow available schemas"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Snowflake MCP Server - Python/Prefect Version
A Python-based MCP server using FastAPI and Prefect for Snowflake data operations, deployable to Prefect Cloud.
🚀 Quick Start (Local Development)
Step 1: Install Python Dependencies
cd snowflake-mcp-server
pip install -r requirements.txtStep 2: Configure Environment
Copy the example environment file:
cp .env.python.example .envEdit .env with your Snowflake credentials:
SNOWFLAKE_ACCOUNT=your-account-identifier
SNOWFLAKE_USERNAME=your-username
SNOWFLAKE_PASSWORD=your-password
SNOWFLAKE_WAREHOUSE=COMPUTE_WH
SNOWFLAKE_DATABASE=TELECOM_ANALYTICS
SNOWFLAKE_ROLE=your-role
PORT=3000Step 3: Run the Server Locally
python server.pyYou should see:
🚀 Snowflake MCP Server (Python/Prefect) is starting!
Local: http://localhost:3000
Health: http://localhost:3000/healthStep 4: Test the Server
# Test health check
curl http://localhost:3000/health
# Test schemas
curl http://localhost:3000/mcp/schemas
# Test customers data
curl http://localhost:3000/mcp/customers☁️ Deploy to Prefect Cloud
Prerequisites
Prefect Cloud Account: Sign up at https://app.prefect.cloud/
Prefect CLI: Already included in requirements.txt
API Key: Get from Prefect Cloud settings
Step 1: Authenticate with Prefect Cloud
# Login to Prefect Cloud
prefect cloud login
# Or set API key directly
prefect config set PREFECT_API_KEY=your-api-key
prefect config set PREFECT_API_URL=https://api.prefect.cloud/api/accounts/[ACCOUNT_ID]/workspaces/[WORKSPACE_ID]Step 2: Create Prefect Blocks for Secrets
Store your Snowflake credentials as Prefect Secret blocks:
# Create secrets in Prefect Cloud
prefect block register -m prefect.blocks.system
# Create each secret (you can also do this via Prefect Cloud UI)
python -c "
from prefect.blocks.system import Secret
Secret(value='your-account-identifier').save('snowflake-account')
Secret(value='your-username').save('snowflake-username')
Secret(value='your-password').save('snowflake-password')
Secret(value='COMPUTE_WH').save('snowflake-warehouse')
Secret(value='TELECOM_ANALYTICS').save('snowflake-database')
Secret(value='your-role').save('snowflake-role')
"OR create secrets via Prefect Cloud UI:
Navigate to Blocks → + → Secret
Create blocks named:
snowflake-accountsnowflake-usernamesnowflake-passwordsnowflake-warehousesnowflake-databasesnowflake-role
Step 3: Deploy Flows to Prefect Cloud
# Deploy all flows
python deployment.pyThis will deploy all Prefect flows to your Prefect Cloud workspace.
Step 4: Start a Prefect Agent
You need an agent running to execute the flows:
# Start an agent (keep this running)
prefect agent start -q defaultFor production, run the agent as a service or in a container.
Step 5: Run Flows from Prefect Cloud
Now you can trigger flows from:
Prefect Cloud UI: https://app.prefect.cloud/
API calls: Use Prefect's REST API
Scheduled runs: Configure in prefect.yaml
🌐 Alternative: Deploy as Web Service
If you want to deploy the FastAPI server (not just Prefect flows), use these platforms:
Option 1: Railway
# Install Railway CLI
npm install -g @railway/cli
# Login and deploy
railway login
railway init
railway upAdd environment variables in Railway dashboard.
Option 2: Render
Create a new Web Service on https://render.com/
Connect your GitHub repository
Set build command:
pip install -r requirements.txtSet start command:
python server.pyAdd environment variables in Render dashboard
Option 3: Google Cloud Run
# Build and deploy
gcloud run deploy snowflake-mcp-server \
--source . \
--platform managed \
--region us-central1 \
--allow-unauthenticatedOption 4: AWS App Runner
Create a Dockerfile:
FROM python:3.11-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
EXPOSE 3000
CMD ["python", "server.py"]Deploy via AWS App Runner console
📋 Available Endpoints
Health Check
GET /healthList Schemas
GET /mcp/schemasList Tables
GET /mcp/tables/{schema}Execute Query
POST /mcp/query
Content-Type: application/json
{
"query": "SELECT * FROM CUSTOMER_DATA.CUSTOMERS LIMIT 10"
}Get Customers
GET /mcp/customersGet Service Tickets
GET /mcp/ticketsGet Usage Metrics
GET /mcp/usageGet Billing History
GET /mcp/billingGet All Data
GET /mcp/all🔧 Prefect Flow Management
View Flows
# List all flows
prefect flow ls
# View flow runs
prefect flow-run lsTrigger a Flow Manually
# Run a specific flow
prefect deployment run 'get-customers-flow/get-customers'Monitor Flows
Visit your Prefect Cloud dashboard:
Flow Runs: See all executions
Logs: View detailed logs
Metrics: Monitor performance
🔒 Security Best Practices
For Production:
Use Prefect Secret Blocks: Never hardcode credentials
Enable HTTPS: Use reverse proxy (nginx, Caddy)
Add Authentication: Implement API keys or OAuth
Rate Limiting: Add rate limiting middleware
IP Whitelisting: Restrict access to known IPs
Rotate Credentials: Change passwords regularly
Example: Add API Key Authentication
# Add to server.py
from fastapi import Header, HTTPException
API_KEY = os.getenv("API_KEY")
async def verify_api_key(x_api_key: str = Header(...)):
if x_api_key != API_KEY:
raise HTTPException(status_code=401, detail="Invalid API Key")
return x_api_key
# Add to endpoints
@app.get("/mcp/customers", dependencies=[Depends(verify_api_key)])
async def get_customers():
...🐛 Troubleshooting
Error: "Import prefect could not be resolved"
Solution: Install dependencies
pip install -r requirements.txtError: "Unable to connect to Snowflake"
Solution: Check credentials and network
# Test Snowflake connection
python -c "
import snowflake.connector
conn = snowflake.connector.connect(
account='your-account',
user='your-user',
password='your-password'
)
print('✅ Connected!')
"Error: "Prefect API authentication failed"
Solution: Re-authenticate
prefect cloud loginError: "No agent available"
Solution: Start a Prefect agent
prefect agent start -q default📊 Differences from Node.js Version
Feature | Node.js Version | Python Version |
Framework | Express | FastAPI |
Orchestration | None | Prefect |
Deployment | Manual | Prefect Cloud |
Type Safety | JavaScript | Python + Pydantic |
Async Support | Callbacks | async/await |
Monitoring | Manual | Prefect Dashboard |
🎯 Next Steps
Deploy to Prefect Cloud: Follow deployment steps above
Set up monitoring: Use Prefect Cloud dashboard
Configure schedules: Edit prefect.yaml for automated runs
Add more flows: Create custom Prefect flows for your use case
Integrate with ICA: Connect to IBM ICA Context Studio
📝 Files Overview
server.py: Main FastAPI application with Prefect flowsrequirements.txt: Python dependenciesdeployment.py: Prefect deployment scriptprefect.yaml: Prefect configuration.env.python.example: Environment variables templateREADME_PYTHON.md: This file
🆘 Support
For issues:
Check Prefect Cloud logs
Review server logs:
python server.pyTest Snowflake connection
Verify environment variables
Version: 2.0.0 (Python/Prefect)
Last Updated: 2026-06-02
Framework: FastAPI + Prefect
Deployment Target: Prefect Cloud
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/sandipsingha/mcp_snowflake'
If you have feedback or need assistance with the MCP directory API, please join our Discord server