mssql-mcp
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-mcpShow me the schema for the Customers table in the PROD 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-mcp
MCP server for Microsoft SQL Server. Supports Windows Authentication and SQL Server Authentication via the native msnodesqlv8 ODBC driver.
Requirements
Windows (native ODBC driver required)
Node.js >= 18
The ODBC driver is auto-detected from the Windows registry — no configuration needed.
Installation
npm install
npm run buildConfiguration
All configuration is via environment variables. No .env file is required when running via an MCP host — set env in the MCP config instead.
Authentication
Windows Authentication (use the current Windows user — no credentials needed):
MSSQL_SERVER=myserverSQL Server Authentication (provide both user and password):
MSSQL_SERVER=myserver
MSSQL_USER=sa
MSSQL_PASSWORD=secretNote:
MSSQL_USERandMSSQL_PASSWORDmust both be set or both be absent. Setting only one will throw an error.
Multiple servers
Use MSSQL_<KEY>_SERVER to configure multiple servers. Each key becomes a selectable dbKey in the MCP tools.
Windows auth on all servers:
MSSQL_PROD_SERVER=prod-server
MSSQL_QA_SERVER=qa-server
MSSQL_DEV_SERVER=dev-serverMixed auth:
MSSQL_PROD_SERVER=prod-server
MSSQL_DEV_SERVER=dev-server
MSSQL_DEV_USER=sa
MSSQL_DEV_PASSWORD=secretEach key can also override the ODBC driver:
MSSQL_PROD_DRIVER=ODBC Driver 18 for SQL ServerOr set a global override for all servers:
MSSQL_DRIVER=ODBC Driver 17 for SQL ServerOptional: port
MSSQL_PORT=1433
# or per-key: MSSQL_PROD_PORT=1433MCP Host Config
Claude Desktop (claude_desktop_config.json)
Single server — Windows auth:
{
"mcpServers": {
"mssql": {
"command": "node",
"args": ["/path/to/mssql-mcp/dist/index.js"],
"env": {
"MSSQL_SERVER": "your-server"
}
}
}
}Single server — SQL auth:
{
"mcpServers": {
"mssql": {
"command": "node",
"args": ["/path/to/mssql-mcp/dist/index.js"],
"env": {
"MSSQL_SERVER": "your-server",
"MSSQL_USER": "sa",
"MSSQL_PASSWORD": "secret"
}
}
}
}Multiple servers:
{
"mcpServers": {
"mssql": {
"command": "node",
"args": ["/path/to/mssql-mcp/dist/index.js"],
"env": {
"MSSQL_PROD_SERVER": "prod-server",
"MSSQL_QA_SERVER": "qa-server",
"MSSQL_DEV_SERVER": "dev-server",
"MSSQL_DEV_USER": "sa",
"MSSQL_DEV_PASSWORD": "secret"
}
}
}
}VS Code (mcp.json)
{
"servers": {
"mssql": {
"type": "stdio",
"command": "node",
"args": ["/path/to/mssql-mcp/dist/index.js"],
"env": {
"MSSQL_SERVER": "your-server"
}
}
}
}Tools
Tool | Description |
| Execute any SQL query |
| List tables, optionally filtered by schema |
| Get column definitions for a table |
| List configured servers and their auth type |
When multiple servers are configured, each tool accepts a dbKey parameter to select the target server.
Notes
The LLM should use fully-qualified table names (e.g.
MyDatabase.dbo.Orders) — no database selection is needed in config.Connection pools are created lazily on first use and reused across calls.
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/av1choudharyy/mssql-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server