execute_sqlLABSCO SUMMARY
Full SQL access to a SQL Server instance, with schema discovery so the agent can find its way first.
list_schemas and list_tables let an agent map the database before it writes anything, which is the part that otherwise takes several failed queries. execute_sql then runs whatever statement you want — writes and DDL included — so the grants on the login in your connection string are the boundary, not the tool.
What it is
A .NET server that puts three tools over one SQL Server connection: the schemas the instance holds, the tables inside them, and a SQL statement of your own.
What you get
- Every schema or database the connection can see on the instance
- The tables, with schema, name, type and row count for each
- Any SQL you write, run as-is — SELECT, INSERT, UPDATE, DELETE and DDL all go through the same call
- Results laid out as tables rather than raw rows
- A connectivity check on startup, so a bad connection string fails before the first question
Requirements
One environment variable, MSSQL_CONNECTION_STRING, holding a complete connection string — Windows authentication, SQL Server authentication and Azure SQL forms all work. Runs as a .NET application or from the Docker image the repository builds.
Setup effort
Run a container — build the image from the repository, then point your client at it
USE CASES
Finding your way around a database nobody documented
List the schemas, then the tables in the one you care about — the row counts come back with the table list, so you can tell the real tables from the leftovers.
Answering a question that needs a join you have not written yet
Read the table layout first, then run the SELECT in the same conversation and get the rows back as a formatted table.
Applying a data fix you have already agreed on
Run the UPDATE or DELETE directly instead of pasting it into a client — the same call also takes DDL.
Checking a connection string before you trust it
The server validates the database connection when it starts, so a wrong host or password shows up at launch rather than mid-task.
3 tools
Listed in project docs. Your client may show a different list.
list_tableslist_schemasBEFORE YOU INSTALL
What to know first
Tools you get
3 tools named in the project's documentation.
Requires
- docker on PATH
- .NET 9 SDK (dotnet) to build the image
- MSSQL_CONNECTION_STRING in your environment
Where it runs
Both documented clients run the server on your machine.
INSTALLATION
Connect your client
Build the image from the repository, then point your client at it.
Server setup
Install the .NET 9 SDK — the image is built with dotnet, and nothing is published to a registry
git clone https://github.com/Aaronontheweb/mssql-mcp.git
cd mssql-mcp
dotnet publish --os linux --arch x64 /t:PublishContainerAdd the block for your client below — it runs the local mssql-mcp:latest image this build just created
MCP Clients
Cursor, Claude Desktop
{
"mcpServers": {
"mssql": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"MSSQL_CONNECTION_STRING",
"mssql-mcp:latest"
],
"env": {
"MSSQL_CONNECTION_STRING": "Server=host.docker.internal,1533; Database=MyDb; User Id=myUser; Password=My(!)Password;TrustServerCertificate=true;"
}
}
}
}