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., "@MSSQL Database MCP Serverlist tables in the sales database"
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.
MSSQL Database MCP Server
An enterprise-grade Model Context Protocol (MCP) server for Microsoft SQL Server. This server enables AI assistants (like Claude, Cursor, Windsurf) to securely interact with MSSQL databases to query data, inspect schemas, and retrieve metadata.
Features
Read-Only by Default: Strict safety controls to prevent accidental writes.
Schema Introspection: Tools to list databases, tables, and describe table schemas.
Secure Authentication: Supports SQL Server authentication with encryption.
Docker Ready: Easy deployment using Docker or Docker Compose.
Comprehensive Logging: Structured JSON logging for auditing.
Quick Start
1. Build the Docker Image
2. Configure Environment
Create a .env file based on .env.example:
Edit .env with your MSSQL connection details:
3. Run with Docker Compose
Tools Available
The server exposes the following MCP tools:
Core Tools (Always Available)
mssql_query: Execute SELECT queries (with safety checks)mssql_list_databases: List all accessible databasesmssql_list_tables: List tables in a specific database/schemamssql_describe_table: Get detailed schema information (columns, PKs) for a tablemssql_pool_stats: Get connection pool statistics for monitoring
Advanced Tools (Require Write Operations Enabled)
⚠️ These tools require
mssql_execute_procedure: Execute stored procedures with parametersmssql_execute_write: Execute INSERT, UPDATE, DELETE statements with transaction safety
Performance Features
Connection Pooling
The server implements intelligent connection pooling for optimal performance:
Reusable Connections: Connections are pooled and reused across queries
Thread-Safe: Safe for concurrent requests
Auto-Validation: Connections are validated before use
Configurable Limits: Control min/max pool size via environment variables
Connection Lifetime: Automatic rotation of long-lived connections
Monitoring: Track pool usage with
mssql_pool_statstool
Configuration:
Monitor Pool Health:
IDE Integration
For detailed integration instructions for Claude Desktop, Cursor, and Windsurf, see IDE-INTEGRATION.md.
Example Configuration (Generic)
Add this to your IDE's MCP configuration file:
Development & Testing
The project includes an automated test suite that spins up a test MSSQL container.
Run Tests
Project Structure
src/: Source codeserver.py: Main MCP server entry pointtools/: MCP tool implementationsdatabase/: Database connection and validation logic
tests/: Integration testsdocker/: Docker configuration
Security Notes
Write Operations: Disabled by default. To enable, set
MSSQL_ALLOW_WRITE_OPERATIONS=true.Credentials: Never commit
.envfiles. Use Docker secrets in production.Network: Use TLS (
MSSQL_ENCRYPT=true) for non-local connections.
Support This Project
If you find this MSSQL MCP Server useful for your projects, please consider supporting its development!
☕ Become a Patron
This project is maintained by independent developers. Your support helps us:
🚀 Add new features and improvements
🐛 Fix bugs and improve stability
📚 Create better documentation and tutorials
🔒 Enhance security features
🎯 Provide faster support and updates
Supporter Benefits
Patrons get access to:
🎯 Priority Support - Get help faster when you need it
📝 Early Access - Try new features before public release
💬 Direct Communication - Influence the project roadmap
🎓 Exclusive Tutorials - Advanced usage guides and examples
🏆 Recognition - Your name in our SUPPORTERS.md file
Other Ways to Support
⭐ Star this repository on GitHub
🐛 Report bugs and request features via GitHub Issues
📖 Improve documentation by submitting pull requests
💬 Spread the word - Share with colleagues and on social media
License
This project is licensed under the MIT License - see the LICENSE file for details.