Skip to main content

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.

The test suite is built with xUnit (v2.9) and lives in the 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:
dotnet test MssqlMcp.sln -c Release
All unit tests execute with no additional setup. Integration tests are automatically skipped unless RUN_INSIGHTS_DB_TEST is set.

Test areas

Test classWhat it covers
SqlStatementClassifierTestsRead vs execute SQL routing
TriggerQualifiedNameTestsschema.table.trigger name parsing
InsightsLayerEnvironmentTestsEnv var opt-out semantics
InsightsLayerNoOpTestsDisabled-layer behavior
SqlBatchSplitterTestsEmbedded SQL script splitting
GetServerInfoTestsServer info response shape
UnitTestsGeneral helpers
InsightsLayerDbSmokeTestsLive 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:
$env:RUN_INSIGHTS_DB_TEST = "1"
$env:CONNECTION_STRING = "Server=.;Database=TestDb;Trusted_Connection=True;TrustServerCertificate=True"
dotnet test MssqlMcp.sln -c Release
When 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.
Run the unit tests in CI without a database by simply omitting the RUN_INSIGHTS_DB_TEST environment variable. All database-dependent tests use Xunit.SkippableFact and are automatically skipped, so the pipeline will pass even without a SQL Server instance available.

Build docs developers (and LLMs) love