commit-transaction
Commit a transaction
Query a SQL Server database, read its tables and stored procedures, and wrap a sequence of statements in a transaction you can roll back.
LABSCO SUMMARY
start-transaction hands back an ID that commit-transaction and rollback-transaction take, which is what makes a sequence of writes something you can abandon rather than repair. The introspection surface is deliberately narrow — tables and stored procedures, by list or by name — enough to write a query against, not a schema browser. Everything runs as the account in DB_USERNAME, so that account's permissions are the real boundary on what any of it can do.
A SQL Server client with schema listing, stored-procedure lookup and explicit transaction control.
A reachable SQL Server instance and five environment variables — DB_HOST, DB_PORT, DB_USERNAME, DB_PASSWORD and DB_DATABASE.
One command plus credentials — npx -y mcp-node-mssql, then supply credentials
USE CASES
Names rarely describe the side effects. The definition settles what a procedure touches.
The transaction ID ties the statements together, so an unexpected result ends in a rollback rather than a repair script.
The table list gives you the map and a single table gives you the detail, which is usually enough to write the first query.
Counted once with only startup setup. Other versions, modes or optional credentials may expose a different list.
commit-transactionCommit a transaction
get-stored-procedureGet a specific stored procedure by name
get-stored-proceduresGet a list of all stored procedures in the database
get-tableGet a specific table by name
get-tablesGet a list of all tables in the database
queryQuery the database with a SQL statement
rollback-transactionRollback a transaction
start-transactionStart a new transaction
BEFORE YOU INSTALL
8 tools when we connected. Five tools inspect schema and stored procedures, three drive transactions, and all writes go through the query tool, which runs any SQL you pass. No read-only switch is documented.
CONTEXT COST
Rated by the size of the 8 tool definitions that ride along on every turn, not by how many there are
INSTALLATION
npx -y mcp-node-mssql{
"mcpServers": {
"mssql": {
"command": "npx",
"args": [
"-y",
"mcp-node-mssql"
],
"env": {
"DB_HOST": "localhost",
"DB_PORT": "1433",
"DB_USERNAME": "<YOUR_DB_USERNAME>",
"DB_PASSWORD": "<YOUR_DB_PASSWORD>",
"DB_DATABASE": "<YOUR_DB_DATABASE>",
"CONNECTION_TIMEOUT": 600000,
"REQUEST_TIMEOUT": 300000,
"DB_ENCRYPT": "false",
"DB_ENABLE_ARITH_ABORT": "false",
"DB_TRUST_SERVER_CERTIFICATE": "false",
"TRUSTED_CONNECTION": "false"
}
}
}
}git clone https://github.com/cwilby/mcp-node-mssql.git
cd mcp-node-mssql
npm install
npm run buildReference your local build; <YOUR_PATH_TO_LOCAL>/mcp-node-mssql is the full path of your clone:
{
"mcpServers": {
"mssql": {
"command": "node",
"args": [
"<YOUR_PATH_TO_LOCAL>/mcp-node-mssql/dist/index.js"
],
"env": {
"DB_HOST": "localhost",
"DB_PORT": "1433",
"DB_USERNAME": "<YOUR_DB_USERNAME>",
"DB_PASSWORD": "<YOUR_DB_PASSWORD>",
"DB_DATABASE": "<YOUR_DB_DATABASE>",
"CONNECTION_TIMEOUT": 600000,
"REQUEST_TIMEOUT": 300000,
"DB_ENCRYPT": "false",
"DB_ENABLE_ARITH_ABORT": "false",
"DB_TRUST_SERVER_CERTIFICATE": "false",
"TRUSTED_CONNECTION": "false"
}
}
}
}