The test suite is built with xUnit (v2.9) and lives in theDocumentation 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.
MssqlMcp.Tests project. It is split into two tiers: unit tests that run entirely in memory with no live database dependency, and live-DB integration smoke tests that are skipped by default and must be explicitly opted into. The majority of coverage — SQL routing, name parsing, environment semantics, batch splitting, and response shape — runs without any database.
Run unit tests
Run the full solution test pass with:RUN_INSIGHTS_DB_TEST is set.
Test areas
| Test class | What it covers |
|---|---|
SqlStatementClassifierTests | Read vs execute SQL routing |
TriggerQualifiedNameTests | schema.table.trigger name parsing |
InsightsLayerEnvironmentTests | Env var opt-out semantics |
InsightsLayerNoOpTests | Disabled-layer behavior |
SqlBatchSplitterTests | Embedded SQL script splitting |
GetServerInfoTests | Server info response shape |
UnitTests | General helpers |
InsightsLayerDbSmokeTests | Live DB integration (skipped unless RUN_INSIGHTS_DB_TEST=1) |
Integration tests
InsightsLayerDbSmokeTests exercises the AI Insights layer against a real SQL Server instance. To enable it, set both RUN_INSIGHTS_DB_TEST and CONNECTION_STRING before running the test command:
CONNECTION_STRING is not set, the test project falls back to (localdb)\MSSQLLocalDB. Ensure SQL Server LocalDB is installed if you rely on that default.
The integration tests install and exercise the full AI Insights schema (AIInsights.SchemaInsights, DDL_Audit trigger, etc.) against the target database. They are safe to run repeatedly because InstallInsightsLayer is idempotent.