list_profilesLABSCO SUMMARY
Says plainly that its write lock is not a security boundary.
AllowWrite defaults to false and the write tool rejects at call time on locked profiles — but the README states outright that this is an application-level guard constraining the server, not the database, and points you at a db_datareader login for a real read-only guarantee. That honesty is worth more than the flag. Plan and snapshot resources expire on their own, at 7 days and 1 day, so nothing accumulates.
What it is
A .NET MCP server for Microsoft SQL Server built for safe exploration: metadata discovery, parameterized queries and query analysis, organised around named connection profiles. The query tools enforce SELECT-only with no DML or DDL, and the one tool that can write is rejected unless its profile opts in.
What you get
- Configured connection profiles listed, so a multi-database setup is discoverable —
list_profiles - Server properties and the live execution limits — timeouts, row caps, guardrails —
get_server_properties - Catalog metadata by kind: databases, schemas, tables and views, procedures and functions —
list_objects; and one relation or routine in detail withcolumns,indexes,constraintsordefinition—get_object - Read-only T-SQL executed with
@paramNamebinding, returned as CSV inline (limit 500 rows, hard ceiling 1000) or as a snapshot resource for larger results —run_query - An execution plan summarised as compact JSON — cost, operators, cardinality, warnings, indexes, waits and stats — with the full XML fetched from
plan_uri—analyze_query - Write T-SQL for profiles that set
AllowWrite=true, returningrows_affectedand server messages, marked destructive —run_command - The same data as browsable resources:
mssql://profiles,mssql://server-properties,mssql://objects, plusmssql://plans/{id}(XML, expires after 7 days) andmssql://snapshots/{id}(CSV, expires after 1 day)
Requirements
A SQL Server instance and a connection string in MCPMSSQL_CONNECTION_STRING, plus a .NET 8.0 or later runtime for the global tool — it targets net8.0 and net10.0 — or the .NET 10 SDK for the client configurations, which launch it with dotnet dnx. Install it as a global tool with dotnet tool install --global Alyio.McpMssql --prerelease and run mcp-mssql over stdio; the published version is 1.2.0. For several databases, use the user-scoped appsettings.json under ~/.config/mcp-mssql/. Tunables are all MCPMSSQL_-prefixed environment variables: MCPMSSQL_QUERY_MAX_ROWS (default 500, ceiling 1000), MCPMSSQL_QUERY_COMMAND_TIMEOUT_SECONDS (default 30), MCPMSSQL_ALLOW_WRITE (default false). Azure SQL works through Microsoft Entra authentication modes set in the connection string. MIT licensed.
Setup effort
One command plus credentials — dotnet tool install --global Alyio.McpMssql --prerelease, then supply credentials
USE CASES
Understanding a database you have never seen
List the catalogs, then the schemas and relations, then pull one table's columns, indexes and constraints.
Answering a question without risking a write
Run a parameterized SELECT and get CSV back, with the row cap enforced by the server rather than by your discipline.
Working out why a query is slow
Analyze the plan for a cost, operator and cardinality summary with warnings and index notes, then fetch the full XML if you need it.
Pulling a result set too big to inline
Set snapshot mode and read the result back from its mssql://snapshots/{id} resource instead of flooding the conversation.
Keeping the warehouse read-only while a migration profile can write
Define separate profiles in appsettings.json and set AllowWrite on only the one that needs it.
7 tools
Listed in project docs. Your client may show a different list.
get_server_propertieslist_objectsget_objectrun_queryanalyze_queryrun_commandBEFORE YOU INSTALL
What to know first
Tools you get
7 tools named in the project's documentation.
Requires
- .NET 10.0.100 SDK or later for the client configs, which launch it with dotnet dnx (the global tool alone needs a .NET 8.0 or later runtime)
- MCPMSSQL_CONNECTION_STRING in your environment
Where it runs
All 5 documented clients run the server on your machine.
INSTALLATION
Connect your client
Server setup
dotnet tool install --global Alyio.McpMssql --prereleaseMCP Clients
Cursor, Claude Code
{
"mcpServers": {
"mssql": {
"command": "dotnet",
"args": [
"dnx",
"Alyio.McpMssql",
"--prerelease",
"--yes"
],
"env": {
"MCPMSSQL_CONNECTION_STRING": "Server=127.0.0.1;User ID=sa;Password=<YOUR_STRONG_PASSW0RD>;Encrypt=True;TrustServerCertificate=True;"
}
}
}
}Codex
[mcp_servers.mssql]
command = "dotnet"
args = ["dnx", "Alyio.McpMssql", "--prerelease", "--yes"]
[mcp_servers.mssql.env]
MCPMSSQL_CONNECTION_STRING = "Server=127.0.0.1;User ID=sa;Password=<YOUR_STRONG_PASSW0RD>;Encrypt=True;TrustServerCertificate=True;"OpenCode
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"mssql": {
"type": "local",
"enabled": true,
"command": [
"dotnet",
"dnx",
"Alyio.McpMssql",
"--prerelease",
"--yes"
],
"environment": {
"MCPMSSQL_CONNECTION_STRING": "Server=127.0.0.1;User ID=sa;Password=<YOUR_STRONG_PASSW0RD>;Encrypt=True;TrustServerCertificate=True;"
}
}
}
}GitHub Copilot
{
"inputs": [],
"servers": {
"mssql": {
"type": "stdio",
"command": "dotnet",
"args": [
"dnx",
"Alyio.McpMssql",
"--prerelease",
"--yes"
],
"env": {
"MCPMSSQL_CONNECTION_STRING": "Server=127.0.0.1;User ID=sa;Password=<YOUR_STRONG_PASSW0RD>;Encrypt=True;TrustServerCertificate=True;"
}
}
}
}