The `mssql-mcp-server` package provides a Model Context Protocol (MCP) server specifically designed for Microsoft SQL Server, enabling comprehensive database schema exploration and modernization planning. Currently at version 1.2.2, this server facilitates detailed analysis of database structures, including tables, views, stored procedures, triggers, and functions. It leverages the `tedious` library for pure JavaScript connectivity, supporting crucial features like Windows Authentication (NTLM), which necessitates explicit domain credentials through environment variables for secure, non-interactive background processes. Key differentiators include its extensive suite of 29 analytical tools, capabilities for extracting full SQL source code from stored procedures for business logic analysis, and a focus on assisting with modernization efforts for applications like Classic ASP to modern .NET/Angular architectures. While a specific release cadence isn't detailed, the project appears actively maintained with recent updates focused on enhancing core analysis capabilities.
npm install mssql-mcp-serverVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to programmatically initialize and start the `mssql-mcp-server` using environment variables for SQL Server connection details, including NTLM authentication. It then shows a hypothetical HTTP POST request to the running server to execute the `test_connection` tool, simulating how an external client or AI agent would interact with the server's API.
Ensure `SQL_SERVER_USER`, `SQL_SERVER_PASSWORD`, and `SQL_SERVER_DOMAIN` environment variables are correctly set for the process running the MCP server.
Review `trustServerCertificate` option in `MssqlMcpServerOptions`. For production, ensure valid SSL certificates are used and configured, setting `trustServerCertificate: false`.
Adhere to the documented limitations of specific tools. For larger data extraction, consider direct SQL client access or alternative tools. Use `execute_query` only for read-only queries.
Verify `SQL_SERVER_USER`, `SQL_SERVER_PASSWORD`, and `SQL_SERVER_DOMAIN` environment variables match valid domain credentials with access to the SQL Server instance. Check SQL Server logs for detailed login failure reasons.
Confirm `SQL_SERVER_HOST` and `SQL_SERVER_PORT` environment variables are correct. Check network connectivity, firewall rules (both client and server), and ensure the SQL Server instance is running and configured to accept remote connections.
Ensure the `MssqlMcpServer` is initialized with a valid `MssqlMcpServerOptions` object, specifically providing at least one connection configuration under the `connections` property.