# Mssql Performance Skills

> SQL Server performance tuning skills for LLMs — 721 checks across 21 skills covering T-SQL, execution plans, wait stats, deadlocks, Query Store, indexes, encryption, Always On AG, WSFC, ERRORLOG, SPN, memory, disk I/O, config drift & setup logs. Remote MCP server on Cloudflare Workers.

- **Type:** MCP server
- **Install:** `agentstack add mcp-vanterx-mssql-performance-skills`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [vanterx](https://agentstack.voostack.com/s/vanterx)
- **Installs:** 0
- **Category:** [Databases](https://agentstack.voostack.com/c/databases)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [vanterx](https://github.com/vanterx)
- **Source:** https://github.com/vanterx/mssql-performance-skills

## Install

```sh
agentstack add mcp-vanterx-mssql-performance-skills
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# mssql-performance-skills — SQL Server Performance Tuning Skills for LLMs

> https://github.com/vanterx/mssql-performance-skills

### Claude.ai (Remote MCP)

Go to **claude.ai → Settings → Connectors → Add custom connector**, enter the URL and click Add:

```
https://mssql-mcp.tsx113.workers.dev
```

A collection of Claude Code skills covering the full SQL Server performance tuning workflow — from static T-SQL source review to execution plan analysis, I/O statistics, workload traces, wait statistics, Query Store analysis, procedure runtime stats, index recommendations, deadlock diagnosis, batch workload assessment, WSFC cluster log analysis, Always On AG health, AG configuration correctness, ERRORLOG operational review, SPN/Kerberos delegation diagnosis, full encryption infrastructure review (TDE, Always Encrypted, CLE, backup encryption, TLS, certificates, key hierarchy including sp_control_dbmasterkey_password/SSISDB, dynamic data masking, PCI-DSS/HIPAA/GDPR/FedRAMP compliance), instance/database configuration drift, SQL Server Setup Bootstrap log analysis, SQL Server Reporting Services (SSRS) report server trace log analysis, and SQL Server migration readiness (version/edition/platform compatibility, security-object portability, operational-object portability) — plus an agentic orchestrator that routes mixed artifacts to the right specialised skill. **830 checks across 26 skills.**

> **AI-Generated Skills** — These skills were planned and generated by Claude with open source community resource guidance. The check catalog, thresholds, and output formats are intended to be improved and validated by human DBAs against real workloads. PRs welcome for new checks, threshold adjustments, or output format refinements.

---

## Skills

| Skill | Purpose |
|-------|---------|
| [mssql-performance-review](#mssql-performance-review) | Agentic offline orchestrator — routes mixed artifacts (or a symptom description) to the right specialised skills, runs an adversarial root-cause check, and emits a single consolidated report with evidence chain, risk-rated fixes, and rollback. Use when you have several artifact types together or are not sure which skill to run. Also invocable as `/sql-triage` (equal-primary alias). |
| [tsql-review](#tsql-review) | Analyze raw T-SQL source code — 85 checks (T1–T85) — structural, security, correctness, performance, SQL 2017–2022 modern syntax |
| [sqlstats-review](#sqlstats-review) | Parse and analyze `SET STATISTICS IO, TIME ON` output — 27 checks (I1–I18 IO, W1–W9 time) |
| [sqltrace-review](#sqltrace-review) | Analyze Profiler trace / Extended Events output — 25 checks (X1–X12 event-level, X13–X25 workload aggregate) |
| [sqlwait-review](#sqlwait-review) | Analyze `sys.dm_os_wait_stats` — 44 checks (V1–V44) across I/O, lock, parallelism, memory, CPU, latch contention, log space, poison/throttle waits, backup I/O, insert hotspots, trend analysis, modern feature waits (In-Memory OLTP, Columnstore, Query Store, Transaction/DTC, Service Broker, Full Text, Parallel Redo), forced memory grants, grant timeouts, stolen memory, file I/O latency, IQP/PSP/ADR feature waits, and TempDB metadata contention |
| [sqlplan-review](#sqlplan-review) | Analyze a single `.sqlplan` file — 108 checks, prioritized report |
| [sqlplan-compare](#sqlplan-compare) | Diff two plans to find what caused a regression |
| [sqlindex-advisor](#sqlindex-advisor) | Derive indexes from operator patterns + consolidate optimizer suggestions into a ranked `CREATE INDEX` script |
| [sqldeadlock-review](#sqldeadlock-review) | Analyze a deadlock XML graph — identify pattern and fix |
| [sqlplan-batch](#sqlplan-batch) | Batch-analyze a folder of plans — dashboard + index script |
| [sqlquerystore-review](#sqlquerystore-review) | Analyze Query Store DMV output — 32 checks for regressed queries, plan instability, resource hotspots, configuration health, SQL 2019/2022 IQP/PSP/DOP/CE feedback, QS hints, and auto-tuning |
| [sqlprocstats-review](#sqlprocstats-review) | Analyze collected `sys.dm_exec_procedure_stats` snapshots — 25 checks (R1–R25) for top consumers, per-execution efficiency, N+1 patterns, trends, and advanced runtime patterns |
| [sqlclusterlog-review](#sqlclusterlog-review) | Analyze WSFC `CLUSTER.LOG` for Always On AG root-cause diagnosis — 30 checks (L1–L30): lease timeouts, health check failures, quorum loss, node eviction, network partition, RHS crashes, Cloud Witness, Azure Arc, Contained AG |
| [sqlhadr-review](#sqlhadr-review) | Analyze Always On AG health from `sys.dm_hadr_*` DMVs — 27 checks (H1–H28, H21 retired): replica connectivity, data loss risk, recovery time, throughput, configuration, modern AG features, seeding/initialization integrity |
| [sqlag-review](#sqlag-review) | Audit Always On AG configuration correctness across all layers — 37 checks (F1–F37): prerequisites, replica design, listener architecture, backup strategy, endpoint security, distributed AG topology, Basic/Contained AG constraints, AG scale ceiling, automatic seeding/manual-restore mismatch |
| [sqlerrorlog-review](#sqlerrorlog-review) | Analyze SQL Server ERRORLOG for operational issues — 33 checks (E1–E33): AG failover events, lease expiry, memory pressure, I/O slow, corruption warnings, login failure bursts, startup/shutdown, SQL 2019/2022 feature events |
| [sqlspn-review](#sqlspn-review) | Analyze SQL Server SPN configuration and Kerberos delegation settings — 40 checks (K1–K40): SPN presence, service account binding, AG listener and alias, permissions, delegation, AD account sensitivity, Azure AD hybrid, gMSA rollover, CNAME alias |
| [sqlmemory-review](#sqlmemory-review) | Analyze SQL Server memory pressure from memory clerks, PLE, plan cache, and memory grants — 20 checks (O1–O20): PLE, plan cache bloat, grant queue depth, grant timeout, ColumnStore/XTP footprint, OS pressure, LPIM, Max Server Memory |
| [sqldiskio-review](#sqldiskio-review) | Analyze SQL Server file-level I/O latency and auto-growth events from sys.dm_io_virtual_file_stats — 15 checks (Z1–Z15): data/log latency, hot file, stall ratio, storage placement, TempDB co-location, auto-growth sizing and timing |
| [sqlencryption-review](#sqlencryption-review) | Analyze the full SQL Server encryption posture from DMV output — 112 checks (A1–A112) across 20 categories: TDE, Always Encrypted, CLE, Backup, Transport/TLS, Certificates, Keys, Key Hierarchy, EKM/AKV, Compliance, TLS Hardening, AE Advanced, Key Lifecycle, Ledger, Azure, DMK Password Auto-Open (sp_control_dbmasterkey_password/SSISDB), DDM Patterns, Compliance Explicit (PCI-DSS v4/HIPAA/GDPR/FedRAMP), Operational Validation, Advanced Crypto Patterns |
| [sqlbootstraplog-review](#sqlbootstraplog-review) | Analyze SQL Server Setup Bootstrap logs (Summary.txt, Detail.txt, MSI logs, ConfigurationFile.ini) to diagnose failed installs, failed CU/SP patches, and risky setup-time configuration — 24 checks (U1–U24): exit-code extraction, failed setup rules, pending reboot, MSI Return value 3 forensics, service accounts, IFI, TempDB layout, security surface, directory placement |
| [sqldbconfig-review](#sqldbconfig-review) | Analyze SQL Server instance and database configuration drift from sp_configure and sys.databases output — 29 checks (B1–B29): MAXDOP alignment to NUMA, Cost Threshold for Parallelism, Max Server Memory, auto-shrink, auto-close, compatibility level, RCSI, page verification, auto-statistics, VLF count, percent auto-growth, Instant File Initialization, TempDB file count, surface area exposure, service-SID sysadmin membership |
| [ssrstracelog-review](#ssrstracelog-review) | Analyze SQL Server Reporting Services (SSRS) report server trace logs, RSReportServer.config/ReportingServicesService.exe.config excerpts, ExecutionLog3 output, and Event Log entries — 24 checks (G1–G24): trace configuration health, report server database connectivity, memory pressure and AppDomain recycling, report processing/rendering performance, subscription delivery failures, scale-out and encryption key management |
| [sqlmigration-review](#sqlmigration-review) | Audit SQL Server migration version/edition/platform compatibility — 15 checks (Y1–Y15): edition-gated features, version/compatibility-level ceiling, collation, discontinued features, In-Memory OLTP, Azure SQL limits, backup/log-chain readiness, AG seeding edition limits, source lifecycle urgency. Dispatcher with own checks |
| [sqlmigration-security-review](#sqlmigration-security-review) | Audit security-object portability for a SQL Server migration — 15 checks (J1–J15): login portability, permission fidelity, credentials/proxies, certificates/keys, CMS registrations |
| [sqlmigration-objects-review](#sqlmigration-objects-review) | Audit operational-object portability for a SQL Server migration — 16 checks (M1–M16): SQL Agent jobs/operators/alerts/proxies, linked servers, Database Mail, backup devices, custom errors, server triggers, XE sessions, endpoints |

---

## Quick Start

**5 minutes to your first analysis:**

1. Install the skills (see [Installation](#installation) below)
2. In SSMS, open [skills/sqlplan-review/examples/horrible.sqlplan](skills/sqlplan-review/examples/horrible.sqlplan)
3. In Claude Code, type:
   ```
   /sqlplan-review skills/sqlplan-review/examples/horrible.sqlplan
   ```
4. Compare the output to [skills/sqlplan-review/examples/horrible-analysis.md](skills/sqlplan-review/examples/horrible-analysis.md) — that's the reference gold-standard output showing the expected Critical / Warning / Info findings and Passed Checks table.

**Don't have a plan yet?** Use the symptom-based routing in [PERFORMANCE_TUNING_GUIDE.md](PERFORMANCE_TUNING_GUIDE.md) to pick the right skill for what you have.

---

## Installation

The skills are plain Markdown files. Copy them into your agent's skills directory — no build, no runtime, no dependencies.

### Claude Code

**Option 1: Plugin Marketplace (recommended)**

```bash
# Add the marketplace (once per machine or project)
/plugin marketplace add vanterx/mssql-performance-skills

# Install all 26 skills
/plugin install mssql-performance-skills@mssql-performance-skills
```

For project-scoped install, append `--scope project` to the marketplace add command.

**Option 2: `npx` one-liner**

```bash
npx skills add vanterx/mssql-performance-skills   # requires Node.js >= 18
```

Uses the third-party [`skills` npm package](https://www.npmjs.com/package/skills) — not maintained by Anthropic or this repo.

**Option 3: Manual**

```bash
git clone https://github.com/vanterx/mssql-performance-skills.git
cp -r mssql-performance-skills/skills/* ~/.claude/skills/   # global
# or
cp -r mssql-performance-skills/skills/* .claude/skills/     # project-scoped
```

### Contributing / Local Development

After cloning, install the git hooks to keep `skills-data.ts` in sync automatically:

```bash
bash scripts/install-hooks.sh
```

This installs a pre-commit hook that regenerates `mcp-server/src/skills-data.ts` whenever a `skills/*/SKILL.md` file is staged, so you never have to run `npm run bundle` manually before committing.

### MCP Server (Remote — Cloudflare Workers)

The skills are hosted as a remote MCP server on Cloudflare Workers — no Node.js, no clone, no build required.

**claude.ai web** — Settings → Connectors → Add custom connector:
```
https://mssql-mcp.tsx113.workers.dev
```

**OpenCode** — add to `~/.config/opencode/opencode.jsonc`:
```jsonc
{
  "mcp": {
    "mssql": {
      "type": "remote",
      "url": "https://mssql-mcp.tsx113.workers.dev"
    }
  }
}
```
> `"type": "remote"` is required (OpenCode v1.15.10+). Without it OpenCode treats the entry as a local stdio server and crashes on startup.

**Claude Desktop** does not support remote MCP servers via URL — use claude.ai web or the local Claude Code install method above.

Once connected, the following are available in any conversation:

| MCP Primitive | What's exposed |
|---------------|----------------|
| **3 Tools** | `list_skills`, `get_skill`, `route_artifact` (13 types: `tsql`, `sqlplan`, `deadlock`, `waits`, `trace`, `stats`, `querystore`, `procstats`, `hadr`, `clusterlog`, `errorlog`, `spn`, `mixed`) |
| **18 Resources** | `mssql://skills`, `mssql://skills/{name}` (×16), `mssql://guide` |
| **16 Prompts** | One per skill — pass your artifact as `input` |

> The server auto-deploys via GitHub Actions on every push. Source: [`mcp-server/`](mcp-server/)

### Other LLMs and IDEs

`SKILL.md` files are LLM-agnostic. Paste one into ChatGPT/Gemini as a system instruction, or drop it into:

| Target | Location |
|--------|----------|
| GitHub Copilot | `.github/copilot-instructions.md` (append) |
| Cursor | `.cursor/rules/.mdc` (one per skill) |
| Windsurf | `.windsurf/rules/` |
| Cline | `.clinerules/` |
| Aider | `.aider.conf.yml` under `custom-instructions` |

For non-Claude LLMs, use `SKILL.md` alone (not `references/check-explanations.md`) — it contains every trigger and threshold in a compact form. For large `.sqlplan` XML, ask the LLM to extract key fields first.

> **Not sure which skill to use?** See [PERFORMANCE_TUNING_GUIDE.md](PERFORMANCE_TUNING_GUIDE.md) for symptom-based routing.
> **Costs?** See [LLM_COST_ESTIMATION.md](LLM_COST_ESTIMATION.md).
> **Which checks apply to your SQL Server version?** See [VERSION_COMPATIBILITY.md](VERSION_COMPATIBILITY.md) — skill-level support matrix from SQL 2008 R2 through SQL 2022 and Azure SQL.

---

## Recommended Workflow

Use the full pipeline for a slow query you're actively tuning, or jump to the relevant step if you already have an artifact.

**Don't know which step to start at?** Run the orchestrator — it classifies your artifacts (or a symptom description), dispatches the right specialised skills in the right order, and runs an adversarial root-cause check across the merged findings.

```
╔══════════════════════════════════════════════════════════════╗
║  ENTRY POINT  — when you have mixed artifacts or only a      ║
║                  symptom, let the orchestrator route          ║
╠══════════════════════════════════════════════════════════════╣
║                                                              ║
║  Mixed inputs (.sqlplan + .sql + stats + waits + ...)        ║
║         OR                                                    ║
║  Symptom description ("CPU is high since 09:00")             ║
║         │                                                    ║
║         ▼                                                    ║
║  /mssql-performance-review   or   /sql-triage                ║
║  Agentic dispatcher — routes to specialised skills below,    ║
║  runs adversarial check, emits unified report with evidence  ║
║  chain, risk-rated fixes, rollback, and verification steps.  ║
║  Strictly offline — never contacts SQL Server.                ║
║                                                              ║
╠══════════════════════════════════════════════════════════════╣
║  SHIFT-LEFT  — catch problems before execution               ║
╠══════════════════════════════════════════════════════════════╣
║                                                              ║
║  T-SQL source code (.sql file, stored procedure body)        ║
║         │                                                    ║
║         ▼                                                    ║
║  /tsql-review                                                ║
║  85 checks — SQL injection, non-sargable predicates,         ║
║  cursor patterns, NULL bugs, deprecated syntax               ║
║                                                              ║
╠══════════════════════════════════════════════════════════════╣
║  RUNTIME MEASUREMENT — what actually happened                ║
╠══════════════════════════════════════════════════════════════╣
║                                                              ║
║  SET STATISTICS IO, TIME ON  (SSMS Messages tab)             ║
║         │

…

## Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [vanterx](https://github.com/vanterx)
- **Source:** [vanterx/mssql-performance-skills](https://github.com/vanterx/mssql-performance-skills)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** yes
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/mcp-vanterx-mssql-performance-skills
- Seller: https://agentstack.voostack.com/s/vanterx
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
