.env.example•6.32 kB
# =============================================================================
# SQL Server MCP Environment Variables Configuration
# =============================================================================
#
# 📖 COMPLETE DOCUMENTATION: See docs/ENV-VARS.md for detailed information
# about all environment variables, defaults, and context-aware behavior.
#
# 🚀 QUICK START: Copy and modify the values below for your setup
#
# =============================================================================
# =============================================================================
# REQUIRED CONFIGURATION - MUST MODIFY THESE FOR YOUR ENVIRONMENT
# =============================================================================
# SQL Server Connection Configuration - CUSTOMIZE THESE
SQL_SERVER_HOST=localhost
SQL_SERVER_PORT=1433
SQL_SERVER_DATABASE=master
SQL_SERVER_USER=your_username
SQL_SERVER_PASSWORD=your_password
# Optional: For Windows Authentication, leave USER and PASSWORD empty and uncomment:
# SQL_SERVER_DOMAIN=your_domain
# =============================================================================
# SSL/TLS SECURITY SETTINGS
# =============================================================================
# SSL is enabled by default with smart environment detection
# Enable SSL/TLS Encryption (Default: true - RECOMMENDED)
# SQL_SERVER_ENCRYPT=true
# Trust Server Certificate - SMART DEFAULTS (LEAVE COMMENTED FOR AUTO-DETECTION)
# The system automatically detects your environment for appropriate security:
#
# 🔧 DEVELOPMENT ENVIRONMENTS (automatically trusts certificates):
# - ALWAYS: localhost, 127.0.0.1
# - WITH NODE_ENV=development/test: .local domains, private IPs (192.168.x.x, 10.x.x.x, 172.16-31.x.x)
#
# 🔒 PRODUCTION ENVIRONMENTS (requires valid certificates):
# - All other scenarios, including private IPs without explicit NODE_ENV=development/test
# - When NODE_ENV=production or not set
#
# 🔐 EXPLICIT OVERRIDES (uncomment only one if needed):
# SQL_SERVER_TRUST_CERT=false # Production: Never trust certificates, require valid CA-signed certs
# SQL_SERVER_TRUST_CERT=true # Development: Always trust certificates, for self-signed certs
# =============================================================================
# SAFETY CONFIGURATION - SECURITY SETTINGS
# =============================================================================
# The following settings control SQL operations security (secure defaults)
# All security settings default to maximum protection (READ-ONLY mode)
# Read-Only Mode (Default: true - SECURE)
# When true, only SELECT queries are allowed
# SQL_SERVER_READ_ONLY=true
# Allow Destructive Operations (Default: false - SECURE)
# When true, allows INSERT/UPDATE/DELETE operations
# SQL_SERVER_ALLOW_DESTRUCTIVE_OPERATIONS=false
# Allow Schema Changes (Default: false - SECURE)
# When true, allows CREATE/DROP/ALTER operations
# SQL_SERVER_ALLOW_SCHEMA_CHANGES=false
# =============================================================================
# SECURITY CONFIGURATION EXAMPLES
# =============================================================================
# Uncomment the appropriate section for your use case:
# 🔒 MAXIMUM SECURITY (Default - Recommended for Production)
# SQL_SERVER_READ_ONLY=true
# SQL_SERVER_ALLOW_DESTRUCTIVE_OPERATIONS=false
# SQL_SERVER_ALLOW_SCHEMA_CHANGES=false
# 📊 DATA ANALYSIS MODE (Read + Write Operations)
# SQL_SERVER_READ_ONLY=false
# SQL_SERVER_ALLOW_DESTRUCTIVE_OPERATIONS=true
# SQL_SERVER_ALLOW_SCHEMA_CHANGES=false
# 🛠️ FULL DEVELOPMENT MODE (⚠️ Use with Caution - NOT for Production)
# SQL_SERVER_READ_ONLY=false
# SQL_SERVER_ALLOW_DESTRUCTIVE_OPERATIONS=true
# SQL_SERVER_ALLOW_SCHEMA_CHANGES=true
# =============================================================================
# CONNECTION SETTINGS (Optional - Using Defaults If Not Set)
# =============================================================================
# Connection Timeouts and Retries (Defaults shown)
# SQL_SERVER_CONNECT_TIMEOUT_MS=10000
# SQL_SERVER_REQUEST_TIMEOUT_MS=30000
# SQL_SERVER_MAX_RETRIES=3
# SQL_SERVER_RETRY_DELAY_MS=1000
# Connection Pool Settings (Defaults shown)
# SQL_SERVER_POOL_MAX=10
# SQL_SERVER_POOL_MIN=0
# SQL_SERVER_POOL_IDLE_TIMEOUT_MS=30000
# =============================================================================
# PERFORMANCE MONITORING (Optional - Using Defaults If Not Set)
# =============================================================================
# Enable Performance Monitoring (Default: true)
# ENABLE_PERFORMANCE_MONITORING=true
# Performance Settings (Defaults shown)
# MAX_METRICS_HISTORY=1000
# SLOW_QUERY_THRESHOLD=5000
# TRACK_POOL_METRICS=true
# PERFORMANCE_SAMPLING_RATE=1.0
# =============================================================================
# STREAMING CONFIGURATION (Optional - Using Defaults If Not Set)
# =============================================================================
# Enable Intelligent Streaming (Default: true)
# ENABLE_STREAMING=true
# Streaming Settings (Defaults shown)
# STREAMING_BATCH_SIZE=1000
# STREAMING_MAX_MEMORY_MB=100
# STREAMING_MAX_RESPONSE_SIZE=10485760 # 10MB
# =============================================================================
# LOGGING AND RESPONSE FORMAT (Optional - Using Defaults If Not Set)
# =============================================================================
# Log Level (Default: info - Options: error, warn, info, debug)
# SQL_SERVER_LOG_LEVEL=info
# Debug Mode (Default: false)
# SQL_SERVER_DEBUG=false
# Security Audit (Default: false) - Enable for sensitive environments
# ENABLE_SECURITY_AUDIT=false
# Response Format (Default: json - Options: json, structured, pretty-json)
# SQL_SERVER_RESPONSE_FORMAT=json
# =============================================================================
# SECRET MANAGEMENT (Optional - For Cloud Deployments)
# =============================================================================
# Secret Manager Type (Default: env - Options: env, aws, azure)
# SECRET_MANAGER_TYPE=env
# AWS Secrets Manager (When SECRET_MANAGER_TYPE=aws)
# AWS_REGION=us-east-1
# Azure Key Vault (When SECRET_MANAGER_TYPE=azure)
# AZURE_KEY_VAULT_URL=https://your-vault.vault.azure.net/