Analyze T-SQL scripts for design, naming, and performance issues and prevent bad practices.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste into ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)
A library of SQL best practices implemented as over 140 database code analysis rules checked at build time.
The rules can be added as NuGet packages to SQL Database projects:
For a complete list of the current rules we have implemented see here.
The latest version is available on NuGet
The rules are available as a NuGet package that can be added to your SQL Database project. The rules will run during build, and report any issues in the Error List window.
You can read more about using and customizing the rules in the docs here
You can download and manually use the rules with Visual Studio and "classic" SQL Database projects, as described in my blog post here.
This repository also contains a .NET command line tool that uses the rule set.
You can use it to analyze SQL scripts or SQL Database projects and output the results in a variety of formats, including XML and JSON.
You can also use the tool as an MCP Server with GitHub Copilot in VS Code and Visual Studio, allowing you to get feedback on your SQL code using GitHub Copilot Chat.
The T-SQL Analyzer MCP Server supports quick installation across multiple development environments. Choose your preferred client below for streamlined setup:
| Client | One-click Installation | MCP Guide |
|---|---|---|
| VS Code | VS Code MCP Official Guide | |
| Visual Studio | Visual Studio MCP Official Guide |
Read more in the dedicated readme file
This repository also contains a Visual Studio extension that uses the rule set.
Run live analysis of your SQL scripts in Visual Studio and get the results in the Error List window.
Download the extension from the Visual Studio Marketplace or get the CI build
Read more in the dedicated readme file
This repository also contains a SQL Server Management Studio extension that uses the rule set.
Run live analysis of your SQL scripts in SQL Server Management Studio and get the results in the Error List window.
Download the latest build of this extension from the SSMS VSIX Gallery
Read more in the dedicated readme file
This repository also contains a VS Code extension that uses the rule set.
Get live squiggles and diagnostics for your .sql files as you type in Visual Studio Code β no build step required.
Read more in the dedicated readme file
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/sqlserver-rules)<a href="https://allmcps.com/mcp/sqlserver-rules"><img src="https://allmcps.com/api/badge/sqlserver-rules?style=directory" alt="SqlServer.Rules on AllMCPs" /></a>