What this kind of tool is for
- Query, inspect, or seed a database without writing a one-off script.
- Let your agent look up schema details before it writes migration code.
- Move a small dataset between tools without leaving the terminal.
How to compare servers like this
- Engine match:
- Confirm it speaks your exact database and version, not just the family.
- Access scope:
- Read-only connections are the safe default — start there before granting writes.
- Safety rails:
- Check whether destructive statements need an explicit confirmation before they run.
- Maintenance signal:
- Database drivers change; a recently updated tool is less likely to break mid-query.
This page carries your copy-paste config: pick your MCP client in the install section on this page and use the copy button.
What is the Microsoft SQL Server MCP server?
Read-only-by-default SQL Server: schema, parameterized SELECT, execution plans; writes opt-in.
How to install Microsoft SQL Server
Copy-paste configuration for popular MCP clients.
MCPMSSQL_CONNECTION_STRINGsecretDefault profile SQL Server connection string (often contains secrets). Optional if profiles are only in user appsettings.
MCPMSSQL_DESCRIPTIONOptional human-readable description for the default profile.
MCPMSSQL_QUERY_MAX_ROWSMax rows per interactive query (default 500; ceiling 1000).
MCPMSSQL_QUERY_COMMAND_TIMEOUT_SECONDSInteractive query command timeout in seconds (default 30).
MCPMSSQL_QUERY_SNAPSHOT_MAX_ROWSMax rows for snapshot queries (default 10000; ceiling 50000).
MCPMSSQL_QUERY_SNAPSHOT_COMMAND_TIMEOUT_SECONDSSnapshot query timeout in seconds (default 120).
MCPMSSQL_ANALYZE_COMMAND_TIMEOUT_SECONDSExecution plan analysis timeout in seconds (default 300; ceiling 600).
MCPMSSQL_ALLOW_WRITEEnable 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_SECONDSWrite command timeout in seconds (default 60; ceiling 600).
DOTNET_ENVIRONMENTSet to Development to load dotnet user-secrets (local dev).
{
"mcpServers": {
"mcp-mssql": {
"command": "dnx",
"args": [
"Alyio.McpMssql"
],
"env": {
"MCPMSSQL_CONNECTION_STRING": "<YOUR_MCPMSSQL_CONNECTION_STRING>",
"MCPMSSQL_DESCRIPTION": "<YOUR_MCPMSSQL_DESCRIPTION>",
"MCPMSSQL_QUERY_MAX_ROWS": "<YOUR_MCPMSSQL_QUERY_MAX_ROWS>",
"MCPMSSQL_QUERY_COMMAND_TIMEOUT_SECONDS": "<YOUR_MCPMSSQL_QUERY_COMMAND_TIMEOUT_SECONDS>",
"MCPMSSQL_QUERY_SNAPSHOT_MAX_ROWS": "<YOUR_MCPMSSQL_QUERY_SNAPSHOT_MAX_ROWS>",
"MCPMSSQL_QUERY_SNAPSHOT_COMMAND_TIMEOUT_SECONDS": "<YOUR_MCPMSSQL_QUERY_SNAPSHOT_COMMAND_TIMEOUT_SECONDS>",
"MCPMSSQL_ANALYZE_COMMAND_TIMEOUT_SECONDS": "<YOUR_MCPMSSQL_ANALYZE_COMMAND_TIMEOUT_SECONDS>",
"MCPMSSQL_ALLOW_WRITE": "<YOUR_MCPMSSQL_ALLOW_WRITE>",
"MCPMSSQL_WRITE_COMMAND_TIMEOUT_SECONDS": "<YOUR_MCPMSSQL_WRITE_COMMAND_TIMEOUT_SECONDS>",
"DOTNET_ENVIRONMENT": "<YOUR_DOTNET_ENVIRONMENT>"
}
}
}
}Related MCP servers

OpenAPI Services
MCP server that fronts any OpenAPI service: discover operations from its spec and call them

MCP server for Walmart Connect Ads, Sam's Club Sponsored Ads, and Walmart Marketplace APIs
Personal AI travel agent. Points optimization, live flight/hotel/award search, trip planning.
View repository →
io.github.amadeuserras/leaseclear-mcp
MCP server for LeaseClear lease Q&A.
