原型 · 预览版:收录官方注册中心里的全部服务器,每 30 分钟同步一次。评价和账户功能将在后续阶段推出。
PopNx MCP为使用 AI 的人准备的 MCP 服务器 · 用大白话讲清楚

MCP SQL Querystore

作者:deepeshd87版本 0.1.1i★ –i在你的电脑上运行
注册名称io.github.deepeshd87/mcp-sql-querystore

安装

概览

作者提供的说明(英文原文)

Read-only SQL Server diagnostics for LLM agents: Query Store, waits, plans, indexes

PopNx MCP 的三大支柱

这三项永远不会合并成一个分数:意见、测量和人气是不同的东西。

它能帮你做什么

我们还没有为它写通俗的介绍。下面是我们从注册中心读取到的事实。

  • 连接方式: 在你的电脑上运行
  • 传输方式: stdio
  • 分类: 数据库与数据集

安装

选择你使用的 AI 应用,然后复制设置。

安装之前

  • 基础检查:1 项中通过 1 项
  • 在你的电脑上运行,拥有你的用户账户的权限(文件、网络、应用)。
  • 注册中心没有列出需要填写的密钥。

你需要

  • PyPI已安装 Python 的 uv(用于 uvx 命令)

你用的是哪个应用?

在上方选择你的应用。我们会记住它,下次按钮会显示“安装到 …”。

打开 Claude Desktop → Settings → Developer → Edit Config,把下面的内容粘贴到 claude_desktop_config.json

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

在终端中运行这条命令

claude mcp add sql-querystore -- uvx mcp-sql-querystore

在 Cursor 中打开

或者自己复制设置

粘贴到项目中的 .cursor/mcp.json,或 ~/.cursor/mcp.json

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

浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。

在 VS Code 中打开

或者自己复制设置

粘贴到项目中的 .vscode/mcp.json

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

浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。

这个服务器在你的电脑上运行,而 ChatGPT 只能连接互联网上的服务器。请选择其他应用。

你的选择通过 Cookie 保存在这台设备上,无需账户。

这些设置是根据作者在注册中心的条目生成的。如果 README 的写法不同,请以 README 为准。

它能做什么

它在你的电脑上运行;安装后,工具列表会显示在你的 AI 应用中。

基础检查i

我们检查的是任何人都能看到的信息;我们没有阅读代码。不适用的检查项不计入总数。 · 检查于 2026年11月6日

  • ✓ 通过

    作者与仓库一致

    注册名称已通过 GitHub 账户 deepeshd87 验证,该账户拥有此仓库

  • … 尚未检查

    仍在维护

    我们还没有从 GitHub 读取这个仓库

  • … 尚未检查

    有许可证

    我们还没有从 GitHub 读取这个仓库

  • – 不适用

    端点有响应

    它在你的电脑上运行,没有互联网端点

  • – 不适用

    使用 OAuth 登录

    在你的电脑上运行,改用本地设置

  • … 尚未检查

    工具描述中没有隐藏指令

    它在你的电脑上运行;我们只能读取互联网端点的工具列表

与“数据库与数据集”中的其他服务器比较i

  • 星标数多于此分类中其他 953 个服务器的 0%
  • 发布到注册中心的时间比此分类中其他 953 个服务器的 64% 更新
  • 基础检查结果等于或优于此分类中其他 953 个服务器的 100%

与注册中心里这个分类中所有活跃的服务器比较。只有当发布者拥有该仓库时,星标数才计入。

常见问题

MCP SQL Querystore 安全吗?

它在 1 项适用的基础检查中通过了 1 项。我们没有阅读代码。在添加密钥或令牌之前,请先看看这个服务器要求哪些权限,并使用只具备所需权限的密钥。

它需要哪些密钥或代码?

注册中心没有列出必需的密钥,不过有些服务器会在首次使用时要求你登录。

它在我的电脑上运行还是在云端?

它在你的电脑上运行。你的 AI 应用会在需要时启动它,数据不会经过作者的服务器(除非它自己调用在线服务)。

它还在维护吗?

GitHub 仓库最后更新于–,最新版本(0.1.1)于33天前进入注册中心。

哪些应用可以使用它?

支持 MCP 的应用,例如 Claude Desktop、Claude Code、Cursor 和 VS Code。你的电脑上还需要有 Python (uv)。

有什么可以替代它?

同一分类中有:Supabase, MongoDB MCP Server, Elasticsearch MCP Server

替代选择

同一分类中其他作者的服务器,按星标数排序。

如何看卡片:★ GitHub 星标i三大支柱:评价 · 检查 · 使用情况i更新 = 最新版本发布到注册中心的时间i

Supabase

作者:supabase

MCP server for interacting with the Supabase platform

电脑或云端★ 2,993Apache-2.0昨天更新
安装

MongoDB MCP Server

作者:mongodb-js

MongoDB Model Context Protocol Server

在你的电脑上运行★ 1,157Apache-2.0前天更新
安装

MCP server for interacting with Elasticsearch

在你的电脑上运行★ 315Apache-2.014个月前更新
安装

作者的 README

打开 README

按原文从作者的仓库复制。PopNx MCP 没有审查或背书其内容。HTML、图片和脚本已被移除。链接会离开本站。

mcp-name: io.github.deepeshd87/mcp-sql-querystore

mcp-sql-querystore

Read-only MCP server exposing SQL Server Query Store diagnostics to LLM agents.

Six read-only diagnostic tools over Query Store, DMVs, and execution plans. The tools have been validated against a live SQL Server instance and are covered by a unit + integration test suite. Still validate against a non-prod instance of your own before pointing it at production, especially on SQL Server versions other than those noted under caveats.

Quickstart

  1. Provision a read-only login. Run provisioning/create_readonly_login.sql against your instance (edit names first). This login's permissions are the read-only guarantee — see the security model below.
  2. Install. pip install -e . in a virtual environment. ODBC Driver 18 for SQL Server must be installed on the host.
  3. Store the password outside the repo. Put it in a plain-text file somewhere the repo can't reach (not under the project folder):

Windows PowerShell, UTF-8, password only, no quotes/newline

New-Item -ItemType Directory -Force C:\Users\you\secrets | Out-Null Set-Content -NoNewline -Encoding utf8 C:\Users\you\secrets\mcp_sql.pwd 'your-password'

Or skip the password entirely with integrated auth (MCP_SQL_TRUSTED=yes) — preferred for CJIS/PCI. See Secret handling below for all options.

  1. Configure your MCP client. Copy the sql-querystore block from claude_desktop_config.example.json into your real Claude Desktop config (Windows: %APPDATA%\Claude\claude_desktop_config.json), then replace the placeholder paths, server name, and MCP_SQL_PWD_FILE. Set MCP_SQL_TRUST_CERT=yes only for a self-signed/local cert; leave it no against instances with proper certificates.
  2. Restart your MCP client and confirm the server shows as running.

Never commit your real config or your password file. .gitignore already excludes *.pwd, .env, and claude_desktop_config.json.

Security model (read this first)

The read-only guarantee comes from the SQL login's permissions, not from any code in this repo:

  • Provision a dedicated login with VIEW DATABASE STATE (and VIEW SERVER STATE only if you use server-scoped DMVs) and nothing else — no db_datareader, no SELECT on user tables. See provisioning/create_readonly_login.sql.
  • The keyword screen in db.py and the fixed SELECT-only query text are defense-in-depth, not the primary control.
  • ApplicationIntent=ReadOnly in the connection string only routes to a readable secondary in an availability group. On a standalone instance it does not make the session read-only. Do not rely on it for safety.
  • Credentials never belong in code. The simplest setup uses the MCP_SQL_CONNECTION_STRING env var, but for CJIS/PCI environments prefer integrated auth or a file/secret-store-sourced password — see the Secret handling section below.
  • Every query is recorded via the audit logger — see Audit logging below. In a regulated environment, route that logger to a durable file or SIEM.

Setup

ODBC Driver 18 for SQL Server must be installed on the host. Install the package, then configure the connection via environment variables (see Secret handling for all options). The recommended form keeps the password in a file, not inline:

pip install -e .

PowerShell — connection assembled from parts, password read from a file

$env:MCP_SQL_SERVER = "yourhost\INSTANCE" $env:MCP_SQL_DATABASE = "master" $env:MCP_SQL_UID = "mcp_readonly" $env:MCP_SQL_PWD_FILE = "C:\path\to\your\secret.pwd" $env:MCP_SQL_TRUST_CERT = "no" # "yes" only for a self-signed/local cert

python -m mcp_sql_querystore.server

Or use integrated auth with no stored password at all (MCP_SQL_TRUSTED=yes). A full MCP_SQL_CONNECTION_STRING is also accepted for simple cases — see Secret handling.

Register it with your MCP client (e.g. Claude Desktop) as an stdio server invoking python -m mcp_sql_querystore.server; see claude_desktop_config.example.json.

Tools

All tools are read-only and take a database_name (except sweep_regressions, which can sweep all databases). Each returns JSON, or a structured error dict on failure rather than raising.

  • get_regressed_queries — compares a recent window against an earlier baseline window per query and flags those worse by at least regression_threshold. A real baseline-vs-recent comparison, not a top-CPU list.
  • get_query_execution_plan — returns compiled plans for a query_id with a compact JSON summary (missing indexes, warnings incl. implicit conversions, key lookups) and optional raw XML.
  • analyze_parameter_sniffing — finds queries with multiple compiled plans and ranks them by the ratio of slowest to fastest plan mean duration — the classic parameter-sniffing signature.
  • get_missing_index_impact — scans recent plans containing missing-index recommendations, parses the impact score from the plan XML, and aggregates duplicate recommendations across queries, ranked by impact then recurrence.
  • get_wait_stats — aggregates query wait time by wait category over a window, showing *why* queries are slow (CPU, blocking/locks, IO, memory) rather than which. De-duplicates flushed vs in-memory rows per Microsoft guidance.
  • sweep_regressions — runs regression detection across all Query Store-enabled online databases (or an explicit database_names list) and returns the worst per database, ranked. One failing database does not abort the sweep; its error is collected and reported.

Example prompts

Once the server is connected to your MCP client, you drive the tools in plain language. Name the target database in the prompt (except sweep_regressions, which can scan all of them). Replace YourDB with your database name.

Wait stats — why queries are slow

  • "What are the top wait categories in YourDB over the last week?"
  • "Is YourDB waiting on CPU, memory, or IO?"
  • "Show me wait stats for YourDB over the last 24 hours."

Execution plans

  • "Get the execution plan for query_id 10 in YourDB and summarize it."
  • "Does query_id 13 in YourDB have missing index recommendations?"
  • "Are there implicit conversion warnings in query 12's plan in YourDB?"

Regression analysis

  • "Check YourDB for CPU regressions over the last 24 hours."
  • "Which queries in YourDB regressed by more than 30%?"
  • "Find duration regressions in YourDB, ignoring anything with fewer than 10 executions."

Parameter sniffing

  • "Check YourDB for parameter sniffing."
  • "Which queries in YourDB have unstable plans?"

Missing indexes

  • "What missing indexes does YourDB need most?"
  • "Show me the top 10 index recommendations for YourDB by impact."

Multi-database sweep (no database name needed)

  • "Sweep all my databases for CPU regressions."
  • "Which database has the worst regressions this week?"

Combined — chaining tools in one turn

  • "Find the biggest CPU regression in YourDB, pull its plan, and tell me why it might have regressed."
  • "YourDB feels slow — diagnose it." (wait stats → regressions → plans)
  • "Full performance triage of YourDB: wait stats, top regressions, and missing indexes."

Known caveats / TODO

  • Version differences. Query Store column names assume SQL Server 2019+/2022 and Azure SQL MI. Verify against 2016/2017 if you target those.
  • Regression semantics. Current logic uses execution-weighted averages. You may prefer percentile-based comparison (Query Store doesn't store percentiles directly, so that needs *_stdev columns and assumptions).
  • Not time-windowed: analyze_parameter_sniffing aggregates across all Query Store history; on busy databases consider adding a recent_hours filter like the other tools have.
  • Remaining hardening: connection retry with backoff, and version-aware column handling for mixed 2016/2017/2019/2022 fleets.

Secret handling

The connection string is resolved in this order, so the password need not sit in plaintext config:

  1. MCP_SQL_CONNECTION_STRING — the full string (simplest; back-compat).
  2. MCP_SQL_CONNECTION_STRING_FILE — path to a file holding the full string (Docker/K8s secret-mount style).
  3. Assembled from parts: MCP_SQL_SERVER (+ MCP_SQL_DATABASE, MCP_SQL_DRIVER, MCP_SQL_ENCRYPT, MCP_SQL_TRUST_CERT, MCP_SQL_EXTRA). Auth is either:
  • Integrated (preferred for CJIS/PCI — no password stored): MCP_SQL_TRUSTED=yes.
  • SQL auth: MCP_SQL_UID plus the password from MCP_SQL_PWD_FILE (a vault-mounted file), MCP_SQL_PWD_ENV (name of another env var), or MCP_SQL_PWD (direct; least preferred).

Timeouts: MCP_SQL_CONNECT_TIMEOUT (default 10s) and MCP_SQL_QUERY_TIMEOUT (default 30s, 0 disables).

Audit logging

Every query attempt is logged via the mcp_sql_querystore.audit logger: tool, database, a 12-char hash of the SQL (not the text), row count, elapsed ms, and outcome. Connection strings, SQL text, and parameter values are never logged. Configure a handler for that logger to route the audit trail to a file or SIEM.

Testing

Unit tests (no database, safe in CI):

pip install -e ".[test]" pytest

Integration tests (real instance, opt-in):

set a working connection (any form above), then:

$env:MCP_SQL_TEST_DATABASE = "RAG" $env:MCP_SQL_RUN_INTEGRATION = "1" pytest tests/test_integration.py -v

问 PopNx