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., "@MS SQL Server MCP Servershow me the top 10 customers by total orders"
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.
MS SQL Server MCP Server v2.1.1
π Model Context Protocol (MCP) server for Microsoft SQL Server - compatible with Claude Desktop, Cursor, Windsurf and VS Code.
π Quick Start
1. Install
2. Configure IDE
Claude Desktop (claude_desktop_config.json):
Cursor/Windsurf/VS Code (.vscode/mcp.json):
Replace with your actual database credentials.
π οΈ Available Tools
Tool | Description |
| Connect to database using environment variables |
| Close current database connection |
| Check connection state with pool info |
| Execute any SQL query with parameters |
| List database objects (tables, views, procedures) |
| Get detailed table structure |
| Retrieve data with pagination |
| Execute stored procedures |
| List all databases |
π§ Environment Variables
Variable | Required | Default | Description |
| β | - | SQL Server hostname |
| β | - | Database name |
| β | - | Username |
| β | - | Password |
| β | 1433 | SQL Server port |
| β | true | Enable TLS encryption (required for Azure SQL) |
| β | false | Trust self-signed certificates |
| β | 30000 | Connection timeout (ms) |
| β | 30000 | Request timeout (ms) |
Azure SQL Configuration
For Azure SQL Database, use these settings:
Local SQL Server (Self-signed cert)
For local development with self-signed certificates:
π Features
β MCP SDK 1.25.1: Latest Model Context Protocol SDK
β Azure SQL Compatible: TLS encryption enabled by default
β Complete SQL Support: All database operations
β Parameterized Queries: SQL injection protection
β Connection Pooling: Efficient resource management
β Performance Monitoring: Execution time tracking
π Usage Examples
Connect to Database
Execute a Query
Get Table Schema
π Troubleshooting
β Connection failed
Verify all required environment variables are set
Check server accessibility and credentials
Ensure network connectivity to SQL Server
β SSL/Certificate errors
For Azure SQL: Set
DB_ENCRYPT=true(default)For self-signed certs: Set
DB_TRUST_SERVER_CERTIFICATE=trueFor local dev without encryption: Set
DB_ENCRYPT=false
π Version History
v2.1.1 - Latest
β Added
DB_ENCRYPTenvironment variable (Issue #1)β Azure SQL Database compatibility improved
β Encryption enabled by default (
DB_ENCRYPT=true)β Fixed
DB_TRUST_SERVER_CERTIFICATEdefault tofalse
v2.1.0
β Updated to MCP SDK 1.25.1
β Migrated to
registerTool()/registerResource()APIβ Added tool titles for better UI display
v2.0.3
β Documentation improvements
π License
MIT License
π Support
Issues: GitHub Issues
Repository: BYMCS/mssql-mcp
π v2.1.1: Azure SQL compatibility with DB_ENCRYPT support