The Warp SQL Server MCP enables AI assistants to interact with SQL Server databases through natural language, providing comprehensive database management and optimization capabilities with enterprise-grade security.
Core Database Operations:
Execute SQL queries directly or through natural language translation (SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, ALTER)
Explore database schemas by listing databases, tables, and foreign key relationships
Describe table structures including column definitions and schema details
Retrieve and filter data with optional limits and conditions
Export data to CSV format for external analysis
Performance & Optimization:
Analyze query performance with execution plans and optimization suggestions
Detect bottlenecks and receive index recommendations
Monitor server health with performance statistics and connection diagnostics
Generate optimization insights based on historical database activity
Security & Integration:
Three-tier security system: read-only mode, controlled destructive operations, and explicit schema change permissions
Enterprise credential management through AWS Secrets Manager and Azure Key Vault
Seamless integration with GitHub Copilot, Warp Terminal, and other MCP-compatible AI systems
Security audit logs and comprehensive server diagnostics
Monitoring & Diagnostics:
Access server configuration, status, and logging information
Connection pool health metrics and database optimization insights
Provides enterprise secret management capabilities for securely storing and retrieving SQL Server credentials from AWS Secrets Manager
SQL Server MCP - AI-Powered Database Integration
Connect AI assistants to your SQL Server databases with enterprise-grade security and performance.
🤖 AI-First Database Access: Enable GitHub Copilot, Warp AI, and other assistants to interact with your SQL Server databases through natural language queries, with comprehensive security controls and production-ready reliability.
🚀 Quick Start - Choose Your AI Assistant
New to this project? Get up and running in under 5 minutes!
🤖 GitHub Copilot in VS Code (⭐ Most Popular)
Perfect for developers who want AI-powered SQL assistance directly in their IDE.
→ 5-Minute VS Code Setup Guide
- ✅ GitHub Copilot can query your databases directly
- ✅ Context-aware suggestions based on your actual schema
- ✅ Natural language to SQL query generation
- ✅ Real-time insights while coding
💬 Warp Terminal
Ideal for terminal-based workflows and command-line database interactions.
- ✅ AI-powered terminal with SQL Server integration
- ✅ Natural language database queries
- ✅ Fast iteration for analysis and debugging
- ✅ Cross-platform terminal experience
🔧 Advanced Integration
Complete VS Code Integration Guide → - Advanced workflows and configuration
Using another AI assistant? This MCP server works with any MCP-compatible system.
✨ What You Get
- 🤖 Natural language to SQL - Ask questions, get queries
- 🔒 Enterprise security - Three-tier safety system with secure defaults
- 📊 Performance insights - Query optimization and bottleneck detection
- ☁️ Cloud-ready - AWS/Azure secret management
- 🚀 Streaming support - Memory-efficient handling of large datasets
- 📈 16 Database Tools - Complete database operations through AI
🔒 Security Levels (Quick Reference)
Security Level | Environment Variable | Default | Impact |
---|---|---|---|
🔒 Read-Only Mode | SQL_SERVER_READ_ONLY | true | Only SELECT queries allowed |
⚠️ Destructive Operations | SQL_SERVER_ALLOW_DESTRUCTIVE_OPERATIONS | false | Controls INSERT/UPDATE/DELETE |
🚨 Schema Changes | SQL_SERVER_ALLOW_SCHEMA_CHANGES | false | Controls CREATE/DROP/ALTER |
🔒 Maximum Security (Default - Production Recommended):
📋 Essential Environment Variables
📖 Complete Reference: See docs/ENV-VARS.md for comprehensive documentation of all environment variables, defaults, and context-aware behavior.
Variable | Required | Default | Description |
---|---|---|---|
SQL_SERVER_HOST | Yes | localhost | SQL Server hostname |
SQL_SERVER_PORT | Yes | 1433 | SQL Server port |
SQL_SERVER_DATABASE | Yes | master | Initial database |
SQL_SERVER_USER | For SQL Auth | - | Database username |
SQL_SERVER_PASSWORD | For SQL Auth | - | Database password |
SQL_SERVER_ENCRYPT | No | true | Enable SSL/TLS |
SQL_SERVER_TRUST_CERT | No | context-aware | Trust server certificate |
💡 Authentication: For Windows Authentication, leave
SQL_SERVER_USER
andSQL_SERVER_PASSWORD
empty. 💡 SSL Certificates:SQL_SERVER_TRUST_CERT
automatically adapts to your environment (trusts in development, requires valid certificates in production).
🛠️ Installation & Configuration
Note: As of v1.7.11 the package is published under the scoped name
@egarcia74/warp-sql-server-mcp
. The previous unscoped package remains temporarily and will be deprecated.
⭐ Recommended: Global npm Installation
Benefits:
- ✅ No manual path configuration
- ✅ Secure credential storage with file permissions (600)
- ✅ Easy configuration updates without touching AI assistant settings
- ✅ Password masking and validation
Alternative: Manual Installation
🎯 Use Cases
🔍 Database Analysis & Exploration
- Schema Discovery: Reverse engineer legacy databases without documentation
- Data Quality Assessment: Spot-check data integrity across tables
- New Team Onboarding: Rapidly explore unfamiliar database schemas
📊 Business Intelligence & Reporting
- Ad-hoc Analysis: Quick business questions through natural language
- Data Export: Export filtered datasets to CSV for analysis
- Revenue Analysis: AI-powered business insights
🛠️ Development & DevOps
- Query Performance Tuning: Execution plan analysis and optimization
- API Development: Quickly test database queries during development
- Database Troubleshooting: Debug slow queries and identify bottlenecks
🚀 AI-Powered Operations
- Natural Language to SQL: Ask questions like "Show me customers who haven't placed orders"
- Query Optimization: "Why is this query running slowly?"
- Automated Insights: Generate business reports through conversational queries
📚 Complete Documentation
📋 Complete Documentation Index - Navigate all documentation in one place
User Guides
- Environment Variables Reference - Complete environment variables documentation
- Security Guide - Comprehensive security configuration and threat model
- Security Threat Analysis Process - Workflows for reviewing and responding to security alerts
- Architecture Guide - Technical deep-dive and system design
- All MCP Tools - Complete API reference (16 tools)
Setup Guides
- VS Code Integration Guide - Advanced workflows and configuration
- Azure Key Vault Guide - Cloud secret management setup
- AWS Secrets Manager Guide - Enterprise credential management
Developer Resources
- Software Engineering Manifesto - Philosophy and engineering practices
- Quality No-Compromise Case Study - Real-world analysis of zero-tolerance quality standards
- Testing Guide - Comprehensive test documentation (535+ tests)
- Contributing Guide - Development workflow and standards
- Git Commit Checklist - Pre-commit quality gates and guidelines
- Git Push Checklist - Pre-push validation and deployment guidelines
- Git Release Checklist - Step-by-step release guide (automation + npm)
🧪 Production Validation
✅ PRODUCTION-VALIDATED: This MCP server has been fully tested through:
- 618+ Comprehensive Tests: All MCP tools, security boundaries, error scenarios (392 unit + 40 manual integration + 20 protocol tests)
- 40 Manual Integration Tests: Live database validation across all security phases
- 20 Protocol Tests: End-to-end MCP communication validation
- 100% Success Rate: All security phases validated in production scenarios
🐳 Quick Testing with Docker (Recommended for Development)
Benefits: ✨ Zero configuration, 🛡️ Complete isolation, ⚡ Fast setup, 📋 Consistent environment
Complete Docker Testing Guide →
🔧 Manual Setup Testing (Production Validation)
Security Phases Tested:
- Phase 1 (Read-Only): Maximum security - 20/20 tests ✅
- Phase 2 (DML Operations): Selective permissions - 10/10 tests ✅
- Phase 3 (DDL Operations): Full development mode - 10/10 tests ✅
🔧 Usage Examples
Once configured, you can use natural language with your AI assistant:
VS Code + GitHub Copilot
Warp Terminal
🚨 Troubleshooting
Common Issues
Connection Problems:
- Verify SQL Server is running on the specified port:
telnet localhost 1433
- Check firewall settings on both client and server
- Enable TCP/IP protocol in SQL Server Configuration Manager
Authentication Issues:
- For SQL Server Auth: Verify
SQL_SERVER_USER
andSQL_SERVER_PASSWORD
- For Windows Auth: Leave user/password empty, optionally set
SQL_SERVER_DOMAIN
- Ensure the connecting user has appropriate database permissions
Configuration Issues:
- Set
SQL_SERVER_ENCRYPT=false
for local development - MCP servers require explicit environment variables (
.env
files are not loaded automatically) - Check MCP server logs:
npm run logs
ornpm run logs:tail
for real-time monitoring - View audit logs for security-related issues:
npm run logs:audit
Platform-Specific
Windows:
- Enable TCP/IP in SQL Server Configuration Manager
- Start SQL Server Browser service for named instances
- Windows Authentication works seamlessly with domain accounts
macOS/Linux:
- Remote SQL Server connections often require SQL Server Authentication
- May need
SQL_SERVER_ENCRYPT=true
for remote connections - Test connectivity:
nc -zv localhost 1433
ornmap -p 1433 localhost
🤝 Contributing
This project demonstrates enterprise-grade software engineering practices. We welcome contributions that maintain our high standards:
- Fork the repository and create a feature branch
- Follow TDD practices - write tests first!
- Maintain code quality - all commits trigger automated quality checks
- Add comprehensive tests for new functionality
- Update documentation as needed
- Submit a pull request with detailed description
Development Commands:
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
Copyright (c) 2025 Eduardo Garcia
🌟 About This Project
While this appears to be an MCP server for SQL Server integration, it's fundamentally a comprehensive framework demonstrating enterprise-grade software development practices. Every component, pattern, and principle here showcases rigorous engineering standards that can be applied to any production system.
Key Engineering Highlights:
- 🔬 618+ Comprehensive Tests covering all functionality and edge cases
- 🛡️ Multi-layered Security with defense-in-depth architecture
- 📊 Production Observability with structured logging and performance monitoring
- ⚡ Enterprise Reliability featuring connection pooling and graceful error handling
- 🏛️ Clean Architecture with dependency inversion and modular design
- 📚 Living Documentation that auto-syncs with code changes
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
Tools
Enables secure database operations on SQL Server instances through a three-tier safety system, supporting schema exploration, query execution, performance analysis, and data export with configurable security levels from read-only to full development access.
Related MCP Servers
- -securityAlicense-qualityProvides database interaction and business intelligence capabilities, enabling users to run SQL queries, analyze business data, and automatically generate business insight memos for Microsoft SQL Server databases.Last updated -38MIT License
- AsecurityAlicenseAqualityProvides secure, read-only access to MariaDB/MySQL databases, allowing users to list databases, explore table schemas, and execute SQL queries with built-in security measures.Last updated -4373MIT License
- AsecurityAlicenseAqualityEnables interaction with Microsoft SQL Server databases through a Model Context Protocol interface, supporting database connections, switching between databases, and executing secure SELECT queries.Last updated -826MIT License
- -securityAlicense-qualityA secure Model Context Protocol service that enables executing SQL Server queries with built-in protection against SQL injection and destructive operations.Last updated -11MIT License