The server’s security posture is primarily about credential management and SQL injection risk, because it executes T-SQL directly against a live database on every tool call. Understanding these risks is essential before deploying in any shared or production environment. The sections below cover the four main areas of concern: how credentials flow, which tools are explicitly flagged as destructive, where SQL injection exposure exists, and what database permissions the AI Insights layer requires.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/A-Point-Systems-ltd/ms-sql-mcp/llms.txt
Use this file to discover all available pages before exploring further.
Credential management
TheCONNECTION_STRING environment variable is the only credential the server needs. It must be provided through the MCP client configuration env block and must never appear in source control.
Program.cs logs a masked version of the connection string: any key whose name contains password or pwd (case-insensitive) is replaced with ***MASKED***, while all other fields remain visible in the log. This means secrets embedded in non-standard key names could still appear in log output.
To minimise what is written to log files, prefer Windows Authentication (Trusted_Connection=True) or Microsoft Entra / Azure AD authentication rather than SQL login with a password.
Destructive tool flags
Three tools are explicitly markedDestructive = true and ReadOnly = false in their MCP metadata:
| Tool | MCP flags | Risk |
|---|---|---|
ExecuteSQL | write, destructive | Runs arbitrary DDL/DML — ALTER, DROP, TRUNCATE, DELETE, MERGE, EXEC, … |
DropTable | write, destructive | Permanently removes a table and all its data |
UpdateData | write, destructive | Modifies existing rows; always requires a WHERE clause |
SQL injection
ReadData and ExecuteSQL do not support parameterized queries. SQL statements are assembled as literals and sent directly to the database engine. This is by design — the tools are intended to accept agent-generated SQL, not arbitrary user input.
If your deployment exposes the MCP server to multiple users or to a public-facing LLM, consider:
- Running the server with a read-only SQL login when write tools are not needed
- Restricting the database user to a specific schema or set of objects
- Using a dedicated database that contains no sensitive production data
DDL trigger permissions
The AI Insights layer installs a database-level DDL trigger (DDL_Audit) via InstallInsightsLayer. Creating a database-level DDL trigger requires one of the following:
ALTER ANY DATABASE DDL TRIGGERpermission (fine-grained, preferred)- Membership in the
ddl_adminfixed database role - Membership in the
sysadminfixed server role
ALTER ANY DATABASE DDL TRIGGER to a dedicated service account or database role rather than elevating to ddl_admin or sysadmin. The trigger runs with database scope and captures DDL events (table creates, alters, drops) into dbo.DDL_AuditLog for freshness tracking.
Install is idempotent — re-running InstallInsightsLayer after the trigger already exists is safe and will not duplicate objects.
Read/write routing
TheSqlStatementClassifier enforces a strict split between read and write paths to prevent accidental destructive operations through the wrong tool:
ReadData— accepts onlySELECTand read-onlyWITH … SELECT(CTEs that end in aSELECT).SELECT … INTOis rejected.ExecuteSQL— accepts DDL and DML only. AnySELECTstatement is rejected with a message directing the caller toReadData.
GO-delimited scripts are not supported by ExecuteSQL — split them into individual statements before calling the tool.