loading…
Search for a command to run...
loading…
An MCP server that enables interaction with Microsoft SQL Server instances using Windows or SQL Server authentication via native ODBC drivers. It allows users t
An MCP server that enables interaction with Microsoft SQL Server instances using Windows or SQL Server authentication via native ODBC drivers. It allows users to execute SQL queries, list tables, and inspect schemas across multiple configured database environments through natural language.
MCP server for Microsoft SQL Server. Supports Windows Authentication and SQL Server Authentication via the native msnodesqlv8 ODBC driver.
The ODBC driver is auto-detected from the Windows registry — no configuration needed.
npm install
npm run build
All configuration is via environment variables. No .env file is required when running via an MCP host — set env in the MCP config instead.
Windows Authentication (use the current Windows user — no credentials needed):
MSSQL_SERVER=myserver
SQL Server Authentication (provide both user and password):
MSSQL_SERVER=myserver
MSSQL_USER=sa
MSSQL_PASSWORD=secret
Note:
MSSQL_USERandMSSQL_PASSWORDmust both be set or both be absent. Setting only one will throw an error.
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-server
Mixed auth:
MSSQL_PROD_SERVER=prod-server
MSSQL_DEV_SERVER=dev-server
MSSQL_DEV_USER=sa
MSSQL_DEV_PASSWORD=secret
Each key can also override the ODBC driver:
MSSQL_PROD_DRIVER=ODBC Driver 18 for SQL Server
Or set a global override for all servers:
MSSQL_DRIVER=ODBC Driver 17 for SQL Server
MSSQL_PORT=1433
# or per-key: MSSQL_PROD_PORT=1433
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"
}
}
}
}
mcp.json){
"servers": {
"mssql": {
"type": "stdio",
"command": "node",
"args": ["/path/to/mssql-mcp/dist/index.js"],
"env": {
"MSSQL_SERVER": "your-server"
}
}
}
}
| Tool | Description |
|---|---|
execute_sql |
Execute any SQL query |
list_tables |
List tables, optionally filtered by schema |
get_table_schema |
Get column definitions for a table |
list_databases |
List configured servers and their auth type |
When multiple servers are configured, each tool accepts a dbKey parameter to select the target server.
MyDatabase.dbo.Orders) — no database selection is needed in config.Добавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"mssql-mcp": {
"command": "npx",
"args": []
}
}
}Query your database in natural language
Read-only database access with schema inspection.
Interact with Redis key-value stores.
Database interaction and business intelligence capabilities.