T-SQL Analyzer
Integrates with GitHub repositories for SQL code analysis, as evidenced by the build status badge and GitHub actions workflow references.
Uses GitHub Actions for CI/CD pipeline execution, showing build status via badges.
Generates documentation in Markdown format from rule inspection, stored in the docs directory.
Built as .NET libraries and tools, providing static code analysis rules for SQL Server projects within the .NET ecosystem.
Publishes SQL rules as NuGet packages that can be added to SQL database projects, with direct integration via 'dotnet add package' commands.
Displays build status and package version badges from Shields.io in the README.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@T-SQL Analyzeranalyze this stored procedure for performance issues"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Static Analysis Rule-sets for SQL Projects
Overview
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:
Modern SDK-style projects: MSBuild.Sdk.SqlProj and Microsoft.Build.Sql
Classic .sqlproj: Legacy SSDT projects (Visual Studio 2017+ required)
For a complete list of the current rules we have implemented see here.
Related MCP server: MySQL Navigator MCP
Component Stack
flowchart TD
VS["Visual Studio T-SQL Analyzer<br/>Live feedback in Visual Studio"]
SSMS["SSMS T-SQL Analyzer<br/>Live feedback in SQL Server Management Studio"]
CLI["T-SQL Analyzer CLI<br/>tsqlanalyze command line tool"]
CLILIB["ErikEJ.DacFX.TSQLAnalyzer (CLI NuGet library)<br/>Loads scripts and executes analysis"]
MBSQL["SDK Style SQL Database Projects<br/>Build-time SQL Project analysis"]
CLASSIC["Classic .sqlproj<br/>Build-time SQL Project analysis"]
RULES["SqlServer.Rules<br/>Static SQL code analysis rules"]
MCP["MCP Server<br/>AI Agent integration for SQL code analysis rules"]
VS --> CLI
SSMS --> CLI
CLASSIC --> RULES
CLI --> CLILIB
CLILIB --> RULES
MBSQL --> RULES
MCP --> CLIUsage
The latest version is available on NuGet
dotnet add package ErikEJ.DacFX.SqlServer.RulesModern SDK-style Projects
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
Classic .sqlproj Projects
You can download and manually use the rules with Visual Studio and "classic" SQL Database projects, as described in my blog post here.
Command line tool - T-SQL Analyzer CLI
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 | ||
Visual Studio |
Read more in the dedicated readme file
Visual Studio extension - T-SQL Analyzer
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
SQL Server Management Studio extension - T-SQL Analyzer
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 server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/ErikEJ/SqlServer.Rules'
If you have feedback or need assistance with the MCP directory API, please join our Discord server