# sql-querystore MCP server

> Enables LLM agents to perform read-only SQL Server diagnostics using Query Store, execution plans, and wait statistics.

- Repository: https://github.com/deepeshd87/mcp-sql-querystore
- Page: https://hostedmcp.org/servers/deepeshd87/mcp-sql-querystore
- Transport: stdio
- Stars: 1
- License: MIT
- Latest version: 0.1.1

## Install

### Claude Code

```sh
claude mcp add mcp-sql-querystore -- uvx mcp-sql-querystore
```

### Cursor (`~/.cursor/mcp.json`)

```json
{
  "mcpServers": {
    "mcp-sql-querystore": {
      "command": "uvx",
      "args": [
        "mcp-sql-querystore"
      ]
    }
  }
}
```

### VS Code (`.vscode/mcp.json`)

```json
{
  "servers": {
    "mcp-sql-querystore": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "mcp-sql-querystore"
      ]
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"mcp-sql-querystore","type":"stdio","command":"uvx","args":["mcp-sql-querystore"]}'
```

### Claude Desktop (`claude_desktop_config.json`)

```json
{
  "mcpServers": {
    "mcp-sql-querystore": {
      "command": "uvx",
      "args": [
        "mcp-sql-querystore"
      ]
    }
  }
}
```

### Codex

```sh
codex mcp add mcp-sql-querystore -- uvx mcp-sql-querystore
```

### Codex config.toml (`~/.codex/config.toml`)

```toml
[mcp_servers.mcp-sql-querystore]
command = "uvx"
args = ["mcp-sql-querystore"]
```

### Gemini CLI

```sh
gemini mcp add -s user mcp-sql-querystore uvx -- mcp-sql-querystore
```

### Gemini settings.json (`~/.gemini/settings.json`)

```json
{
  "mcpServers": {
    "mcp-sql-querystore": {
      "command": "uvx",
      "args": [
        "mcp-sql-querystore"
      ]
    }
  }
}
```

## Tools (6)

- `get_regressed_queries`
- `get_query_execution_plan`
- `analyze_parameter_sniffing`
- `get_missing_index_impact`
- `get_wait_stats`
- `sweep_regressions`

## FAQ

### Is this server safe to use on production databases?

The server is read-only, but you should validate it against a non-production instance first, especially on SQL Server versions other than those noted in the caveats.

### What kind of diagnostic information can the AI access?

The server provides tools for regressed queries, execution plans, parameter sniffing analysis, missing index impact, and wait statistics.

### Does the server log sensitive information like SQL text?

No, the audit logger records the tool, database, a hash of the SQL, row count, and elapsed time, but never the connection strings, SQL text, or parameter values.
