# SQL Sentinel MCP Server

Connect an AI agent to SQL Server monitoring and diagnostics through Extended Events. Use it to inspect query activity, blocking, deadlocks, and wait statistics.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 6
- Author: tkmawarire
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/tkmawarire/sql-sentinel
- Updated: 2026-09-30
- HTML: https://affpapa.org/en/nevibecode/mcp/sql-sentinel-mcp-server

## What it does

SQL Sentinel lets an agent manage Extended Events sessions, collect events, and filter the results. It can group queries with matching fingerprints, trace execution order, and inspect deadlock reports, blocked processes, and wait statistics. The server also supports timed event streaming and database tasks such as reading schemas, querying rows, and changing table data.

Set `SQL_SENTINEL_CONNECTION_STRING` for the database connection. The server requires SQL Server 2012 or later with Extended Events enabled, plus `ALTER ANY EVENT SESSION` and `VIEW SERVER STATE` permissions for session management. Blocked-process detection also depends on configuring `blocked process threshold`. Docker is one launch option, and requires Docker to be installed. Without a connection string, the server has no database to inspect.

## Requirements
- Needs: Docker

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add sql-sentinel-mcp-server -- docker run -i --rm ghcr.io/tkmawarire/sql-sentinel-mcp
```

### Codex

**Platform CLI**
```bash
codex mcp add sql-sentinel-mcp-server -- docker run -i --rm ghcr.io/tkmawarire/sql-sentinel-mcp
```

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "sql-sentinel-mcp-server": {
            "command": "docker",
            "args": [
                "run",
                "-i",
                "--rm",
                "ghcr.io/tkmawarire/sql-sentinel-mcp"
            ]
        }
    }
}
```

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "sql-sentinel-mcp-server": {
            "type": "stdio",
            "command": "docker",
            "args": [
                "run",
                "-i",
                "--rm",
                "ghcr.io/tkmawarire/sql-sentinel-mcp"
            ]
        }
    }
}
```

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add sql-sentinel-mcp-server docker run -i --rm ghcr.io/tkmawarire/sql-sentinel-mcp
```

## When to use it
- capture SQL query activity with Extended Events
- inspect deadlocks and identify their processes
- trace blocked processes and their wait resources
- group similar queries by fingerprint
- check SQL Server wait statistics

## Example prompts
- Create an Extended Events session for the app's queries and show me the captured events.
- Find deadlocks and explain which processes were involved.
- Group similar queries and compare their execution timings.

## Similar
- [World Monitor](https://affpapa.org/en/nevibecode/mcp/world-monitor.md) — MCP server · ★ 89609
- [Scrapling MCP Server](https://affpapa.org/en/nevibecode/mcp/scrapling-mcp-server.md) — MCP server · ★ 89899
- [MCP Toolbox for Databases](https://affpapa.org/en/nevibecode/mcp/googleapis-mcp-toolbox-for-databases.md) — MCP server · ★ 16730
- [PostHog MCP Server](https://affpapa.org/en/nevibecode/mcp/posthog-mcp-server.md) — MCP server · ★ 40459
- [dbx](https://affpapa.org/en/nevibecode/mcp/dbx.md) — MCP server · ★ 27844
- [Metabase](https://affpapa.org/en/nevibecode/mcp/metabase.md) — MCP server · ★ 49863

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
