
MSSQL MCP Server
by mihai-dulgheru
Connect AI assistants to Microsoft SQL Server — run queries, inspect schemas, and manage multi-database setups via MCP.
What it does
MSSQL MCP Server bridges AI assistants to Microsoft SQL Server databases. It exposes tables as resources and provides tools for executing SQL queries, retrieving table schemas, and listing configured databases — all through the Model Context Protocol.
The server supports both single-database and multi-database configurations. In multi-database mode, you define prefixed environment variables (e.g. MSSQL_MAINDB_*, MSSQL_REPORTINGDB_*) and the server auto-detects them at runtime, making each database accessible via a simple dbKey parameter.
Tools
- execute_sql — Execute any SQL query against a connected database. Supports
dbKeyfor multi-database setups. Returns full result sets for SELECT queries and row-count confirmations for mutations. - get_table_schema — Retrieve column metadata (name, data type, max length) for any table. Supports
schema.tableformat. - list_databases — List all configured databases and their connection details. No parameters required.
Installation
Add to your claude_desktop_config.json:
{
"mcpServers": {
"mssql-mcp-node-single": {
"command": "npx",
"args": ["-y", "mssql-mcp-node"],
"env": {
"MSSQL_SERVER": "your_server",
"MSSQL_PORT": "1433",
"MSSQL_USER": "your_user",
"MSSQL_PASSWORD": "your_password",
"MSSQL_DATABASE": "your_database",
"MSSQL_ENCRYPT": "true",
"MSSQL_TRUST_SERVER_CERTIFICATE": "false"
}
}
}
}
For VS Code Copilot, add a similar entry to your workspace .vscode/mcp.json under servers.
Supported hosts
Claude Desktop, VS Code Copilot
Quick install
npx -y mssql-mcp-nodeInformation
- Pricing
- free







