home / mcp / t-sql analyzer mcp server
120+ T-SQL static code analysis rules for SQL Database Projects
Configuration
View docs{
"mcpServers": {
"erikej-sqlserver.rules": {
"url": "https://vscode.dev/redirect/mcp/install?name=tsqlanalyzer&config=%7B%22name%22%3A%22tsqlanalyzer%22%2C%22command%22%3A%22dnx%22%2C%22args%22%3A%5B%22ErikEJ.DacFX.TSQLAnalyzer.Cli%22%2C%22--yes%22%2C%22--%22%2C%22-mcp%22%5D%7D"
}
}
}You can analyze SQL scripts and SQL Database projects for best-practice rules using the T-SQL Analyzer MCP Server. It provides a fast feedback loop across editors like VS Code and Visual Studio, helping you improve SQL quality throughout development.
Install and connect to the T-SQL Analyzer MCP Server from your preferred MCP client. You can use the one-click installation URL to add the server to the MCP ecosystem in VS Code or Visual Studio. Once installed, run analyses against your SQL scripts or SQL Database projects to receive rule-based feedback in your editor’s error list or via the CLI.
Prerequisites: ensure you have a modern development environment with Node.js and npm installed if you plan to use the MCP CLI path. You may also use the one-click installation options in your MCP client for a streamlined setup.
Step 1: Open your MCP client (VS Code or Visual Studio) and choose the T-SQL Analyzer MCP Server installation option. Use the provided one-click URL to add the server to your environment.
{
"mcpServers": {
"tsqlanalyzer": {
"command": "http",
"url": "https://vscode.dev/redirect/mcp/install?name=tsqlanalyzer&config=%7B%22name%22%3A%22tsqlanalyzer%22%2C%22command%22%3A%22dnx%22%2C%22args%22%3A%5B%22ErikEJ.DacFX.TSQLAnalyzer.Cli%22%2C%22--yes%22%2C%22--%22%2C%22-mcp%22%5D%7D"
}
}
}If you prefer using the command-line interface, you can leverage the T-SQL Analyzer CLI as part of the MCP workflow. The MCP server supports quick installation across multiple development environments, making it easy to integrate analyses into your usual editing and build processes.
The T-SQL Analyzer MCP Server exposes two primary tools you can use in your workflow: the command line tool to run rule analysis against SQL scripts or SQL Database projects, and a Visual Studio extension to run live analysis directly inside Visual Studio.
- The MCP server is designed to provide immediate feedback during development, helping you catch rule violations early. - If you encounter connectivity or install issues, verify you are using the official MCP installation URL and that your editor is configured to communicate with MCP servers in your environment.
Command line tool to analyze SQL scripts and SQL Database projects and report results in formats such as XML and JSON.
Visual Studio extension to run live analysis against SQL Database projects and display results in the Error List window.