Microsoft SQL Server MCP Server
by alyioxio.github.alyiox/mcp-mssqlv1.6.1
Read-only-by-default SQL Server: schema, parameterized SELECT, execution plans; writes opt-in.
context tax
queued
security
queued
cold start
queued
freshness
Active18d ago
Install Microsoft SQL Server MCP server
Install in Claude Code
claude mcp add alyio-mcpmssql -e MCPMSSQL_CONNECTION_STRING='<mcpmssql-connection-string>' -- dnx Alyio.McpMssql --yesInstall in Cursor
{
"mcpServers": {
"alyio-mcpmssql": {
"command": "dnx",
"args": [
"Alyio.McpMssql",
"--yes"
],
"env": {
"MCPMSSQL_CONNECTION_STRING": "<mcpmssql-connection-string>"
}
}
}
}Add to ~/.cursor/mcp.json (global) or .cursor/mcp.json (project).
Install in Claude Desktop
{
"mcpServers": {
"alyio-mcpmssql": {
"command": "dnx",
"args": [
"Alyio.McpMssql",
"--yes"
],
"env": {
"MCPMSSQL_CONNECTION_STRING": "<mcpmssql-connection-string>"
}
}
}
}Settings → Developer → Edit Config (claude_desktop_config.json), then restart.
Install in VS Code
{
"servers": {
"alyio-mcpmssql": {
"type": "stdio",
"command": "dnx",
"args": [
"Alyio.McpMssql",
"--yes"
],
"env": {
"MCPMSSQL_CONNECTION_STRING": "<mcpmssql-connection-string>"
}
}
}
}Add to .vscode/mcp.json in your workspace.
Install in Windsurf
{
"mcpServers": {
"alyio-mcpmssql": {
"command": "dnx",
"args": [
"Alyio.McpMssql",
"--yes"
],
"env": {
"MCPMSSQL_CONNECTION_STRING": "<mcpmssql-connection-string>"
}
}
}
}Add to ~/.codeium/windsurf/mcp_config.json.
Configuration
| Variable | Required | Secret | Description |
|---|---|---|---|
| MCPMSSQL_CONNECTION_STRING | — | yes | Default profile SQL Server connection string (often contains secrets). Optional if profiles are only in user appsettings. |
| MCPMSSQL_DESCRIPTION | — | — | Optional human-readable description for the default profile. |
| MCPMSSQL_QUERY_MAX_ROWS | — | — | Max rows per interactive query (default 500; ceiling 1000). |
| MCPMSSQL_QUERY_COMMAND_TIMEOUT_SECONDS | — | — | Interactive query command timeout in seconds (default 30). |
| MCPMSSQL_QUERY_SNAPSHOT_MAX_ROWS | — | — | Max rows for snapshot queries (default 10000; ceiling 50000). |
| MCPMSSQL_QUERY_SNAPSHOT_COMMAND_TIMEOUT_SECONDS | — | — | Snapshot query timeout in seconds (default 120). |
| MCPMSSQL_ANALYZE_COMMAND_TIMEOUT_SECONDS | — | — | Execution plan analysis timeout in seconds (default 300; ceiling 600). |
| MCPMSSQL_ALLOW_WRITE | — | — | Enable write commands (DDL/DML) via run_command on the default profile (default false). With no write-enabled profile the tool is not advertised at all. Soft guard only — prefer a db_datareader login for a hard read-only guarantee. |
| MCPMSSQL_WRITE_COMMAND_TIMEOUT_SECONDS | — | — | Write command timeout in seconds (default 60; ceiling 600). |
| DOTNET_ENVIRONMENT | — | — | Set to Development to load dotnet user-secrets (local dev). |
Freshness
Active — last maintenance signal 18d ago. The newest of the signals below sets the band.
Last commit (default branch)
2026-09-22 · 18d ago · GitHub
Latest release
no data · GitHub
Package published
no data · npm/PyPI
Registry entry updated
2026-09-15 · 25d ago · official registry · v1.6.1
FAQ
›How do I install the Microsoft SQL Server MCP server in Claude Code?
Run: claude mcp add alyio-mcpmssql -e MCPMSSQL_CONNECTION_STRING='<mcpmssql-connection-string>' -- dnx Alyio.McpMssql --yes. For Cursor, VS Code, Claude Desktop and Windsurf, use the install tabs above.
›Does Microsoft SQL Server require an API key?
Yes. It expects MCPMSSQL_CONNECTION_STRING, of which 1 is a secret.
›Can I use Microsoft SQL Server as a remote (hosted) MCP server?
No hosted endpoint is published; it runs locally over stdio.
›Is Microsoft SQL Server in the official MCP registry?
Yes, as io.github.alyiox/mcp-mssql.
Alternatives to Microsoft SQL Server
Other database MCP servers.