Warp SQL Server MCP

Warp SQL Server MCP

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.

Category
访问服务器

README

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.

CI CodeQL Node.js Version License


🚀 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.

→ 5-Minute Warp Setup Guide

  • 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
  • 📈 15 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):

SQL_SERVER_READ_ONLY=true                      # Only SELECT allowed
SQL_SERVER_ALLOW_DESTRUCTIVE_OPERATIONS=false  # No data modifications
SQL_SERVER_ALLOW_SCHEMA_CHANGES=false         # No schema changes

📋 Essential Environment Variables

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 false Enable SSL/TLS
SQL_SERVER_TRUST_CERT No true Trust server certificate

💡 Tip: For Windows Authentication, leave SQL_SERVER_USER and SQL_SERVER_PASSWORD empty.


🛠️ Installation & Configuration

Recommended: Global npm Installation

# Install globally via npm (easiest method)
npm install -g @egarcia74/warp-sql-server-mcp

# Initialize configuration
warp-sql-server-mcp init

# Edit config file with your SQL Server details
# Config file location: ~/.warp-sql-server-mcp.json

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

# Clone and install manually
git clone https://github.com/egarcia74/warp-sql-server-mcp.git
cd warp-sql-server-mcp
npm install

🎯 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

User Guides

Setup Guides

Developer Resources


🧪 Production Validation

✅ PRODUCTION-VALIDATED: This MCP server has been fully tested through:

  • 535+ Unit Tests: All MCP tools, security boundaries, error scenarios
  • 40 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

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 ✅
# Run tests locally
npm test                    # All automated tests
npm run test:coverage      # Coverage report
npm run test:manual        # Manual integration tests (requires live DB)

🔧 Usage Examples

Once configured, you can use natural language with your AI assistant:

VS Code + GitHub Copilot

@sql-server List all databases
@sql-server Show me tables in the AdventureWorks database
@sql-server Generate a query to find the top 10 customers by sales
@sql-server Analyze the performance of this query: SELECT * FROM Orders WHERE OrderDate > '2023-01-01'

Warp Terminal

Please list all databases on the SQL Server
Execute this SQL query: SELECT TOP 10 * FROM Users ORDER BY CreatedDate DESC
Can you describe the structure of the Orders table?
Show me 50 rows from the Products table where Price > 100

🚨 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 and SQL_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 in your AI assistant for startup messages

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 or nmap -p 1433 localhost

🤝 Contributing

This project demonstrates enterprise-grade software engineering practices. We welcome contributions that maintain our high standards:

  1. Fork the repository and create a feature branch
  2. Follow TDD practices - write tests first!
  3. Maintain code quality - all commits trigger automated quality checks
  4. Add comprehensive tests for new functionality
  5. Update documentation as needed
  6. Submit a pull request with detailed description

Development Commands:

npm run dev                # Development mode with auto-restart
npm test                   # Run all tests
npm run lint:fix          # Fix linting issues
npm run format            # Format code
npm run ci                 # Full CI pipeline locally

📄 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:

  • 🔬 535+ 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

→ Read the Complete Engineering Philosophy

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选