# SqlServer.Rules T-SQL Analyzer MCP server

> Analyze T-SQL scripts for design, naming and performance problems using more than 140 static code analysis rules.

- Listing: https://mcp.tc/i/sqlserver-rules-t-sql-analyzer
- Connect: this is a local (stdio) server; install it on your machine (see Install). The listing link is a page, not an MCP endpoint.
- Type: local (stdio)
- Auth: no API key needed
- Category: [Databases & Backend](https://mcp.tc/c/databases)
- Vendor: ErikEJ
- Repository: <https://github.com/ErikEJ/SqlServer.Rules>
- Package: nuget `ErikEJ.DacFX.TSQLAnalyzer.Cli`

## About

Runs the SqlServer.Rules static analysis rule set against T-SQL scripts from your AI assistant. The rules check for design, naming and performance issues and flag bad practices, so you can get feedback on SQL code in chat, for example in GitHub Copilot Chat.

It runs locally over stdio as the .NET tool ErikEJ.DacFX.TSQLAnalyzer.Cli, started with dnx and the -mcp argument. The README lists one-click setup for VS Code and Visual Studio. No sign-in or API key is mentioned.

## What it can do

- Analyze T-SQL scripts against more than 140 code analysis rules
- Find design, naming and performance issues in SQL code
- Get SQL feedback inside GitHub Copilot Chat
- Install from VS Code or Visual Studio with one click

## Example prompts

- "Analyze this T-SQL script for bad practices"
- "Check my stored procedure for naming and performance issues"
- "Review the SQL files in this project with the T-SQL analyzer"
- "Which design problems does this CREATE TABLE script have?"

## Install

### Claude Code

1. Run this in a terminal, in your project folder:

```bash
claude mcp add --transport stdio sqlserver-rules-t-sql-analyzer -- dnx ErikEJ.DacFX.TSQLAnalyzer.Cli --yes
```

2. Start Claude Code and type `/mcp`. **sqlserver-rules-t-sql-analyzer** should show as connected.

Add `--scope user` to make it available in every project.

### Claude Desktop

1. Open **Settings → Developer → Edit Config**. It opens `claude_desktop_config.json`. Add:

`claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "sqlserver-rules-t-sql-analyzer": {
      "command": "dnx",
      "args": [
        "ErikEJ.DacFX.TSQLAnalyzer.Cli",
        "--yes"
      ]
    }
  }
}
```

2. Save the file and restart Claude Desktop.

Needs .NET 10 on your computer. The file lives in `~/Library/Application Support/Claude/` on macOS and `%APPDATA%\Claude\` on Windows.

### Cursor

[Add to Cursor](<https://cursor.com/install-mcp?name=sqlserver-rules-t-sql-analyzer&config=eyJjb21tYW5kIjoiZG54IiwiYXJncyI6WyJFcmlrRUouRGFjRlguVFNRTEFuYWx5emVyLkNsaSIsIi0teWVzIl19>) (opens Cursor)

Or add it by hand to `~/.cursor/mcp.json` (all projects) or `.cursor/mcp.json` (this project):

`mcp.json`:

```json
{
  "mcpServers": {
    "sqlserver-rules-t-sql-analyzer": {
      "command": "dnx",
      "args": [
        "ErikEJ.DacFX.TSQLAnalyzer.Cli",
        "--yes"
      ]
    }
  }
}
```

Needs .NET 10 on your computer.

### VS Code

[Install in VS Code](<https://vscode.dev/redirect/mcp/install?name=sqlserver-rules-t-sql-analyzer&config=%7B%22type%22%3A%22stdio%22%2C%22command%22%3A%22dnx%22%2C%22args%22%3A%5B%22ErikEJ.DacFX.TSQLAnalyzer.Cli%22%2C%22--yes%22%5D%7D>) (opens VS Code)

Or from a terminal:

```bash
code --add-mcp '{"name":"sqlserver-rules-t-sql-analyzer","type":"stdio","command":"dnx","args":["ErikEJ.DacFX.TSQLAnalyzer.Cli","--yes"]}'
```

Or commit it to the repo in `.vscode/mcp.json`:

`.vscode/mcp.json`:

```json
{
  "servers": {
    "sqlserver-rules-t-sql-analyzer": {
      "type": "stdio",
      "command": "dnx",
      "args": [
        "ErikEJ.DacFX.TSQLAnalyzer.Cli",
        "--yes"
      ]
    }
  }
}
```

Needs .NET 10 on your computer.

### Devin Desktop

1. Add it to `~/.config/devin/mcp_config.json` (macOS and Linux) or `%APPDATA%\devin\mcp_config.json` (Windows):

`mcp_config.json`:

```json
{
  "mcpServers": {
    "sqlserver-rules-t-sql-analyzer": {
      "command": "dnx",
      "args": [
        "ErikEJ.DacFX.TSQLAnalyzer.Cli",
        "--yes"
      ]
    }
  }
}
```

2. Refresh the MCP server list in Cascade.

Devin Desktop is the new name for Windsurf.

### Codex

```bash
codex mcp add sqlserver-rules-t-sql-analyzer -- dnx ErikEJ.DacFX.TSQLAnalyzer.Cli --yes
```

Or edit `~/.codex/config.toml` directly:

`config.toml`:

```toml
[mcp_servers.sqlserver-rules-t-sql-analyzer]
command = "dnx"
args = ["ErikEJ.DacFX.TSQLAnalyzer.Cli", "--yes"]
```

Needs .NET 10 on your computer.

### Gemini CLI

```bash
gemini mcp add sqlserver-rules-t-sql-analyzer dnx -- ErikEJ.DacFX.TSQLAnalyzer.Cli --yes
```

This adds it to the current project. Add `-s user` to use it everywhere.

### Any client

Most clients that start local servers accept this shape:

```json
{
  "mcpServers": {
    "sqlserver-rules-t-sql-analyzer": {
      "command": "dnx",
      "args": [
        "ErikEJ.DacFX.TSQLAnalyzer.Cli",
        "--yes"
      ]
    }
  }
}
```

Zed puts servers under `context_servers` in its settings, with the same `command`, `args` and `env` fields.

Needs .NET 10 on your computer.

## Details

- Server version: 1.0
- Last checked: 2026-10-04
- Listed: 2026-10-04
- Updated: 2026-10-04

---
Source: https://mcp.tc/i/sqlserver-rules-t-sql-analyzer (mcp.tc is an independent directory, not affiliated with this server's publisher). Corrections: https://mcp.tc/report
