PluginBench
MCP Server
Active
MIT

io.github.ErikEJ/SqlServer.Rules MCP Server

io.github.ErikEJ/SqlServer.Rules

Analyze T-SQL scripts for design, naming, and performance issues with 140+ static code analysis rules.

What is the io.github.ErikEJ/SqlServer.Rules MCP server?

The SqlServer.Rules MCP server is a static analysis tool that checks T-SQL scripts and SQL Database projects against over 140 best practice rules for design, naming conventions, and performance. It integrates with AI agents via MCP to provide SQL code quality feedback and prevent bad practices during development.

SqlServer.Rules enforces SQL best practices through a comprehensive rule set covering design patterns, naming conventions, and performance issues. You can use it to analyze T-SQL scripts and SQL projects at build time, in your IDE, or via the command-line tool. The MCP server integration allows GitHub Copilot and other AI agents to provide real-time SQL code quality feedback.

How to install io.github.ErikEJ/SqlServer.Rules

Copy-paste configuration for popular MCP clients.

transport: stdio
Config generated by PluginBench — verify against the source before use.
Claude Desktop
~/Library/Application Support/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "SqlServer-Rules": {
      "command": "dnx",
      "args": [
        "ErikEJ.DacFX.TSQLAnalyzer.Cli",
        "-mcp"
      ]
    }
  }
}
Cursor
~/.cursor/mcp.json
{
  "mcpServers": {
    "SqlServer-Rules": {
      "command": "dnx",
      "args": [
        "ErikEJ.DacFX.TSQLAnalyzer.Cli",
        "-mcp"
      ]
    }
  }
}
Windsurf
~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "SqlServer-Rules": {
      "command": "dnx",
      "args": [
        "ErikEJ.DacFX.TSQLAnalyzer.Cli",
        "-mcp"
      ]
    }
  }
}
VS Code
.vscode/mcp.json
{
  "servers": {
    "SqlServer-Rules": {
      "type": "stdio",
      "command": "dnx",
      "args": [
        "ErikEJ.DacFX.TSQLAnalyzer.Cli",
        "-mcp"
      ]
    }
  }
}
Claude Code
claude mcp add SqlServer-Rules -- dnx ErikEJ.DacFX.TSQLAnalyzer.Cli -mcp

Tools & capabilities

Tools this server exposes to the agent.

  • T-SQL AnalysisAnalyze T-SQL scripts and SQL Database projects against 140+ static code analysis rules
  • Rule CheckingCheck for design, naming, and performance issues in SQL code
  • Multiple Output FormatsOutput analysis results in XML, JSON, and other formats
  • Build-time IntegrationRun rules during SQL Database project builds in Visual Studio

Use cases

  • Enforce SQL naming conventions and design patterns across your team's codebase
  • Identify performance anti-patterns and design issues in T-SQL scripts before deployment
  • Integrate SQL code quality checks into CI/CD pipelines using the CLI tool
  • Get real-time SQL code feedback in VS Code or Visual Studio via Copilot Chat
  • Analyze legacy SQL Database projects for compliance with best practices

io.github.ErikEJ/SqlServer.Rules MCP server FAQ

What is the SqlServer.Rules MCP server?

It's a static analysis tool that checks T-SQL code against 140+ best practice rules for design, naming, and performance. The MCP server version allows AI agents like GitHub Copilot to analyze your SQL code and provide feedback.

Is it free?

Yes, the SqlServer.Rules library and CLI tool are open source and free to use.

How do I install it in VS Code or Visual Studio?

Use the one-click installation buttons provided in the README for VS Code or Visual Studio. Alternatively, install the NuGet package ErikEJ.DacFX.TSQLAnalyzer.Cli and configure it as an MCP server.

What authentication is required?

No authentication is required. The tool runs locally on your machine.

Can I use this with SQL Database projects?

Yes, the rules work with both modern SDK-style projects (MSBuild.Sdk.SqlProj and Microsoft.Build.Sql) and classic .sqlproj projects in Visual Studio.

What kinds of issues does it detect?

It detects design issues, naming convention violations, performance anti-patterns, and other SQL best practice violations across 140+ rules.

README (reference)

Source of truth, from the repository.

Static Analysis Rule-sets for SQL Projects

MCP Toplist

build status latest version GitHub Sponsors

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:

For a complete list of the current rules we have implemented see here.

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"]
    VSC["VS Code T-SQL Analyzer<br/>Live feedback in Visual Studio Code"]
    CLI["T-SQL Analyzer CLI<br/>tsqlanalyze command line tool"]
    MBSQL["SQL Database Projects<br/>Build-time SQL Project analysis"]
    RULES["SqlServer.Rules<br/>(NuGet package)<br/>Static SQL code analysis rules"]
    MCP["MCP Server<br/>AI Agent integration for SQL code analysis rules"]

    VS --> CLI
    SSMS --> CLI
    VSC --> CLI
    CLI --> RULES
    MBSQL --> RULES
    MCP --> CLI

Usage

The latest version is available on NuGet

dotnet add package ErikEJ.DacFX.SqlServer.Rules

Modern 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:

ClientOne-click InstallationMCP Guide
VS CodeInstall in VS CodeVS Code MCP Official Guide
Visual StudioInstall in Visual StudioVisual Studio MCP Official Guide

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

VS Code extension - T-SQL Analyzer

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

Related MCP servers

Control a real Chrome browser to complete any task: fill forms, extract data, book flights.

110k
Python
MIT
View repository →

Real-time global intelligence: markets, conflicts, country risk, energy, and infrastructure monitoring via 39 MCP tools.

83k
TypeScript
AGPL-3.0
View repository →

Netdata

Active

Real-time infrastructure monitoring with per-second metrics, ML-powered anomaly detection, and zero-configuration setup.

80k
Go
GPL-3.0
View repository →

Trending hip-hop artist momentum scores across four cultural dimensions.

79k
TypeScript
MIT
View repository →

AI orchestration platform with 100+ agents, swarm coordination, and self-learning memory for enterprise development.

68k
TypeScript
MIT
View repository →

Web scraping with stealth HTTP, real browsers, and Cloudflare bypass capabilities.

67k
Python
BSD-3-Clause
View repository →